Home
last modified time | relevance | path

Searched refs:pwm (Results 1 – 25 of 847) sorted by relevance

12345678910>>...34

/Linux-v5.15/drivers/pwm/
DMakefile4 obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o
5 obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o
6 obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
7 obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
8 obj-$(CONFIG_PWM_BCM_IPROC) += pwm-bcm-iproc.o
9 obj-$(CONFIG_PWM_BCM_KONA) += pwm-bcm-kona.o
10 obj-$(CONFIG_PWM_BCM2835) += pwm-bcm2835.o
11 obj-$(CONFIG_PWM_BERLIN) += pwm-berlin.o
12 obj-$(CONFIG_PWM_BRCMSTB) += pwm-brcmstb.o
13 obj-$(CONFIG_PWM_CLPS711X) += pwm-clps711x.o
[all …]
Dpwm-renesas-tpu.c92 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_TIORn, in tpu_pwm_set_pin()
116 pwm->polarity == PWM_POLARITY_INVERSED ? in tpu_pwm_set_pin()
[all …]
Dcore.c35 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()
58 struct pwm_device *pwm = &chip->pwms[i]; in free_pwms() local
60 radix_tree_delete(&pwm_tree, pwm->pwm); in free_pwms()
92 static int pwm_device_request(struct pwm_device *pwm, const char *label) in pwm_device_request() argument
96 if (test_bit(PWMF_REQUESTED, &pwm->flags)) in pwm_device_request()
99 if (!try_module_get(pwm->chip->ops->owner)) in pwm_device_request()
102 if (pwm->chip->ops->request) { in pwm_device_request()
103 err = pwm->chip->ops->request(pwm->chip, pwm); in pwm_device_request()
105 module_put(pwm->chip->ops->owner); in pwm_device_request()
[all …]
Dpwm-sun4i.c113 struct pwm_device *pwm, in sun4i_pwm_get_state() argument
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
242 pwm_get_state(pwm, &cstate); in sun4i_pwm_apply()
[all …]
Dpwm-tegra.c95 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->hwpwm); in tegra_pwm_enable()
213 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_enable()
218 static void tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_disable() argument
223 val = pwm_readl(pc, pwm->hwpwm); in tegra_pwm_disable()
225 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_disable()
[all …]
Dsysfs.c19 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 = child_to_pwm_device(child); in duty_cycle_show() local
78 pwm_get_state(pwm, &state); in duty_cycle_show()
88 struct pwm_device *pwm = export->pwm; in duty_cycle_store() local
[all …]
Dpwm-lpss.c37 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->hwpwm * PWM_SIZE + PWM; in pwm_lpss_wait_for_update()
72 dev_err(pwm->chip->dev, "PWM_SW_UPDATE was not cleared\n"); in pwm_lpss_wait_for_update()
[all …]
Dpwm-twl.c32 #define TWL4030_PWM_TOGGLE(pwm, x) ((x) << (pwm)) argument
46 #define TWL6030_PWM_TOGGLE(pwm, x) ((x) << (pwm * 3)) argument
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->label); in twl4030_pwm_enable()
107 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMXCLK_ENABLE); in twl4030_pwm_enable()
111 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwm_enable()
113 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMX_ENABLE); in twl4030_pwm_enable()
[all …]
Dpwm-stmpe.c39 static int stmpe_24xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in stmpe_24xx_pwm_enable() argument
48 pwm->hwpwm); in stmpe_24xx_pwm_enable()
52 value = ret | BIT(pwm->hwpwm); in stmpe_24xx_pwm_enable()
57 pwm->hwpwm); in stmpe_24xx_pwm_enable()
65 struct pwm_device *pwm) in stmpe_24xx_pwm_disable() argument
74 pwm->hwpwm); in stmpe_24xx_pwm_disable()
78 value = ret & ~BIT(pwm->hwpwm); in stmpe_24xx_pwm_disable()
83 pwm->hwpwm); in stmpe_24xx_pwm_disable()
99 static int stmpe_24xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in stmpe_24xx_pwm_config() argument
113 if (pwm_is_enabled(pwm)) { in stmpe_24xx_pwm_config()
[all …]
Dpwm-vt8500.c31 #define REG_CTRL(pwm) (((pwm) << 4) + 0x00) argument
32 #define REG_SCALAR(pwm) (((pwm) << 4) + 0x04) argument
33 #define REG_PERIOD(pwm) (((pwm) << 4) + 0x08) argument
34 #define REG_DUTY(pwm) (((pwm) << 4) + 0x0C) argument
72 static int vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in vt8500_pwm_config() argument
108 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config()
109 pwm_busy_wait(vt8500, pwm->hwpwm, STATUS_SCALAR_UPDATE); in vt8500_pwm_config()
111 writel(pv, vt8500->base + REG_PERIOD(pwm->hwpwm)); in vt8500_pwm_config()
112 pwm_busy_wait(vt8500, pwm->hwpwm, STATUS_PERIOD_UPDATE); in vt8500_pwm_config()
114 writel(dc, vt8500->base + REG_DUTY(pwm->hwpwm)); in vt8500_pwm_config()
[all …]
Dpwm-img.c92 static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in img_pwm_config() argument
138 val &= ~(PWM_CTRL_CFG_DIV_MASK << PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm)); in img_pwm_config()
140 PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm); in img_pwm_config()
145 img_pwm_writel(pwm_chip, PWM_CH_CFG(pwm->hwpwm), val); in img_pwm_config()
153 static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in img_pwm_enable() argument
164 val |= BIT(pwm->hwpwm); in img_pwm_enable()
169 PERIP_PWM_PDM_CONTROL_CH_SHIFT(pwm->hwpwm), 0); in img_pwm_enable()
174 static void img_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in img_pwm_disable() argument
180 val &= ~BIT(pwm->hwpwm); in img_pwm_disable()
243 struct img_pwm_chip *pwm; in img_pwm_probe() local
[all …]
Dpwm-jz4740.c50 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()
73 pwm_set_chip_data(pwm, clk); in jz4740_pwm_request()
78 static void jz4740_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_free() argument
80 struct clk *clk = pwm_get_chip_data(pwm); in jz4740_pwm_free()
86 static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_enable() argument
91 regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), in jz4740_pwm_enable()
95 regmap_write(jz->map, TCU_REG_TESR, BIT(pwm->hwpwm)); in jz4740_pwm_enable()
100 static void jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_disable() argument
[all …]
Dpwm-crc.c54 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) && state->enabled) { in crc_pwm_apply()
124 static void crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, in crc_pwm_get_state() argument
[all …]
Dpwm-twl-led.c58 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument
81 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG; in twl4030_pwmled_config()
87 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl4030_pwmled_config()
92 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwmled_enable() argument
101 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_enable()
105 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_enable()
109 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwmled_enable()
117 struct pwm_device *pwm) in twl4030_pwmled_disable() argument
126 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_disable()
130 val &= ~TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_disable()
[all …]
Dpwm-berlin.c72 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()
90 static int berlin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in berlin_pwm_config() argument
115 value = berlin_pwm_readl(bpc, pwm->hwpwm, BERLIN_PWM_CONTROL); in berlin_pwm_config()
120 berlin_pwm_writel(bpc, pwm->hwpwm, value, BERLIN_PWM_CONTROL); in berlin_pwm_config()
122 berlin_pwm_writel(bpc, pwm->hwpwm, duty, BERLIN_PWM_DUTY); in berlin_pwm_config()
123 berlin_pwm_writel(bpc, pwm->hwpwm, period, BERLIN_PWM_TCNT); in berlin_pwm_config()
129 struct pwm_device *pwm, in berlin_pwm_set_polarity() argument
[all …]
Dpwm-hibvt.c83 static void hibvt_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in hibvt_pwm_enable() argument
87 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_enable()
91 static void hibvt_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in hibvt_pwm_disable() argument
95 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_disable()
99 static void hibvt_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in hibvt_pwm_config() argument
110 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG0_ADDR(pwm->hwpwm), in hibvt_pwm_config()
113 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG1_ADDR(pwm->hwpwm), in hibvt_pwm_config()
118 struct pwm_device *pwm, in hibvt_pwm_set_polarity() argument
124 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_set_polarity()
127 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_set_polarity()
[all …]
/Linux-v5.15/drivers/clocksource/
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.base + REG_TCNTB(channel)); in samsung_time_setup()
[all …]
/Linux-v5.15/include/linux/
Dpwm.h86 unsigned int pwm; member
105 static inline void pwm_get_state(const struct pwm_device *pwm, in pwm_get_state() argument
108 *state = pwm->state; in pwm_get_state()
111 static inline bool pwm_is_enabled(const struct pwm_device *pwm) in pwm_is_enabled() argument
115 pwm_get_state(pwm, &state); in pwm_is_enabled()
120 static inline void pwm_set_period(struct pwm_device *pwm, u64 period) in pwm_set_period() argument
122 if (pwm) in pwm_set_period()
123 pwm->state.period = period; in pwm_set_period()
126 static inline u64 pwm_get_period(const struct pwm_device *pwm) in pwm_get_period() argument
130 pwm_get_state(pwm, &state); in pwm_get_period()
[all …]
/Linux-v5.15/drivers/input/keyboard/
Dlm8323.c147 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()
392 pwm_done(&lm->pwm[i]); in lm8323_irq()
416 static void lm8323_write_pwm_one(struct lm8323_pwm *pwm, int pos, u16 cmd) in lm8323_write_pwm_one() argument
418 lm8323_write(pwm->chip, 4, LM8323_CMD_PWM_WRITE, (pos << 2) | pwm->id, in lm8323_write_pwm_one()
[all …]
/Linux-v5.15/Documentation/devicetree/bindings/pwm/
Dpwm.txt8 with a property containing a 'pwm-list':
10 pwm-list ::= <single-pwm> [pwm-list]
11 single-pwm ::= <pwm-phandle> <pwm-specifier>
12 pwm-phandle : phandle to PWM controller node
13 pwm-specifier : array of #pwm-cells specifying the given PWM
18 An optional property "pwm-names" may contain a list of strings to label
19 each of the PWM devices listed in the "pwms" property. If no "pwm-names"
23 "pwm-names" property to map the name of the PWM device requested by the
29 pwm: pwm {
30 #pwm-cells = <2>;
[all …]
Dnvidia,tegra20-pwm.txt5 - "nvidia,tegra20-pwm": for Tegra20
6 - "nvidia,tegra30-pwm", "nvidia,tegra20-pwm": for Tegra30
7 - "nvidia,tegra114-pwm", "nvidia,tegra20-pwm": for Tegra114
8 - "nvidia,tegra124-pwm", "nvidia,tegra20-pwm": for Tegra124
9 - "nvidia,tegra132-pwm", "nvidia,tegra20-pwm": for Tegra132
10 - "nvidia,tegra210-pwm", "nvidia,tegra20-pwm": for Tegra210
11 - "nvidia,tegra186-pwm": for Tegra186
12 - "nvidia,tegra194-pwm": for Tegra194
14 - #pwm-cells: should be 2. See pwm.yaml in this directory for a description of
21 - pwm
[all …]
Dpwm-meson.txt5 - compatible: Shall contain "amlogic,meson8b-pwm"
6 or "amlogic,meson-gxbb-pwm"
7 or "amlogic,meson-gxbb-ao-pwm"
8 or "amlogic,meson-axg-ee-pwm"
9 or "amlogic,meson-axg-ao-pwm"
10 or "amlogic,meson-g12a-ee-pwm"
11 or "amlogic,meson-g12a-ao-pwm-ab"
12 or "amlogic,meson-g12a-ao-pwm-cd"
13 - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
23 pwm_ab: pwm@8550 {
[all …]
Datmel-pwm.txt5 - "atmel,at91sam9rl-pwm"
6 - "atmel,sama5d3-pwm"
7 - "atmel,sama5d2-pwm"
8 - "microchip,sam9x60-pwm"
10 - #pwm-cells: Should be 3. See pwm.yaml in this directory for a
15 pwm0: pwm@f8034000 {
16 compatible = "atmel,at91sam9rl-pwm";
18 #pwm-cells = <3>;
22 compatible = "pwm-leds";
Dlpc1850-sct-pwm.txt4 - compatible: Should be "nxp,lpc1850-sct-pwm"
5 - reg: Should contain physical base address and length of pwm registers.
9 - pwm: PWM operating clock.
10 - #pwm-cells: Should be 3. See pwm.yaml in this directory for the description
14 pwm: pwm@40000000 {
15 compatible = "nxp,lpc1850-sct-pwm";
18 clock-names = "pwm";
19 #pwm-cells = <3>;
/Linux-v5.15/include/trace/events/
Dpwm.h3 #define TRACE_SYSTEM pwm
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_apply,
41 TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
43 TP_ARGS(pwm, state)
[all …]

12345678910>>...34