diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-12-21 01:43:58 -0800 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-01 17:47:05 -0800 |
commit | 8eb9612799605a7988d1c97cdc5980a5b8f04c56 (patch) | |
tree | 3fbeba200bb259f11fa4fafd7e60d22b86010a32 /include/linux/pwm.h | |
parent | d4c0c4705bef1134339b038872ece3705a2783e0 (diff) |
pwm: core: Rename of_pwm_request() to of_pwm_get() and export it
Allow client driver to use of_pwm_get() to get the PWM they need. This
is needed for drivers which handle more than one PWM separately, like
leds-pwm driver, which have:
pwmleds {
compatible = "pwm-leds";
kpad {
label = "omap4::keypad";
pwms = <&twl_pwm 0 7812500>;
max-brightness = <127>;
};
charging {
label = "omap4:green:chrg";
pwms = <&twl_pwmled 0 7812500>;
max-brightness = <255>;
};
};
in the dts files.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r-- | include/linux/pwm.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index cc908a5396f8..76a1959f2b23 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -175,6 +175,7 @@ struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args); struct pwm_device *pwm_get(struct device *dev, const char *con_id); +struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id); void pwm_put(struct pwm_device *pwm); struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id); @@ -213,6 +214,12 @@ static inline struct pwm_device *pwm_get(struct device *dev, return ERR_PTR(-ENODEV); } +static inline struct pwm_device *of_pwm_get(struct device_node *np, + const char *con_id) +{ + return ERR_PTR(-ENODEV); +} + static inline void pwm_put(struct pwm_device *pwm) { } |