X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fpwm.h;h=ebee227a670d4bb043a9a50186707760d3588702;hb=f592edd92024ffe178d387d289015c976c5c95ef;hp=851915eb87a6e253868bcbda25a2a09710a8c0a2;hpb=82d72a1b9967cff4908f22c57536c3660f794401;p=u-boot diff --git a/include/pwm.h b/include/pwm.h index 851915eb87..ebee227a67 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -34,6 +34,15 @@ struct pwm_ops { * @return 0 if OK, -ve on error */ int (*set_enable)(struct udevice *dev, uint channel, bool enable); + /** + * set_invert() - Set the PWM invert + * + * @dev: PWM device to update + * @channel: PWM channel to update + * @polarity: true to invert, false to keep normal polarity + * @return 0 if OK, -ve on error + */ + int (*set_invert)(struct udevice *dev, uint channel, bool polarity); }; #define pwm_get_ops(dev) ((struct pwm_ops *)(dev)->driver->ops) @@ -60,6 +69,16 @@ int pwm_set_config(struct udevice *dev, uint channel, uint period_ns, */ int pwm_set_enable(struct udevice *dev, uint channel, bool enable); +/** + * pwm_set_invert() - Set pwm default polarity + * + * @dev: PWM device to update + * @channel: PWM channel to update + * @polarity: true to invert, false to keep normal polarity + * @return 0 if OK, -ve on error + */ +int pwm_set_invert(struct udevice *dev, uint channel, bool polarity); + /* Legacy interface */ #ifndef CONFIG_DM_PWM int pwm_init (int pwm_id, int div, int invert);