diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-04-20 12:16:44 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-04-20 12:16:44 -0400 |
commit | f53f292eeaa234615c31a1306babe703fc4263f2 (patch) | |
tree | 707b0933a20f7dc05495e974243a23b5c9f8c918 /include/linux/pwm.h | |
parent | 15b9c359f288b09003cb70f7ed204affc0c6614d (diff) | |
parent | a9499fa7cd3fd4824a7202d00c766b269fa3bda6 (diff) |
Merge remote-tracking branch 'efi/chainsaw' into x86/efi
Resolved Conflicts:
drivers/firmware/efivars.c
fs/efivarsfs/file.c
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r-- | include/linux/pwm.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 6d661f32e0e4..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) |
@@ -174,11 +177,16 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, | |||
174 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, | 177 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, |
175 | const struct of_phandle_args *args); | 178 | const struct of_phandle_args *args); |
176 | 179 | ||
177 | struct pwm_device *pwm_get(struct device *dev, const char *consumer); | 180 | struct pwm_device *pwm_get(struct device *dev, const char *con_id); |
181 | struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id); | ||
178 | void pwm_put(struct pwm_device *pwm); | 182 | void pwm_put(struct pwm_device *pwm); |
179 | 183 | ||
180 | struct pwm_device *devm_pwm_get(struct device *dev, const char *consumer); | 184 | struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id); |
185 | struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, | ||
186 | const char *con_id); | ||
181 | 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); | ||
182 | #else | 190 | #else |
183 | 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) |
184 | { | 192 | { |
@@ -213,6 +221,12 @@ static inline struct pwm_device *pwm_get(struct device *dev, | |||
213 | return ERR_PTR(-ENODEV); | 221 | return ERR_PTR(-ENODEV); |
214 | } | 222 | } |
215 | 223 | ||
224 | static inline struct pwm_device *of_pwm_get(struct device_node *np, | ||
225 | const char *con_id) | ||
226 | { | ||
227 | return ERR_PTR(-ENODEV); | ||
228 | } | ||
229 | |||
216 | static inline void pwm_put(struct pwm_device *pwm) | 230 | static inline void pwm_put(struct pwm_device *pwm) |
217 | { | 231 | { |
218 | } | 232 | } |
@@ -223,9 +237,21 @@ static inline struct pwm_device *devm_pwm_get(struct device *dev, | |||
223 | return ERR_PTR(-ENODEV); | 237 | return ERR_PTR(-ENODEV); |
224 | } | 238 | } |
225 | 239 | ||
240 | static inline struct pwm_device *devm_of_pwm_get(struct device *dev, | ||
241 | struct device_node *np, | ||
242 | const char *con_id) | ||
243 | { | ||
244 | return ERR_PTR(-ENODEV); | ||
245 | } | ||
246 | |||
226 | 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) |
227 | { | 248 | { |
228 | } | 249 | } |
250 | |||
251 | static inline bool pwm_can_sleep(struct pwm_device *pwm) | ||
252 | { | ||
253 | return false; | ||
254 | } | ||
229 | #endif | 255 | #endif |
230 | 256 | ||
231 | struct pwm_lookup { | 257 | struct pwm_lookup { |