ITE: drivers/pwm: Add the flag of PWM output open-drain mode
This flag is used when the PWM output is set to open-drain mode. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
parent
6e1a205819
commit
ed37374dac
4 changed files with 27 additions and 0 deletions
|
@ -106,6 +106,11 @@ static int pwm_it8xxx2_set_cycles(const struct device *dev,
|
|||
*reg_pwmpol &= ~BIT(ch);
|
||||
}
|
||||
|
||||
/* Enable PWM output open-drain */
|
||||
if (flags & PWM_IT8XXX2_OPEN_DRAIN) {
|
||||
inst->PWMODENR |= BIT(ch);
|
||||
}
|
||||
|
||||
/* If pulse cycles is 0, set duty cycle 0 and enable pwm channel */
|
||||
if (pulse_cycles == 0) {
|
||||
*reg_dcr = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue