aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pwm.h
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-12-21 04:43:58 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-01 20:47:05 -0500
commit8eb9612799605a7988d1c97cdc5980a5b8f04c56 (patch)
tree3fbeba200bb259f11fa4fafd7e60d22b86010a32 /include/linux/pwm.h
parentd4c0c4705bef1134339b038872ece3705a2783e0 (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.h7
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,
175 const struct of_phandle_args *args); 175 const struct of_phandle_args *args);
176 176
177struct pwm_device *pwm_get(struct device *dev, const char *con_id); 177struct pwm_device *pwm_get(struct device *dev, const char *con_id);
178struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id);
178void pwm_put(struct pwm_device *pwm); 179void pwm_put(struct pwm_device *pwm);
179 180
180struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id); 181struct 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,
213 return ERR_PTR(-ENODEV); 214 return ERR_PTR(-ENODEV);
214} 215}
215 216
217static inline struct pwm_device *of_pwm_get(struct device_node *np,
218 const char *con_id)
219{
220 return ERR_PTR(-ENODEV);
221}
222
216static inline void pwm_put(struct pwm_device *pwm) 223static inline void pwm_put(struct pwm_device *pwm)
217{ 224{
218} 225}