diff options
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r-- | include/linux/pwm.h | 10 |
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 | */ |
150 | struct pwm_chip { | 152 | struct 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); | |||
182 | struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, | 185 | struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, |
183 | const char *con_id); | 186 | const char *con_id); |
184 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); | 187 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); |
188 | |||
189 | bool pwm_can_sleep(struct pwm_device *pwm); | ||
185 | #else | 190 | #else |
186 | static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) | 191 | static 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, | |||
242 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) | 247 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) |
243 | { | 248 | { |
244 | } | 249 | } |
250 | |||
251 | static inline bool pwm_can_sleep(struct pwm_device *pwm) | ||
252 | { | ||
253 | return false; | ||
254 | } | ||
245 | #endif | 255 | #endif |
246 | 256 | ||
247 | struct pwm_lookup { | 257 | struct pwm_lookup { |