/drivers/pwm/ |
D | Makefile | 4 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_CLK) += pwm-clk.o [all …]
|
D | core.c | 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() 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 …]
|
D | pwm-twl.c | 32 #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 …]
|
D | sysfs.c | 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 = 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 …]
|
D | pwm-vt8500.c | 31 #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 vt8500_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 vt8500_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 …]
|
D | pwm-twl-led.c | 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() argument 142 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_disable() 146 val &= ~TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_disable() [all …]
|
D | pwm-lpss.c | 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->hwpwm * PWM_SIZE + PWM; in pwm_lpss_wait_for_update() 109 dev_err(pwm->chip->dev, "PWM_SW_UPDATE was not cleared\n"); in pwm_lpss_wait_for_update() [all …]
|
D | pwm-samsung.c | 121 struct pwm_device *pwm) in __pwm_samsung_manual_update() argument 123 unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm); in __pwm_samsung_manual_update() 134 static void pwm_samsung_set_divisor(struct samsung_pwm_chip *pwm, in pwm_samsung_set_divisor() argument 142 bits = (fls(divisor) - 1) - pwm->variant.div_base; in pwm_samsung_set_divisor() 146 reg = readl(pwm->base + REG_TCFG1); in pwm_samsung_set_divisor() 149 writel(reg, pwm->base + REG_TCFG1); in pwm_samsung_set_divisor() 228 static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) in pwm_samsung_request() argument 233 if (!(our_chip->variant.output_mask & BIT(pwm->hwpwm))) { in pwm_samsung_request() 236 pwm->hwpwm); in pwm_samsung_request() 244 pwm_set_chip_data(pwm, our_chan); in pwm_samsung_request() [all …]
|
D | pwm-stmpe.c | 39 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 …]
|
D | pwm-jz4740.c | 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->hwpwm), in jz4740_pwm_enable() 96 regmap_write(jz->map, TCU_REG_TESR, BIT(pwm->hwpwm)); in jz4740_pwm_enable() 101 static void jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_disable() argument [all …]
|
D | pwm-crc.c | 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) && state->enabled) { in crc_pwm_apply() 124 static int crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, in crc_pwm_get_state() argument [all …]
|
D | pwm-berlin.c | 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() 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 …]
|
D | pwm-mediatek.c | 73 struct pwm_device *pwm) in pwm_mediatek_clk_enable() argument 86 ret = clk_prepare_enable(pc->clk_pwms[pwm->hwpwm]); in pwm_mediatek_clk_enable() 101 struct pwm_device *pwm) in pwm_mediatek_clk_disable() argument 105 clk_disable_unprepare(pc->clk_pwms[pwm->hwpwm]); in pwm_mediatek_clk_disable() 117 static int pwm_mediatek_config(struct pwm_chip *chip, struct pwm_device *pwm, in pwm_mediatek_config() argument 126 ret = pwm_mediatek_clk_enable(chip, pwm); in pwm_mediatek_config() 137 do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm])); in pwm_mediatek_config() 148 pwm_mediatek_clk_disable(chip, pwm); in pwm_mediatek_config() 153 if (pc->soc->pwm45_fixup && pwm->hwpwm > 2) { in pwm_mediatek_config() 163 pwm_mediatek_writel(pc, pwm->hwpwm, PWMCON, BIT(15) | clkdiv); in pwm_mediatek_config() [all …]
|
D | pwm-hibvt.c | 83 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 …]
|
D | pwm-lpc18xx-sct.c | 128 struct pwm_device *pwm, in lpc18xx_pwm_set_conflict_res() argument 141 val &= ~LPC18XX_PWM_RES_MASK(pwm->hwpwm); in lpc18xx_pwm_set_conflict_res() 142 val |= LPC18XX_PWM_RES(pwm->hwpwm, action); in lpc18xx_pwm_set_conflict_res() 171 struct pwm_device *pwm, u64 duty_ns) in lpc18xx_pwm_config_duty() argument 174 struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm]; in lpc18xx_pwm_config_duty() 192 static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in lpc18xx_pwm_config() argument 217 pwm->hwpwm); in lpc18xx_pwm_config() 232 lpc18xx_pwm_config_duty(chip, pwm, duty_ns); in lpc18xx_pwm_config() 237 static int lpc18xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm, enum pwm_polarity pola… in lpc18xx_pwm_enable() argument 240 struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm]; in lpc18xx_pwm_enable() [all …]
|
D | pwm-atmel.c | 240 static void atmel_pwm_update_cdty(struct pwm_chip *chip, struct pwm_device *pwm, in atmel_pwm_update_cdty() argument 248 val = atmel_pwm_ch_readl(atmel_pwm, pwm->hwpwm, PWM_CMR); in atmel_pwm_update_cdty() 250 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, PWM_CMR, val); in atmel_pwm_update_cdty() 253 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, in atmel_pwm_update_cdty() 255 atmel_pwm_set_pending(atmel_pwm, pwm->hwpwm); in atmel_pwm_update_cdty() 259 struct pwm_device *pwm, in atmel_pwm_set_cprd_cdty() argument 264 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, in atmel_pwm_set_cprd_cdty() 266 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, in atmel_pwm_set_cprd_cdty() 270 static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, in atmel_pwm_disable() argument 276 atmel_pwm_wait_nonpending(atmel_pwm, pwm->hwpwm); in atmel_pwm_disable() [all …]
|
D | pwm-renesas-tpu.c | 210 static int tpu_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in tpu_pwm_request() argument 215 if (pwm->hwpwm >= TPU_CHANNEL_MAX) in tpu_pwm_request() 223 tpd->channel = pwm->hwpwm; in tpu_pwm_request() 231 pwm_set_chip_data(pwm, tpd); in tpu_pwm_request() 236 static void tpu_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in tpu_pwm_free() argument 238 struct tpu_pwm_device *tpd = pwm_get_chip_data(pwm); in tpu_pwm_free() 244 static int tpu_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in tpu_pwm_config() argument 247 struct tpu_pwm_device *tpd = pwm_get_chip_data(pwm); in tpu_pwm_config() 353 static int tpu_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, in tpu_pwm_set_polarity() argument 356 struct tpu_pwm_device *tpd = pwm_get_chip_data(pwm); in tpu_pwm_set_polarity() [all …]
|
D | pwm-sprd.c | 68 static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, in sprd_pwm_get_state() argument 73 struct sprd_pwm_chn *chn = &spc->chn[pwm->hwpwm]; in sprd_pwm_get_state() 85 pwm->hwpwm); in sprd_pwm_get_state() 89 val = sprd_pwm_read(spc, pwm->hwpwm, SPRD_PWM_ENABLE); in sprd_pwm_get_state() 103 val = sprd_pwm_read(spc, pwm->hwpwm, SPRD_PWM_PRESCALE); in sprd_pwm_get_state() 108 val = sprd_pwm_read(spc, pwm->hwpwm, SPRD_PWM_DUTY); in sprd_pwm_get_state() 121 static int sprd_pwm_config(struct sprd_pwm_chip *spc, struct pwm_device *pwm, in sprd_pwm_config() argument 124 struct sprd_pwm_chn *chn = &spc->chn[pwm->hwpwm]; in sprd_pwm_config() 154 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_PRESCALE, prescale); in sprd_pwm_config() 155 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_MOD, SPRD_PWM_MOD_MAX); in sprd_pwm_config() [all …]
|
D | pwm-fsl-ftm.c | 89 static int fsl_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in fsl_pwm_request() argument 97 regmap_update_bits(fpc->regmap, FTM_SC, BIT(pwm->hwpwm + 16), in fsl_pwm_request() 98 BIT(pwm->hwpwm + 16)); in fsl_pwm_request() 105 static void fsl_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in fsl_pwm_free() argument 111 regmap_update_bits(fpc->regmap, FTM_SC, BIT(pwm->hwpwm + 16), in fsl_pwm_free() 205 struct pwm_device *pwm) in fsl_pwm_is_any_pwm_enabled() argument 217 struct pwm_device *pwm) in fsl_pwm_is_other_pwm_enabled() argument 222 if (~(val | BIT(pwm->hwpwm)) & 0xFF) in fsl_pwm_is_other_pwm_enabled() 229 struct pwm_device *pwm, in fsl_pwm_apply_config() argument 243 if (!fsl_pwm_is_any_pwm_enabled(fpc, pwm)) in fsl_pwm_apply_config() [all …]
|
D | pwm-spear.c | 77 static int spear_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in spear_pwm_config() argument 128 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, in spear_pwm_config() 130 spear_pwm_writel(pc, pwm->hwpwm, PWMDCR, dc); in spear_pwm_config() 131 spear_pwm_writel(pc, pwm->hwpwm, PWMPCR, pv); in spear_pwm_config() 137 static int spear_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in spear_pwm_enable() argument 147 val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); in spear_pwm_enable() 149 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, val); in spear_pwm_enable() 154 static void spear_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in spear_pwm_disable() argument 159 val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); in spear_pwm_disable() 161 spear_pwm_writel(pc, pwm->hwpwm, PWMCR, val); in spear_pwm_disable() [all …]
|
/drivers/clocksource/ |
D | samsung_pwm_timer.c | 79 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 …]
|
/drivers/input/keyboard/ |
D | lm8323.c | 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() 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 …]
|
/drivers/hwmon/ |
D | mlxreg-fan.c | 110 struct mlxreg_fan_pwm pwm[MLXREG_FAN_MAX_PWM]; member 125 struct mlxreg_fan_pwm *pwm; in mlxreg_fan_read() local 182 pwm = &fan->pwm[channel]; in mlxreg_fan_read() 185 err = regmap_read(fan->regmap, pwm->reg, ®val); in mlxreg_fan_read() 209 struct mlxreg_fan_pwm *pwm; in mlxreg_fan_write() local 218 pwm = &fan->pwm[channel]; in mlxreg_fan_write() 221 pwm->last_hwmon_state = MLXREG_FAN_PWM_DUTY2STATE(val); in mlxreg_fan_write() 226 if (pwm->last_hwmon_state >= pwm->last_thermal_state) in mlxreg_fan_write() 227 return mlxreg_fan_set_cur_state(pwm->cdev, in mlxreg_fan_write() 228 pwm->last_hwmon_state); in mlxreg_fan_write() [all …]
|
/drivers/clk/ |
D | clk-pwm.c | 16 struct pwm_device *pwm; member 29 return pwm_enable(clk_pwm->pwm); in clk_pwm_prepare() 36 pwm_disable(clk_pwm->pwm); in clk_pwm_unprepare() 52 pwm_get_state(clk_pwm->pwm, &state); in clk_pwm_get_duty_cycle() 72 struct pwm_device *pwm; in clk_pwm_probe() local 81 pwm = devm_pwm_get(&pdev->dev, NULL); in clk_pwm_probe() 82 if (IS_ERR(pwm)) in clk_pwm_probe() 83 return PTR_ERR(pwm); in clk_pwm_probe() 85 pwm_get_args(pwm, &pargs); in clk_pwm_probe() 110 pwm_apply_args(pwm); in clk_pwm_probe() [all …]
|
/drivers/staging/greybus/ |
D | pwm.c | 22 struct pwm_chip *pwm; member 190 static int gb_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in gb_pwm_request() argument 194 return gb_pwm_activate_operation(pwmc, pwm->hwpwm); in gb_pwm_request() 197 static void gb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in gb_pwm_free() argument 201 if (pwm_is_enabled(pwm)) in gb_pwm_free() 204 gb_pwm_deactivate_operation(pwmc, pwm->hwpwm); in gb_pwm_free() 207 static int gb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in gb_pwm_apply() argument 211 bool enabled = pwm->state.enabled; in gb_pwm_apply() 217 if (state->polarity != pwm->state.polarity) { in gb_pwm_apply() 219 gb_pwm_disable_operation(pwmc, pwm->hwpwm); in gb_pwm_apply() [all …]
|