test: clk: test clock self assignment
[oweals/u-boot.git] / drivers / pwm / pwm-uclass.c
index c2200af8a554676d9bb6b040302e15f187ee0648..027181c6465277d1c5d4cec2d1c72937d6f3646d 100644 (file)
@@ -1,14 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2016 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <dm.h>
 #include <pwm.h>
 
+int pwm_set_invert(struct udevice *dev, uint channel, bool polarity)
+{
+       struct pwm_ops *ops = pwm_get_ops(dev);
+
+       if (!ops->set_invert)
+               return -ENOSYS;
+
+       return ops->set_invert(dev, channel, polarity);
+}
+
 int pwm_set_config(struct udevice *dev, uint channel, uint period_ns,
                   uint duty_ns)
 {