blob: 8402b5dd3e0676e3f29f684cdc6b6716ca7f42b4 [file] [log] [blame]
Russell King1a189b92008-04-13 21:41:55 +01001#ifndef __LINUX_PWM_H
2#define __LINUX_PWM_H
3
Tushar Behera0bcf1682012-09-12 15:31:46 +05304#include <linux/err.h>
Jonathan Richardsond1cd2142015-10-16 17:40:58 -07005#include <linux/mutex.h>
Thierry Reding7299ab72011-12-14 11:10:32 +01006#include <linux/of.h>
7
Lee Jones3a3d1a42016-06-08 10:21:23 +01008struct pwm_capture;
Thierry Reding62099ab2012-03-26 09:31:48 +02009struct seq_file;
Lee Jones3a3d1a42016-06-08 10:21:23 +010010
Sascha Hauer0c2498f2011-01-28 09:40:40 +010011struct pwm_chip;
12
Philip, Avinash0aa08692012-07-24 19:35:32 +053013/**
14 * enum pwm_polarity - polarity of a PWM signal
15 * @PWM_POLARITY_NORMAL: a high signal for the duration of the duty-
16 * cycle, followed by a low signal for the remainder of the pulse
17 * period
18 * @PWM_POLARITY_INVERSED: a low signal for the duration of the duty-
19 * cycle, followed by a high signal for the remainder of the pulse
20 * period
21 */
22enum pwm_polarity {
23 PWM_POLARITY_NORMAL,
24 PWM_POLARITY_INVERSED,
25};
26
Boris Brezillone39c0df2016-04-14 21:17:21 +020027/**
28 * struct pwm_args - board-dependent PWM arguments
29 * @period: reference period
30 * @polarity: reference polarity
31 *
32 * This structure describes board-dependent arguments attached to a PWM
33 * device. These arguments are usually retrieved from the PWM lookup table or
34 * device tree.
35 *
36 * Do not confuse this with the PWM state: PWM arguments represent the initial
37 * configuration that users want to use on this PWM device rather than the
38 * current PWM hardware state.
39 */
40struct pwm_args {
41 unsigned int period;
42 enum pwm_polarity polarity;
43};
44
Thierry Redingf051c462011-12-14 11:12:23 +010045enum {
46 PWMF_REQUESTED = 1 << 0,
Boris Brezillon09a7e4a2016-04-14 21:17:39 +020047 PWMF_EXPORTED = 1 << 1,
Thierry Redingf051c462011-12-14 11:12:23 +010048};
49
Boris Brezillon43a276b2016-04-14 21:17:38 +020050/*
51 * struct pwm_state - state of a PWM channel
52 * @period: PWM period (in nanoseconds)
53 * @duty_cycle: PWM duty cycle (in nanoseconds)
54 * @polarity: PWM polarity
Boris Brezillon09a7e4a2016-04-14 21:17:39 +020055 * @enabled: PWM enabled status
Boris Brezillon43a276b2016-04-14 21:17:38 +020056 */
57struct pwm_state {
58 unsigned int period;
59 unsigned int duty_cycle;
60 enum pwm_polarity polarity;
Boris Brezillon09a7e4a2016-04-14 21:17:39 +020061 bool enabled;
Boris Brezillon43a276b2016-04-14 21:17:38 +020062};
63
Thierry Reding04883802015-07-27 11:58:32 +020064/**
65 * struct pwm_device - PWM channel object
66 * @label: name of the PWM device
67 * @flags: flags associated with the PWM device
68 * @hwpwm: per-chip relative index of the PWM device
69 * @pwm: global index of the PWM device
70 * @chip: PWM chip providing this PWM device
71 * @chip_data: chip-private data associated with the PWM device
Boris Brezillone39c0df2016-04-14 21:17:21 +020072 * @args: PWM arguments
Boris Brezillon43a276b2016-04-14 21:17:38 +020073 * @state: curent PWM channel state
Thierry Reding04883802015-07-27 11:58:32 +020074 */
Thierry Redingf051c462011-12-14 11:12:23 +010075struct pwm_device {
Thierry Reding6bc70642015-07-27 11:57:28 +020076 const char *label;
77 unsigned long flags;
78 unsigned int hwpwm;
79 unsigned int pwm;
80 struct pwm_chip *chip;
81 void *chip_data;
Thierry Redingf051c462011-12-14 11:12:23 +010082
Boris Brezillone39c0df2016-04-14 21:17:21 +020083 struct pwm_args args;
Boris Brezillon43a276b2016-04-14 21:17:38 +020084 struct pwm_state state;
Thierry Redingf051c462011-12-14 11:12:23 +010085};
86
Boris Brezillon43a276b2016-04-14 21:17:38 +020087/**
88 * pwm_get_state() - retrieve the current PWM state
89 * @pwm: PWM device
90 * @state: state to fill with the current PWM state
91 */
92static inline void pwm_get_state(const struct pwm_device *pwm,
93 struct pwm_state *state)
94{
95 *state = pwm->state;
96}
97
Boris Brezillon5c312522015-07-01 10:21:47 +020098static inline bool pwm_is_enabled(const struct pwm_device *pwm)
99{
Boris Brezillon09a7e4a2016-04-14 21:17:39 +0200100 struct pwm_state state;
101
102 pwm_get_state(pwm, &state);
103
104 return state.enabled;
Boris Brezillon5c312522015-07-01 10:21:47 +0200105}
106
Thierry Redingf051c462011-12-14 11:12:23 +0100107static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period)
108{
109 if (pwm)
Boris Brezillon43a276b2016-04-14 21:17:38 +0200110 pwm->state.period = period;
Thierry Redingf051c462011-12-14 11:12:23 +0100111}
112
Boris Brezillona1cf4212015-07-01 10:21:48 +0200113static inline unsigned int pwm_get_period(const struct pwm_device *pwm)
Thierry Redingf051c462011-12-14 11:12:23 +0100114{
Boris Brezillon43a276b2016-04-14 21:17:38 +0200115 struct pwm_state state;
116
117 pwm_get_state(pwm, &state);
118
119 return state.period;
Thierry Redingf051c462011-12-14 11:12:23 +0100120}
121
H Hartley Sweeten76abbdde2013-06-11 10:38:59 -0700122static inline void pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty)
123{
124 if (pwm)
Boris Brezillon43a276b2016-04-14 21:17:38 +0200125 pwm->state.duty_cycle = duty;
H Hartley Sweeten76abbdde2013-06-11 10:38:59 -0700126}
127
Boris Brezillona1cf4212015-07-01 10:21:48 +0200128static inline unsigned int pwm_get_duty_cycle(const struct pwm_device *pwm)
H Hartley Sweeten76abbdde2013-06-11 10:38:59 -0700129{
Boris Brezillon43a276b2016-04-14 21:17:38 +0200130 struct pwm_state state;
131
132 pwm_get_state(pwm, &state);
133
134 return state.duty_cycle;
H Hartley Sweeten76abbdde2013-06-11 10:38:59 -0700135}
136
Boris Brezillon011e7632015-07-01 10:21:49 +0200137static inline enum pwm_polarity pwm_get_polarity(const struct pwm_device *pwm)
138{
Boris Brezillon43a276b2016-04-14 21:17:38 +0200139 struct pwm_state state;
140
141 pwm_get_state(pwm, &state);
142
143 return state.polarity;
Boris Brezillon011e7632015-07-01 10:21:49 +0200144}
145
Boris Brezillone39c0df2016-04-14 21:17:21 +0200146static inline void pwm_get_args(const struct pwm_device *pwm,
147 struct pwm_args *args)
148{
149 *args = pwm->args;
150}
151
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100152/**
153 * struct pwm_ops - PWM controller operations
154 * @request: optional hook for requesting a PWM
155 * @free: optional hook for freeing a PWM
156 * @config: configure duty cycles and period length for this PWM
Philip, Avinash0aa08692012-07-24 19:35:32 +0530157 * @set_polarity: configure the polarity of this PWM
Lee Jones3a3d1a42016-06-08 10:21:23 +0100158 * @capture: capture and report PWM signal
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100159 * @enable: enable PWM output toggling
160 * @disable: disable PWM output toggling
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200161 * @apply: atomically apply a new PWM config. The state argument
162 * should be adjusted with the real hardware config (if the
163 * approximate the period or duty_cycle value, state should
164 * reflect it)
Boris Brezillon15fa8a432016-04-14 21:17:40 +0200165 * @get_state: get the current PWM state. This function is only
166 * called once per PWM device when the PWM chip is
167 * registered.
Thierry Reding62099ab2012-03-26 09:31:48 +0200168 * @dbg_show: optional routine to show contents in debugfs
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100169 * @owner: helps prevent removal of modules exporting active PWMs
170 */
171struct pwm_ops {
Thierry Reding6bc70642015-07-27 11:57:28 +0200172 int (*request)(struct pwm_chip *chip, struct pwm_device *pwm);
173 void (*free)(struct pwm_chip *chip, struct pwm_device *pwm);
174 int (*config)(struct pwm_chip *chip, struct pwm_device *pwm,
175 int duty_ns, int period_ns);
176 int (*set_polarity)(struct pwm_chip *chip, struct pwm_device *pwm,
177 enum pwm_polarity polarity);
Lee Jones3a3d1a42016-06-08 10:21:23 +0100178 int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm,
179 struct pwm_capture *result, unsigned long timeout);
Thierry Reding6bc70642015-07-27 11:57:28 +0200180 int (*enable)(struct pwm_chip *chip, struct pwm_device *pwm);
181 void (*disable)(struct pwm_chip *chip, struct pwm_device *pwm);
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200182 int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm,
183 struct pwm_state *state);
Boris Brezillon15fa8a432016-04-14 21:17:40 +0200184 void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
185 struct pwm_state *state);
Thierry Reding62099ab2012-03-26 09:31:48 +0200186#ifdef CONFIG_DEBUG_FS
Thierry Reding6bc70642015-07-27 11:57:28 +0200187 void (*dbg_show)(struct pwm_chip *chip, struct seq_file *s);
Thierry Reding62099ab2012-03-26 09:31:48 +0200188#endif
Thierry Reding6bc70642015-07-27 11:57:28 +0200189 struct module *owner;
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100190};
191
192/**
Thierry Redingf051c462011-12-14 11:12:23 +0100193 * struct pwm_chip - abstract a PWM controller
194 * @dev: device providing the PWMs
195 * @list: list node for internal use
196 * @ops: callbacks for this PWM controller
197 * @base: number of first PWM controlled by this chip
198 * @npwm: number of PWMs controlled by this chip
199 * @pwms: array of PWM devices allocated by the framework
Thierry Reding04883802015-07-27 11:58:32 +0200200 * @of_xlate: request a PWM device given a device tree PWM specifier
201 * @of_pwm_n_cells: number of cells expected in the device tree PWM specifier
Florian Vaussard6e69ab12013-01-28 15:00:57 +0100202 * @can_sleep: must be true if the .config(), .enable() or .disable()
203 * operations may sleep
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100204 */
205struct pwm_chip {
Thierry Reding6bc70642015-07-27 11:57:28 +0200206 struct device *dev;
207 struct list_head list;
208 const struct pwm_ops *ops;
209 int base;
210 unsigned int npwm;
Thierry Redingf051c462011-12-14 11:12:23 +0100211
Thierry Reding6bc70642015-07-27 11:57:28 +0200212 struct pwm_device *pwms;
Thierry Reding7299ab72011-12-14 11:10:32 +0100213
Thierry Reding6bc70642015-07-27 11:57:28 +0200214 struct pwm_device * (*of_xlate)(struct pwm_chip *pc,
215 const struct of_phandle_args *args);
216 unsigned int of_pwm_n_cells;
217 bool can_sleep;
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100218};
219
Lee Jones3a3d1a42016-06-08 10:21:23 +0100220/**
221 * struct pwm_capture - PWM capture data
222 * @period: period of the PWM signal (in nanoseconds)
223 * @duty_cycle: duty cycle of the PWM signal (in nanoseconds)
224 */
225struct pwm_capture {
226 unsigned int period;
227 unsigned int duty_cycle;
228};
229
Tushar Behera0bcf1682012-09-12 15:31:46 +0530230#if IS_ENABLED(CONFIG_PWM)
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200231/* PWM user APIs */
232struct pwm_device *pwm_request(int pwm_id, const char *label);
233void pwm_free(struct pwm_device *pwm);
234int pwm_apply_state(struct pwm_device *pwm, struct pwm_state *state);
235int pwm_adjust_config(struct pwm_device *pwm);
236
237/**
238 * pwm_config() - change a PWM device configuration
239 * @pwm: PWM device
240 * @duty_ns: "on" time (in nanoseconds)
241 * @period_ns: duration (in nanoseconds) of one cycle
242 *
243 * Returns: 0 on success or a negative error code on failure.
244 */
245static inline int pwm_config(struct pwm_device *pwm, int duty_ns,
246 int period_ns)
247{
248 struct pwm_state state;
249
250 if (!pwm)
251 return -EINVAL;
252
253 pwm_get_state(pwm, &state);
254 if (state.duty_cycle == duty_ns && state.period == period_ns)
255 return 0;
256
257 state.duty_cycle = duty_ns;
258 state.period = period_ns;
259 return pwm_apply_state(pwm, &state);
260}
261
262/**
263 * pwm_set_polarity() - configure the polarity of a PWM signal
264 * @pwm: PWM device
265 * @polarity: new polarity of the PWM signal
266 *
267 * Note that the polarity cannot be configured while the PWM device is
268 * enabled.
269 *
270 * Returns: 0 on success or a negative error code on failure.
271 */
272static inline int pwm_set_polarity(struct pwm_device *pwm,
273 enum pwm_polarity polarity)
274{
275 struct pwm_state state;
276
277 if (!pwm)
278 return -EINVAL;
279
280 pwm_get_state(pwm, &state);
281 if (state.polarity == polarity)
282 return 0;
283
284 /*
285 * Changing the polarity of a running PWM without adjusting the
286 * dutycycle/period value is a bit risky (can introduce glitches).
287 * Return -EBUSY in this case.
288 * Note that this is allowed when using pwm_apply_state() because
289 * the user specifies all the parameters.
290 */
291 if (state.enabled)
292 return -EBUSY;
293
294 state.polarity = polarity;
295 return pwm_apply_state(pwm, &state);
296}
297
298/**
299 * pwm_enable() - start a PWM output toggling
300 * @pwm: PWM device
301 *
302 * Returns: 0 on success or a negative error code on failure.
303 */
304static inline int pwm_enable(struct pwm_device *pwm)
305{
306 struct pwm_state state;
307
308 if (!pwm)
309 return -EINVAL;
310
311 pwm_get_state(pwm, &state);
312 if (state.enabled)
313 return 0;
314
315 state.enabled = true;
316 return pwm_apply_state(pwm, &state);
317}
318
319/**
320 * pwm_disable() - stop a PWM output toggling
321 * @pwm: PWM device
322 */
323static inline void pwm_disable(struct pwm_device *pwm)
324{
325 struct pwm_state state;
326
327 if (!pwm)
328 return;
329
330 pwm_get_state(pwm, &state);
331 if (!state.enabled)
332 return;
333
334 state.enabled = false;
335 pwm_apply_state(pwm, &state);
336}
337
338
339/* PWM provider APIs */
Lee Jones3a3d1a42016-06-08 10:21:23 +0100340int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
341 unsigned long timeout);
Thierry Redingf051c462011-12-14 11:12:23 +0100342int pwm_set_chip_data(struct pwm_device *pwm, void *data);
343void *pwm_get_chip_data(struct pwm_device *pwm);
344
Tim Krygerb6a00fa2015-05-26 13:08:16 -0700345int pwmchip_add_with_polarity(struct pwm_chip *chip,
346 enum pwm_polarity polarity);
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100347int pwmchip_add(struct pwm_chip *chip);
348int pwmchip_remove(struct pwm_chip *chip);
Thierry Redingf051c462011-12-14 11:12:23 +0100349struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
350 unsigned int index,
351 const char *label);
Thierry Reding8138d2d2012-03-26 08:42:48 +0200352
Philip, Avinash83af2402012-11-21 13:10:44 +0530353struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc,
354 const struct of_phandle_args *args);
355
Peter Ujfalusid4c0c472012-12-21 01:43:57 -0800356struct pwm_device *pwm_get(struct device *dev, const char *con_id);
Peter Ujfalusi8eb96122012-12-21 01:43:58 -0800357struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id);
Thierry Reding8138d2d2012-03-26 08:42:48 +0200358void pwm_put(struct pwm_device *pwm);
359
Peter Ujfalusid4c0c472012-12-21 01:43:57 -0800360struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id);
Peter Ujfalusi261a5ed2012-12-21 01:43:59 -0800361struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
362 const char *con_id);
Alexandre Courbot63543162012-08-01 19:20:58 +0900363void devm_pwm_put(struct device *dev, struct pwm_device *pwm);
Florian Vaussard6e69ab12013-01-28 15:00:57 +0100364
365bool pwm_can_sleep(struct pwm_device *pwm);
Tushar Behera0bcf1682012-09-12 15:31:46 +0530366#else
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200367static inline struct pwm_device *pwm_request(int pwm_id, const char *label)
368{
369 return ERR_PTR(-ENODEV);
370}
371
372static inline void pwm_free(struct pwm_device *pwm)
373{
374}
375
376static inline int pwm_apply_state(struct pwm_device *pwm,
377 const struct pwm_state *state)
378{
379 return -ENOTSUPP;
380}
381
382static inline int pwm_adjust_config(struct pwm_device *pwm)
383{
384 return -ENOTSUPP;
385}
386
387static inline int pwm_config(struct pwm_device *pwm, int duty_ns,
388 int period_ns)
389{
390 return -EINVAL;
391}
392
Lee Jones3a3d1a42016-06-08 10:21:23 +0100393static inline int pwm_capture(struct pwm_device *pwm,
394 struct pwm_capture *result,
395 unsigned long timeout)
396{
397 return -EINVAL;
398}
399
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200400static inline int pwm_set_polarity(struct pwm_device *pwm,
401 enum pwm_polarity polarity)
402{
403 return -ENOTSUPP;
404}
405
406static inline int pwm_enable(struct pwm_device *pwm)
407{
408 return -EINVAL;
409}
410
411static inline void pwm_disable(struct pwm_device *pwm)
412{
413}
414
Tushar Behera0bcf1682012-09-12 15:31:46 +0530415static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data)
416{
417 return -EINVAL;
418}
419
420static inline void *pwm_get_chip_data(struct pwm_device *pwm)
421{
422 return NULL;
423}
424
425static inline int pwmchip_add(struct pwm_chip *chip)
426{
427 return -EINVAL;
428}
429
Tim Krygerb6a00fa2015-05-26 13:08:16 -0700430static inline int pwmchip_add_inversed(struct pwm_chip *chip)
431{
432 return -EINVAL;
433}
434
Tushar Behera0bcf1682012-09-12 15:31:46 +0530435static inline int pwmchip_remove(struct pwm_chip *chip)
436{
437 return -EINVAL;
438}
439
440static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
441 unsigned int index,
442 const char *label)
443{
444 return ERR_PTR(-ENODEV);
445}
446
447static inline struct pwm_device *pwm_get(struct device *dev,
448 const char *consumer)
449{
450 return ERR_PTR(-ENODEV);
451}
452
Peter Ujfalusi8eb96122012-12-21 01:43:58 -0800453static inline struct pwm_device *of_pwm_get(struct device_node *np,
454 const char *con_id)
455{
456 return ERR_PTR(-ENODEV);
457}
458
Tushar Behera0bcf1682012-09-12 15:31:46 +0530459static inline void pwm_put(struct pwm_device *pwm)
460{
461}
462
463static inline struct pwm_device *devm_pwm_get(struct device *dev,
464 const char *consumer)
465{
466 return ERR_PTR(-ENODEV);
467}
468
Peter Ujfalusi261a5ed2012-12-21 01:43:59 -0800469static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
470 struct device_node *np,
471 const char *con_id)
472{
473 return ERR_PTR(-ENODEV);
474}
475
Tushar Behera0bcf1682012-09-12 15:31:46 +0530476static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
477{
478}
Florian Vaussard6e69ab12013-01-28 15:00:57 +0100479
480static inline bool pwm_can_sleep(struct pwm_device *pwm)
481{
482 return false;
483}
Tushar Behera0bcf1682012-09-12 15:31:46 +0530484#endif
Alexandre Courbot63543162012-08-01 19:20:58 +0900485
Boris Brezillon5ec803e2016-04-14 21:17:41 +0200486static inline void pwm_apply_args(struct pwm_device *pwm)
487{
488 /*
489 * PWM users calling pwm_apply_args() expect to have a fresh config
490 * where the polarity and period are set according to pwm_args info.
491 * The problem is, polarity can only be changed when the PWM is
492 * disabled.
493 *
494 * PWM drivers supporting hardware readout may declare the PWM device
495 * as enabled, and prevent polarity setting, which changes from the
496 * existing behavior, where all PWM devices are declared as disabled
497 * at startup (even if they are actually enabled), thus authorizing
498 * polarity setting.
499 *
500 * Instead of setting ->enabled to false, we call pwm_disable()
501 * before pwm_set_polarity() to ensure that everything is configured
502 * as expected, and the PWM is really disabled when the user request
503 * it.
504 *
505 * Note that PWM users requiring a smooth handover between the
506 * bootloader and the kernel (like critical regulators controlled by
507 * PWM devices) will have to switch to the atomic API and avoid calling
508 * pwm_apply_args().
509 */
510 pwm_disable(pwm);
511 pwm_set_polarity(pwm, pwm->args.polarity);
512}
513
Thierry Reding8138d2d2012-03-26 08:42:48 +0200514struct pwm_lookup {
515 struct list_head list;
516 const char *provider;
517 unsigned int index;
518 const char *dev_id;
519 const char *con_id;
Alexandre Belloni3796ce12014-05-19 22:42:32 +0200520 unsigned int period;
521 enum pwm_polarity polarity;
Thierry Reding8138d2d2012-03-26 08:42:48 +0200522};
523
Alexandre Belloni42844022014-05-19 22:42:37 +0200524#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id, _period, _polarity) \
Thierry Reding8138d2d2012-03-26 08:42:48 +0200525 { \
526 .provider = _provider, \
527 .index = _index, \
528 .dev_id = _dev_id, \
529 .con_id = _con_id, \
Alexandre Belloni42844022014-05-19 22:42:37 +0200530 .period = _period, \
531 .polarity = _polarity \
Thierry Reding8138d2d2012-03-26 08:42:48 +0200532 }
533
Tushar Behera0bcf1682012-09-12 15:31:46 +0530534#if IS_ENABLED(CONFIG_PWM)
Thierry Reding8138d2d2012-03-26 08:42:48 +0200535void pwm_add_table(struct pwm_lookup *table, size_t num);
Shobhit Kumarefb0de52015-05-05 15:04:18 +0530536void pwm_remove_table(struct pwm_lookup *table, size_t num);
Tushar Behera0bcf1682012-09-12 15:31:46 +0530537#else
538static inline void pwm_add_table(struct pwm_lookup *table, size_t num)
539{
540}
Shobhit Kumarefb0de52015-05-05 15:04:18 +0530541
542static inline void pwm_remove_table(struct pwm_lookup *table, size_t num)
543{
544}
Sascha Hauer0c2498f2011-01-28 09:40:40 +0100545#endif
546
H Hartley Sweeten76abbdde2013-06-11 10:38:59 -0700547#ifdef CONFIG_PWM_SYSFS
548void pwmchip_sysfs_export(struct pwm_chip *chip);
549void pwmchip_sysfs_unexport(struct pwm_chip *chip);
550#else
551static inline void pwmchip_sysfs_export(struct pwm_chip *chip)
552{
553}
554
555static inline void pwmchip_sysfs_unexport(struct pwm_chip *chip)
556{
557}
558#endif /* CONFIG_PWM_SYSFS */
559
Mark Vels5243ef82009-01-18 18:42:45 +0100560#endif /* __LINUX_PWM_H */