Home
last modified time | relevance | path

Searched refs:pwm (Results 1 - 25 of 407) sorted by relevance

12345678910>>...17

/kernel/linux/linux-6.6/drivers/clocksource/
H A Dsamsung_pwm_timer.c79 static struct samsung_pwm_clocksource pwm; variable
92 reg = readl(pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
95 writel(reg, pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
107 bits = (fls(divisor) - 1) - pwm.variant.div_base; in samsung_timer_set_divisor()
111 reg = readl(pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
114 writel(reg, pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
129 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_stop()
131 writel_relaxed(tcon, pwm.base + REG_TCON); in samsung_time_stop()
147 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_setup()
152 writel_relaxed(tcnt, pwm in samsung_time_setup()
[all...]
/kernel/linux/linux-5.10/drivers/clocksource/
H A Dsamsung_pwm_timer.c80 static struct samsung_pwm_clocksource pwm; variable
93 reg = readl(pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
96 writel(reg, pwm.base + REG_TCFG0); in samsung_timer_set_prescale()
108 bits = (fls(divisor) - 1) - pwm.variant.div_base; in samsung_timer_set_divisor()
112 reg = readl(pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
115 writel(reg, pwm.base + REG_TCFG1); in samsung_timer_set_divisor()
130 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_stop()
132 writel_relaxed(tcon, pwm.base + REG_TCON); in samsung_time_stop()
148 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_setup()
153 writel_relaxed(tcnt, pwm in samsung_time_setup()
[all...]
/kernel/linux/linux-6.6/drivers/pwm/
H A Dcore.c12 #include <linux/pwm.h>
21 #include <dt-bindings/pwm/pwm.h>
24 #include <trace/events/pwm.h>
85 static int pwm_device_request(struct pwm_device *pwm, const char *label) in pwm_device_request() argument
89 if (test_bit(PWMF_REQUESTED, &pwm->flags)) in pwm_device_request()
92 if (!try_module_get(pwm->chip->ops->owner)) in pwm_device_request()
95 if (pwm->chip->ops->request) { in pwm_device_request()
96 err = pwm->chip->ops->request(pwm in pwm_device_request()
132 struct pwm_device *pwm; of_pwm_xlate_with_flags() local
163 struct pwm_device *pwm; of_pwm_single_xlate() local
218 pwm_set_chip_data(struct pwm_device *pwm, void *data) pwm_set_chip_data() argument
235 pwm_get_chip_data(struct pwm_device *pwm) pwm_get_chip_data() argument
265 struct pwm_device *pwm; pwmchip_add() local
367 struct pwm_device *pwm; pwm_request_from_chip() local
385 pwm_apply_state_debug(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state_debug() argument
496 pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state() argument
548 pwm_capture(struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout) pwm_capture() argument
575 pwm_adjust_config(struct pwm_device *pwm) pwm_adjust_config() argument
640 pwm_device_link_add(struct device *dev, struct pwm_device *pwm) pwm_device_link_add() argument
689 struct pwm_device *pwm = NULL; of_pwm_get() local
769 struct pwm_device *pwm; acpi_pwm_get() local
853 struct pwm_device *pwm; pwm_get() local
964 pwm_put(struct pwm_device *pwm) pwm_put() argument
988 devm_pwm_release(void *pwm) devm_pwm_release() argument
1006 struct pwm_device *pwm; devm_pwm_get() local
1037 struct pwm_device *pwm = ERR_PTR(-ENODEV); devm_fwnode_pwm_get() local
1061 struct pwm_device *pwm = &chip->pwms[i]; pwm_dbg_show() local
[all...]
H A Dpwm-twl.c12 #include <linux/pwm.h>
32 #define TWL4030_PWM_TOGGLE(pwm, x) ((x) << (pwm))
46 #define TWL6030_PWM_TOGGLE(pwm, x) ((x) << (pwm * 3))
60 static int twl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl_pwm_config() argument
83 base = pwm->hwpwm * 3; in twl_pwm_config()
89 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl_pwm_config()
94 static int twl4030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwm_enable() argument
103 dev_err(chip->dev, "%s: Failed to read GPBR1\n", pwm in twl4030_pwm_enable()
124 twl4030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_disable() argument
153 twl4030_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_request() argument
191 twl4030_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_free() argument
221 twl6030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwm_enable() argument
244 twl6030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwm_disable() argument
282 twl4030_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) twl4030_pwm_apply() argument
307 twl6030_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) twl6030_pwm_apply() argument
[all...]
H A Dsysfs.c15 #include <linux/pwm.h>
19 struct pwm_device *pwm; member
33 return export->pwm; in child_to_pwm_device()
40 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() local
43 pwm_get_state(pwm, &state); in period_show()
53 struct pwm_device *pwm = export->pwm; in period_store() local
63 pwm_get_state(pwm, &state); in period_store()
65 ret = pwm_apply_state(pwm, &state); in period_store()
75 const struct pwm_device *pwm in duty_cycle_show() local
88 struct pwm_device *pwm = export->pwm; duty_cycle_store() local
110 const struct pwm_device *pwm = child_to_pwm_device(child); enable_show() local
123 struct pwm_device *pwm = export->pwm; enable_store() local
158 const struct pwm_device *pwm = child_to_pwm_device(child); polarity_show() local
182 struct pwm_device *pwm = export->pwm; polarity_store() local
207 struct pwm_device *pwm = child_to_pwm_device(child); capture_show() local
232 ATTRIBUTE_GROUPS(pwm); global() variable
241 pwm_export_child(struct device *parent, struct pwm_device *pwm) pwm_export_child() argument
285 pwm_unexport_child(struct device *parent, struct pwm_device *pwm) pwm_unexport_child() argument
315 struct pwm_device *pwm; export_store() local
377 pwm_class_get_state(struct device *parent, struct pwm_device *pwm, struct pwm_state *state) pwm_class_get_state() argument
400 pwm_class_apply_state(struct pwm_export *export, struct pwm_device *pwm, struct pwm_state *state) pwm_class_apply_state() argument
419 struct pwm_device *pwm = &chip->pwms[i]; pwm_class_resume_npwm() local
450 struct pwm_device *pwm = &chip->pwms[i]; pwm_class_suspend() local
531 struct pwm_device *pwm = &chip->pwms[i]; pwmchip_sysfs_unexport() local
[all...]
H A Dpwm-twl-led.c8 * This driver is a complete rewrite of the former pwm-twl6030.c authorded by:
31 #include <linux/pwm.h>
74 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument
97 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG; in twl4030_pwmled_config()
103 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl4030_pwmled_config()
108 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwmled_enable() argument
117 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_enable()
121 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_enable()
125 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwmled_enable()
133 struct pwm_device *pwm) in twl4030_pwmled_disable()
132 twl4030_pwmled_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwmled_disable() argument
156 twl4030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) twl4030_pwmled_apply() argument
195 twl6030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) twl6030_pwmled_config() argument
212 twl6030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwmled_enable() argument
238 twl6030_pwmled_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwmled_disable() argument
264 twl6030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) twl6030_pwmled_apply() argument
290 twl6030_pwmled_request(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwmled_request() argument
316 twl6030_pwmled_free(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwmled_free() argument
[all...]
H A Dpwm-vt8500.c3 * drivers/pwm/pwm-vt8500.c
16 #include <linux/pwm.h>
28 #define REG_CTRL(pwm) (((pwm) << 4) + 0x00)
29 #define REG_SCALAR(pwm) (((pwm) << 4) + 0x04)
30 #define REG_PERIOD(pwm) (((pwm) << 4) + 0x08)
31 #define REG_DUTY(pwm) (((pw
69 vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, u64 duty_ns, u64 period_ns) vt8500_pwm_config() argument
123 vt8500_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) vt8500_pwm_enable() argument
143 vt8500_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) vt8500_pwm_disable() argument
156 vt8500_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, enum pwm_polarity polarity) vt8500_pwm_set_polarity() argument
176 vt8500_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) vt8500_pwm_apply() argument
[all...]
H A Dpwm-lpss.c24 #include "pwm-lpss.h"
74 static inline u32 pwm_lpss_read(const struct pwm_device *pwm) in pwm_lpss_read() argument
76 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_read()
78 return readl(lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_read()
81 static inline void pwm_lpss_write(const struct pwm_device *pwm, u32 value) in pwm_lpss_write() argument
83 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_write()
85 writel(value, lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_write()
88 static int pwm_lpss_wait_for_update(struct pwm_device *pwm) in pwm_lpss_wait_for_update() argument
90 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_wait_for_update()
91 const void __iomem *addr = lpwm->regs + pwm in pwm_lpss_wait_for_update()
114 pwm_lpss_is_updating(struct pwm_device *pwm) pwm_lpss_is_updating() argument
124 pwm_lpss_prepare(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm, int duty_ns, int period_ns) pwm_lpss_prepare() argument
159 pwm_lpss_cond_enable(struct pwm_device *pwm, bool cond) pwm_lpss_cond_enable() argument
165 pwm_lpss_prepare_enable(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm, const struct pwm_state *state) pwm_lpss_prepare_enable() argument
185 pwm_lpss_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) pwm_lpss_apply() argument
208 pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) pwm_lpss_get_state() argument
[all...]
/kernel/linux/linux-5.10/include/linux/
H A Dpwm.h70 * @pwm: global index of the PWM device
81 unsigned int pwm; member
92 * @pwm: PWM device
95 static inline void pwm_get_state(const struct pwm_device *pwm, in pwm_get_state() argument
98 *state = pwm->state; in pwm_get_state()
101 static inline bool pwm_is_enabled(const struct pwm_device *pwm) in pwm_is_enabled() argument
105 pwm_get_state(pwm, &state); in pwm_is_enabled()
110 static inline void pwm_set_period(struct pwm_device *pwm, u64 period) in pwm_set_period() argument
112 if (pwm) in pwm_set_period()
113 pwm in pwm_set_period()
116 pwm_get_period(const struct pwm_device *pwm) pwm_get_period() argument
125 pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty) pwm_set_duty_cycle() argument
131 pwm_get_duty_cycle(const struct pwm_device *pwm) pwm_get_duty_cycle() argument
140 pwm_get_polarity(const struct pwm_device *pwm) pwm_get_polarity() argument
149 pwm_get_args(const struct pwm_device *pwm, struct pwm_args *args) pwm_get_args() argument
172 pwm_init_state(const struct pwm_device *pwm, struct pwm_state *state) pwm_init_state() argument
329 pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
355 pwm_enable(struct pwm_device *pwm) pwm_enable() argument
374 pwm_disable(struct pwm_device *pwm) pwm_disable() argument
424 pwm_free(struct pwm_device *pwm) pwm_free() argument
428 pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state() argument
434 pwm_adjust_config(struct pwm_device *pwm) pwm_adjust_config() argument
439 pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
445 pwm_capture(struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout) pwm_capture() argument
452 pwm_enable(struct pwm_device *pwm) pwm_enable() argument
457 pwm_disable(struct pwm_device *pwm) pwm_disable() argument
461 pwm_set_chip_data(struct pwm_device *pwm, void *data) pwm_set_chip_data() argument
466 pwm_get_chip_data(struct pwm_device *pwm) pwm_get_chip_data() argument
506 pwm_put(struct pwm_device *pwm) pwm_put() argument
530 devm_pwm_put(struct device *dev, struct pwm_device *pwm) devm_pwm_put() argument
535 pwm_apply_args(struct pwm_device *pwm) pwm_apply_args() argument
[all...]
/kernel/linux/linux-5.10/drivers/pwm/
H A Dpwm-renesas-tpu.c18 #include <linux/pwm.h>
92 static void tpu_pwm_write(struct tpu_pwm_device *pwm, int reg_nr, u16 value) in tpu_pwm_write() argument
94 void __iomem *base = pwm->tpu->base + TPU_CHANNEL_OFFSET in tpu_pwm_write()
95 + pwm->channel * TPU_CHANNEL_SIZE; in tpu_pwm_write()
100 static void tpu_pwm_set_pin(struct tpu_pwm_device *pwm, in tpu_pwm_set_pin() argument
105 dev_dbg(&pwm->tpu->pdev->dev, "%u: configuring pin as %s\n", in tpu_pwm_set_pin()
106 pwm->channel, states[state]); in tpu_pwm_set_pin()
110 tpu_pwm_write(pwm, TPU_TIORn, in tpu_pwm_set_pin()
111 pwm->polarity == PWM_POLARITY_INVERSED ? in tpu_pwm_set_pin()
115 tpu_pwm_write(pwm, TPU_TIOR in tpu_pwm_set_pin()
127 tpu_pwm_start_stop(struct tpu_pwm_device *pwm, int start) tpu_pwm_start_stop() argument
144 tpu_pwm_timer_start(struct tpu_pwm_device *pwm) tpu_pwm_timer_start() argument
191 tpu_pwm_timer_stop(struct tpu_pwm_device *pwm) tpu_pwm_timer_stop() argument
213 struct tpu_pwm_device *pwm; tpu_pwm_request() local
238 struct tpu_pwm_device *pwm = pwm_get_chip_data(_pwm); tpu_pwm_free() local
248 struct tpu_pwm_device *pwm = pwm_get_chip_data(_pwm); tpu_pwm_config() local
330 struct tpu_pwm_device *pwm = pwm_get_chip_data(_pwm); tpu_pwm_set_polarity() local
339 struct tpu_pwm_device *pwm = pwm_get_chip_data(_pwm); tpu_pwm_enable() local
361 struct tpu_pwm_device *pwm = pwm_get_chip_data(_pwm); tpu_pwm_disable() local
[all...]
H A Dcore.c11 #include <linux/pwm.h>
21 #include <dt-bindings/pwm/pwm.h>
24 #include <trace/events/pwm.h>
35 static struct pwm_device *pwm_to_device(unsigned int pwm) in pwm_to_device() argument
37 return radix_tree_lookup(&pwm_tree, pwm); in pwm_to_device()
40 static int alloc_pwms(int pwm, unsigned int count) in alloc_pwms() argument
45 if (pwm >= MAX_PWMS) in alloc_pwms()
48 if (pwm >= 0) in alloc_pwms()
49 from = pwm; in alloc_pwms()
68 struct pwm_device *pwm = &chip->pwms[i]; free_pwms() local
102 pwm_device_request(struct pwm_device *pwm, const char *label) pwm_device_request() argument
137 struct pwm_device *pwm; of_pwm_xlate_with_flags() local
167 struct pwm_device *pwm; of_pwm_simple_xlate() local
215 pwm_set_chip_data(struct pwm_device *pwm, void *data) pwm_set_chip_data() argument
232 pwm_get_chip_data(struct pwm_device *pwm) pwm_get_chip_data() argument
276 struct pwm_device *pwm; pwmchip_add_with_polarity() local
365 struct pwm_device *pwm = &chip->pwms[i]; pwmchip_remove() local
396 pwm_request(int pwm, const char *label) pwm_request() argument
437 struct pwm_device *pwm; pwm_request_from_chip() local
461 pwm_free(struct pwm_device *pwm) pwm_free() argument
467 pwm_apply_state_debug(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state_debug() argument
573 pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state() argument
667 pwm_capture(struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout) pwm_capture() argument
694 pwm_adjust_config(struct pwm_device *pwm) pwm_adjust_config() argument
759 pwm_device_link_add(struct device *dev, struct pwm_device *pwm) pwm_device_link_add() argument
808 struct pwm_device *pwm = NULL; of_pwm_get() local
911 struct pwm_device *pwm = ERR_PTR(-ENODEV); acpi_pwm_get() local
1001 struct pwm_device *pwm; pwm_get() local
1112 pwm_put(struct pwm_device *pwm) pwm_put() argument
1154 struct pwm_device **ptr, *pwm; devm_pwm_get() local
1187 struct pwm_device **ptr, *pwm; devm_of_pwm_get() local
1221 struct pwm_device **ptr, *pwm = ERR_PTR(-ENODEV); devm_fwnode_pwm_get() local
1262 devm_pwm_put(struct device *dev, struct pwm_device *pwm) devm_pwm_put() argument
1274 struct pwm_device *pwm = &chip->pwms[i]; pwm_dbg_show() local
[all...]
H A Dpwm-berlin.c18 #include <linux/pwm.h>
72 static int berlin_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_request() argument
80 return pwm_set_chip_data(pwm, channel); in berlin_pwm_request()
83 static void berlin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_free() argument
85 struct berlin_pwm_channel *channel = pwm_get_chip_data(pwm); in berlin_pwm_free()
93 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); in berlin_pwm_config() local
98 cycles = clk_get_rate(pwm->clk); in berlin_pwm_config()
115 value = berlin_pwm_readl(pwm, pwm_dev->hwpwm, BERLIN_PWM_CONTROL); in berlin_pwm_config()
120 berlin_pwm_writel(pwm, pwm_dev->hwpwm, value, BERLIN_PWM_CONTROL); in berlin_pwm_config()
122 berlin_pwm_writel(pwm, pwm_de in berlin_pwm_config()
132 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); berlin_pwm_set_polarity() local
149 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); berlin_pwm_enable() local
162 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); berlin_pwm_disable() local
188 struct berlin_pwm_chip *pwm; berlin_pwm_probe() local
230 struct berlin_pwm_chip *pwm = platform_get_drvdata(pdev); berlin_pwm_remove() local
242 struct berlin_pwm_chip *pwm = dev_get_drvdata(dev); berlin_pwm_suspend() local
265 struct berlin_pwm_chip *pwm = dev_get_drvdata(dev); berlin_pwm_resume() local
[all...]
H A Dpwm-sun4i.c22 #include <linux/pwm.h>
113 struct pwm_device *pwm, in sun4i_pwm_get_state()
130 if ((val & BIT_CH(PWM_BYPASS, pwm->hwpwm)) && in sun4i_pwm_get_state()
139 if ((PWM_REG_PRESCAL(val, pwm->hwpwm) == PWM_PRESCAL_MASK) && in sun4i_pwm_get_state()
143 prescaler = prescaler_table[PWM_REG_PRESCAL(val, pwm->hwpwm)]; in sun4i_pwm_get_state()
148 if (val & BIT_CH(PWM_ACT_STATE, pwm->hwpwm)) in sun4i_pwm_get_state()
153 if ((val & BIT_CH(PWM_CLK_GATING | PWM_EN, pwm->hwpwm)) == in sun4i_pwm_get_state()
154 BIT_CH(PWM_CLK_GATING | PWM_EN, pwm->hwpwm)) in sun4i_pwm_get_state()
159 val = sun4i_pwm_readl(sun4i_pwm, PWM_CH_PRD(pwm->hwpwm)); in sun4i_pwm_get_state()
231 static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in sun4i_pwm_apply() argument
112 sun4i_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) sun4i_pwm_get_state() argument
393 struct sun4i_pwm_chip *pwm; sun4i_pwm_probe() local
491 struct sun4i_pwm_chip *pwm = platform_get_drvdata(pdev); sun4i_pwm_remove() local
[all...]
H A Dsysfs.c15 #include <linux/pwm.h>
19 struct pwm_device *pwm; member
33 return export->pwm; in child_to_pwm_device()
40 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() local
43 pwm_get_state(pwm, &state); in period_show()
53 struct pwm_device *pwm = export->pwm; in period_store() local
63 pwm_get_state(pwm, &state); in period_store()
65 ret = pwm_apply_state(pwm, &state); in period_store()
75 const struct pwm_device *pwm in duty_cycle_show() local
88 struct pwm_device *pwm = export->pwm; duty_cycle_store() local
110 const struct pwm_device *pwm = child_to_pwm_device(child); enable_show() local
123 struct pwm_device *pwm = export->pwm; enable_store() local
158 const struct pwm_device *pwm = child_to_pwm_device(child); polarity_show() local
182 struct pwm_device *pwm = export->pwm; polarity_store() local
207 struct pwm_device *pwm = child_to_pwm_device(child); capture_show() local
232 ATTRIBUTE_GROUPS(pwm); global() variable
241 pwm_export_child(struct device *parent, struct pwm_device *pwm) pwm_export_child() argument
285 pwm_unexport_child(struct device *parent, struct pwm_device *pwm) pwm_unexport_child() argument
315 struct pwm_device *pwm; export_store() local
377 pwm_class_get_state(struct device *parent, struct pwm_device *pwm, struct pwm_state *state) pwm_class_get_state() argument
400 pwm_class_apply_state(struct pwm_export *export, struct pwm_device *pwm, struct pwm_state *state) pwm_class_apply_state() argument
419 struct pwm_device *pwm = &chip->pwms[i]; pwm_class_resume_npwm() local
450 struct pwm_device *pwm = &chip->pwms[i]; pwm_class_suspend() local
532 struct pwm_device *pwm = &chip->pwms[i]; pwmchip_sysfs_unexport() local
[all...]
H A Dpwm-tegra.c3 * drivers/pwm/pwm-tegra.c
8 * Based on arch/arm/plat-mxc/pwm.c by Sascha Hauer <s.hauer@pengutronix.de>
45 #include <linux/pwm.h>
95 static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in tegra_pwm_config() argument
183 if (!pwm_is_enabled(pwm)) { in tegra_pwm_config()
190 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_config()
195 if (!pwm_is_enabled(pwm)) in tegra_pwm_config()
201 static int tegra_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_enable() argument
211 val = pwm_readl(pc, pwm in tegra_pwm_enable()
218 tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) tegra_pwm_disable() argument
239 struct tegra_pwm_chip *pwm; tegra_pwm_probe() local
[all...]
H A Dpwm-twl.c12 #include <linux/pwm.h>
32 #define TWL4030_PWM_TOGGLE(pwm, x) ((x) << (pwm))
46 #define TWL6030_PWM_TOGGLE(pwm, x) ((x) << (pwm * 3))
60 static int twl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl_pwm_config() argument
83 base = pwm->hwpwm * 3; in twl_pwm_config()
89 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl_pwm_config()
94 static int twl4030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwm_enable() argument
103 dev_err(chip->dev, "%s: Failed to read GPBR1\n", pwm in twl4030_pwm_enable()
124 twl4030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_disable() argument
153 twl4030_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_request() argument
191 twl4030_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) twl4030_pwm_free() argument
221 twl6030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwm_enable() argument
244 twl6030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) twl6030_pwm_disable() argument
[all...]
H A Dpwm-pxa.c3 * drivers/pwm/pwm-pxa.c
18 #include <linux/pwm.h>
27 { "pxa25x-pwm", 0 },
28 { "pxa27x-pwm", HAS_SECONDARY_PWM },
29 { "pxa168-pwm", 0 },
30 { "pxa910-pwm", 0 },
60 static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in pxa_pwm_config() argument
69 offset = pwm->hwpwm ? 0x10 : 0; in pxa_pwm_config()
104 static int pxa_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in pxa_pwm_enable() argument
111 pxa_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) pxa_pwm_disable() argument
154 struct pwm_device *pwm; pxa_pwm_of_xlate() local
168 struct pxa_pwm_chip *pwm; pwm_probe() local
[all...]
H A Dpwm-crc.c11 #include <linux/pwm.h>
54 static int crc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in crc_pwm_apply() argument
69 if (pwm_is_enabled(pwm) && !state->enabled) { in crc_pwm_apply()
77 if (pwm_get_duty_cycle(pwm) != state->duty_cycle || in crc_pwm_apply()
78 pwm_get_period(pwm) != state->period) { in crc_pwm_apply()
90 if (pwm_is_enabled(pwm) && state->enabled && in crc_pwm_apply()
91 pwm_get_period(pwm) != state->period) { in crc_pwm_apply()
100 if (pwm_get_period(pwm) != state->period || in crc_pwm_apply()
101 pwm_is_enabled(pwm) != state->enabled) { in crc_pwm_apply()
113 if (!pwm_is_enabled(pwm) in crc_pwm_apply()
124 crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) crc_pwm_get_state() argument
161 struct crystalcove_pwm *pwm; crystalcove_pwm_probe() local
184 struct crystalcove_pwm *pwm = platform_get_drvdata(pdev); crystalcove_pwm_remove() local
[all...]
H A Dpwm-lpss.c21 #include "pwm-lpss.h"
37 static inline u32 pwm_lpss_read(const struct pwm_device *pwm) in pwm_lpss_read() argument
39 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_read()
41 return readl(lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_read()
44 static inline void pwm_lpss_write(const struct pwm_device *pwm, u32 value) in pwm_lpss_write() argument
46 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_write()
48 writel(value, lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_write()
51 static int pwm_lpss_wait_for_update(struct pwm_device *pwm) in pwm_lpss_wait_for_update() argument
53 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_wait_for_update()
54 const void __iomem *addr = lpwm->regs + pwm in pwm_lpss_wait_for_update()
77 pwm_lpss_is_updating(struct pwm_device *pwm) pwm_lpss_is_updating() argument
82 pwm_lpss_prepare(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm, int duty_ns, int period_ns) pwm_lpss_prepare() argument
117 pwm_lpss_cond_enable(struct pwm_device *pwm, bool cond) pwm_lpss_cond_enable() argument
123 pwm_lpss_prepare_enable(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm, const struct pwm_state *state) pwm_lpss_prepare_enable() argument
143 pwm_lpss_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) pwm_lpss_apply() argument
166 pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) pwm_lpss_get_state() argument
[all...]
H A Dpwm-jz4740.c20 #include <linux/pwm.h>
44 "ingenic,pwm-channels-mask", in jz4740_pwm_can_use_chn()
50 static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_request() argument
57 if (!jz4740_pwm_can_use_chn(jz, pwm->hwpwm)) in jz4740_pwm_request()
60 snprintf(name, sizeof(name), "timer%u", pwm->hwpwm); in jz4740_pwm_request()
74 pwm_set_chip_data(pwm, clk); in jz4740_pwm_request()
79 static void jz4740_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_free() argument
81 struct clk *clk = pwm_get_chip_data(pwm); in jz4740_pwm_free()
87 static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_enable() argument
92 regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm in jz4740_pwm_enable()
101 jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) jz4740_pwm_disable() argument
124 jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) jz4740_pwm_apply() argument
[all...]
/kernel/linux/linux-6.6/include/linux/
H A Dpwm.h72 * @pwm: global index of the PWM device
83 unsigned int pwm; member
94 * @pwm: PWM device
102 static inline void pwm_get_state(const struct pwm_device *pwm, in pwm_get_state() argument
105 *state = pwm->state; in pwm_get_state()
108 static inline bool pwm_is_enabled(const struct pwm_device *pwm) in pwm_is_enabled() argument
112 pwm_get_state(pwm, &state); in pwm_is_enabled()
117 static inline void pwm_set_period(struct pwm_device *pwm, u64 period) in pwm_set_period() argument
119 if (pwm) in pwm_set_period()
120 pwm in pwm_set_period()
123 pwm_get_period(const struct pwm_device *pwm) pwm_get_period() argument
132 pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty) pwm_set_duty_cycle() argument
138 pwm_get_duty_cycle(const struct pwm_device *pwm) pwm_get_duty_cycle() argument
147 pwm_get_polarity(const struct pwm_device *pwm) pwm_get_polarity() argument
156 pwm_get_args(const struct pwm_device *pwm, struct pwm_args *args) pwm_get_args() argument
179 pwm_init_state(const struct pwm_device *pwm, struct pwm_state *state) pwm_init_state() argument
323 pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
349 pwm_enable(struct pwm_device *pwm) pwm_enable() argument
368 pwm_disable(struct pwm_device *pwm) pwm_disable() argument
411 pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) pwm_apply_state() argument
418 pwm_adjust_config(struct pwm_device *pwm) pwm_adjust_config() argument
423 pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
430 pwm_enable(struct pwm_device *pwm) pwm_enable() argument
436 pwm_disable(struct pwm_device *pwm) pwm_disable() argument
441 pwm_capture(struct pwm_device *pwm, struct pwm_capture *result, unsigned long timeout) pwm_capture() argument
448 pwm_set_chip_data(struct pwm_device *pwm, void *data) pwm_set_chip_data() argument
453 pwm_get_chip_data(struct pwm_device *pwm) pwm_get_chip_data() argument
488 pwm_put(struct pwm_device *pwm) pwm_put() argument
509 pwm_apply_args(struct pwm_device *pwm) pwm_apply_args() argument
[all...]
/kernel/linux/linux-6.6/drivers/input/keyboard/
H A Dlm8323.c126 /* pwm lock */
147 struct lm8323_pwm pwm[LM8323_NUM_PWMS]; member
351 static void pwm_done(struct lm8323_pwm *pwm) in pwm_done() argument
353 mutex_lock(&pwm->lock); in pwm_done()
354 pwm->running = false; in pwm_done()
355 if (pwm->desired_brightness != pwm->brightness) in pwm_done()
356 schedule_work(&pwm->work); in pwm_done()
357 mutex_unlock(&pwm->lock); in pwm_done()
391 "pwm in lm8323_irq()
416 lm8323_write_pwm_one(struct lm8323_pwm *pwm, int pos, u16 cmd) lm8323_write_pwm_one() argument
428 lm8323_write_pwm(struct lm8323_pwm *pwm, int kill, int len, const u16 *cmds) lm8323_write_pwm() argument
443 struct lm8323_pwm *pwm = work_to_pwm(work); lm8323_pwm_work() local
500 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_set_brightness() local
526 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_show_time() local
535 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_store_time() local
558 struct lm8323_pwm *pwm; init_pwm() local
630 int pwm; lm8323_probe() local
[all...]
/kernel/linux/linux-5.10/include/trace/events/
H A Dpwm.h3 #define TRACE_SYSTEM pwm
8 #include <linux/pwm.h>
11 DECLARE_EVENT_CLASS(pwm,
13 TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
15 TP_ARGS(pwm, state),
18 __field(struct pwm_device *, pwm)
26 __entry->pwm = pwm;
34 __entry->pwm, __entry->period, __entry->duty_cycle,
39 DEFINE_EVENT(pwm, pwm_appl
[all...]
/kernel/linux/linux-6.6/include/trace/events/
H A Dpwm.h3 #define TRACE_SYSTEM pwm
8 #include <linux/pwm.h>
11 DECLARE_EVENT_CLASS(pwm,
13 TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state, int err),
15 TP_ARGS(pwm, state, err),
18 __field(struct pwm_device *, pwm)
27 __entry->pwm = pwm;
36 __entry->pwm, __entry->period, __entry->duty_cycle,
41 DEFINE_EVENT(pwm, pwm_appl
[all...]
/kernel/linux/linux-5.10/drivers/input/keyboard/
H A Dlm8323.c126 /* pwm lock */
147 struct lm8323_pwm pwm[LM8323_NUM_PWMS]; member
351 static void pwm_done(struct lm8323_pwm *pwm) in pwm_done() argument
353 mutex_lock(&pwm->lock); in pwm_done()
354 pwm->running = false; in pwm_done()
355 if (pwm->desired_brightness != pwm->brightness) in pwm_done()
356 schedule_work(&pwm->work); in pwm_done()
357 mutex_unlock(&pwm->lock); in pwm_done()
391 "pwm in lm8323_irq()
416 lm8323_write_pwm_one(struct lm8323_pwm *pwm, int pos, u16 cmd) lm8323_write_pwm_one() argument
428 lm8323_write_pwm(struct lm8323_pwm *pwm, int kill, int len, const u16 *cmds) lm8323_write_pwm() argument
443 struct lm8323_pwm *pwm = work_to_pwm(work); lm8323_pwm_work() local
500 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_set_brightness() local
526 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_show_time() local
535 struct lm8323_pwm *pwm = cdev_to_pwm(led_cdev); lm8323_pwm_store_time() local
558 struct lm8323_pwm *pwm; init_pwm() local
624 int pwm; lm8323_probe() local
[all...]

Completed in 15 milliseconds

12345678910>>...17