aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 12:34:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 12:34:29 -0500
commit3eb05225ee8efb81fe50558f5f9d94e7477ade8f (patch)
tree40692236718c808455f1fcdfbc1c6de6a274eb36 /include
parented5dc2372dba46e0ecd08791b1a0399d313e5cff (diff)
parent30f786170352b8264bc7b61c2482713e54accec8 (diff)
Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
Pull PWM changes from Thierry Reding: "A new driver has been added to support the PWM mode of the timer counter blocks found on Atmel AT91 SoCs. The VT8500 driver now supports changing the PWM signal polarity and the TI drivers (EHRPWM and ECAP) gained suspend and resume functionality. User drivers can now query the core for whether access to a PWM device will sleep (if the PWM chip is on a slow bus such as I2C or SPI). The pwm-backlight driver now handles the backlight BL_CORE_FBBLANK state in addition to the FB layer's blanking states. To round things off, a few fixes and cleanups are also included" * tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm: pwm: twl: Use to_twl() instead of container_of() pwm: tegra: assume CONFIG_OF pwm_backlight: Validate dft_brightness in main probe function pwm: Export pwm_{set,get}_chip_data() pwm: Make Kconfig entries more consistent pwm: Add can_sleep property to drivers pwm: Add pwm_can_sleep() as exported API to users pwm-backlight: handle BL_CORE_FBBLANK state pwm: pwm-tiecap: Low power sleep support pwm: pwm-tiehrpwm: Low power sleep support pwm: pwm-tiehrpwm: Update the clock handling of pwm-tiehrpwm driver pwm: vt8500: Add polarity support pwm: vt8500: Register write busy test performed incorrectly pwm: atmel: add Timer Counter Block PWM driver
Diffstat (limited to 'include')
-rw-r--r--include/linux/pwm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 70655a205b74..a4df2042b79c 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -146,6 +146,8 @@ struct pwm_ops {
146 * @base: number of first PWM controlled by this chip 146 * @base: number of first PWM controlled by this chip
147 * @npwm: number of PWMs controlled by this chip 147 * @npwm: number of PWMs controlled by this chip
148 * @pwms: array of PWM devices allocated by the framework 148 * @pwms: array of PWM devices allocated by the framework
149 * @can_sleep: must be true if the .config(), .enable() or .disable()
150 * operations may sleep
149 */ 151 */
150struct pwm_chip { 152struct pwm_chip {
151 struct device *dev; 153 struct device *dev;
@@ -159,6 +161,7 @@ struct pwm_chip {
159 struct pwm_device * (*of_xlate)(struct pwm_chip *pc, 161 struct pwm_device * (*of_xlate)(struct pwm_chip *pc,
160 const struct of_phandle_args *args); 162 const struct of_phandle_args *args);
161 unsigned int of_pwm_n_cells; 163 unsigned int of_pwm_n_cells;
164 bool can_sleep;
162}; 165};
163 166
164#if IS_ENABLED(CONFIG_PWM) 167#if IS_ENABLED(CONFIG_PWM)
@@ -182,6 +185,8 @@ struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id);
182struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, 185struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
183 const char *con_id); 186 const char *con_id);
184void devm_pwm_put(struct device *dev, struct pwm_device *pwm); 187void devm_pwm_put(struct device *dev, struct pwm_device *pwm);
188
189bool pwm_can_sleep(struct pwm_device *pwm);
185#else 190#else
186static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) 191static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data)
187{ 192{
@@ -242,6 +247,11 @@ static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
242static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) 247static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
243{ 248{
244} 249}
250
251static inline bool pwm_can_sleep(struct pwm_device *pwm)
252{
253 return false;
254}
245#endif 255#endif
246 256
247struct pwm_lookup { 257struct pwm_lookup {