summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2012-02-16 19:23:46 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-17 10:18:30 +0100
commit6fa3e3119ff2864dac131933a1abfe201a264a0a (patch)
treebc1801199087d49193a50866193299101a525aad /include
parentf917e6f866e6b0304a9f4e64980c27fb85271a40 (diff)
downloadbarebox-6fa3e3119ff2864dac131933a1abfe201a264a0a.tar.gz
barebox-6fa3e3119ff2864dac131933a1abfe201a264a0a.tar.xz
drivers/pwm: add duty_ns and period_ns to core pwm chip
Add variables to control the duty_ns and period_ns of PWM chips. When these variables are set, a call to either pwm_enable() or pwm_config() is performed to enforce the setup values. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/pwm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/pwm.h b/include/pwm.h
index 80f88b194d..bdc2fdd858 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -2,6 +2,7 @@
#define __PWM_H
struct pwm_device;
+struct device_d;
/*
* pwm_request - request a PWM device
@@ -51,13 +52,17 @@ struct pwm_ops {
* struct pwm_chip - abstract a PWM
* @devname: unique identifier for this pwm
* @ops: The callbacks for this PWM
+ * @duty_ns: The duty cycle of the PWM, in nano-seconds
+ * @period_ns: The period of the PWM, in nano-seconds
*/
struct pwm_chip {
const char *devname;
struct pwm_ops *ops;
+ int duty_ns;
+ int period_ns;
};
-int pwmchip_add(struct pwm_chip *chip);
+int pwmchip_add(struct pwm_chip *chip, struct device_d *dev);
int pwmchip_remove(struct pwm_chip *chip);
#endif /* __PWM_H */