npcx: Move pwm open-drain functionality from gpio to pwm driver.

Setting PWM IO type in gpio driver seems not a proper way. This
CL moves this functionality to pwm driver and introduces a new
flag PWM_CONFIG_OPEN_DRAIN to achieve it when user declared it
in board driver.

BRANCH=none
BUG=none
TEST=test pwm functionality on npcx_evb.

Change-Id: I90c60445d1fb10902244ddf0f635d8304e72f4ab
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/458043
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Mulin Chao
2017-03-22 17:42:34 +08:00
committed by chrome-bot
parent 61f61b368e
commit e43ba03ebf
7 changed files with 18 additions and 28 deletions

View File

@@ -71,4 +71,8 @@ int pwm_get_duty(enum pwm_channel ch);
* PWM channel must stay active in low-power idle, if enabled.
*/
#define PWM_CONFIG_DSLEEP (1 << 4)
/**
* PWM channel's IO type is open-drain, if enabled. (default IO is push-pull.)
*/
#define PWM_CONFIG_OPEN_DRAIN (1 << 5)
#endif /* __CROS_EC_PWM_H */