/drivers/pwm/ |
D | pwm-renesas-tpu.c | 100 static void tpu_pwm_write(struct tpu_pwm_device *pwm, int reg_nr, u16 value) in tpu_pwm_write() argument 102 void __iomem *base = pwm->tpu->base + TPU_CHANNEL_OFFSET in tpu_pwm_write() 103 + pwm->channel * TPU_CHANNEL_SIZE; in tpu_pwm_write() 108 static void tpu_pwm_set_pin(struct tpu_pwm_device *pwm, in tpu_pwm_set_pin() argument 113 dev_dbg(&pwm->tpu->pdev->dev, "%u: configuring pin as %s\n", in tpu_pwm_set_pin() 114 pwm->channel, states[state]); in tpu_pwm_set_pin() 118 tpu_pwm_write(pwm, TPU_TIORn, in tpu_pwm_set_pin() 119 pwm->polarity == PWM_POLARITY_INVERSED ? in tpu_pwm_set_pin() 123 tpu_pwm_write(pwm, TPU_TIORn, in tpu_pwm_set_pin() 124 pwm->polarity == PWM_POLARITY_INVERSED ? in tpu_pwm_set_pin() [all …]
|
D | core.c | 44 static struct pwm_device *pwm_to_device(unsigned int pwm) in pwm_to_device() argument 46 return radix_tree_lookup(&pwm_tree, pwm); in pwm_to_device() 49 static int alloc_pwms(int pwm, unsigned int count) in alloc_pwms() argument 54 if (pwm >= MAX_PWMS) in alloc_pwms() 57 if (pwm >= 0) in alloc_pwms() 58 from = pwm; in alloc_pwms() 63 if (pwm >= 0 && start != pwm) in alloc_pwms() 77 struct pwm_device *pwm = &chip->pwms[i]; in free_pwms() local 79 radix_tree_delete(&pwm_tree, pwm->pwm); in free_pwms() 111 static int pwm_device_request(struct pwm_device *pwm, const char *label) in pwm_device_request() argument [all …]
|
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_BFIN) += pwm-bfin.o 13 obj-$(CONFIG_PWM_BRCMSTB) += pwm-brcmstb.o [all …]
|
D | pwm-berlin.c | 66 static int berlin_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_request() argument 74 return pwm_set_chip_data(pwm, channel); in berlin_pwm_request() 77 static void berlin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in berlin_pwm_free() argument 79 struct berlin_pwm_channel *channel = pwm_get_chip_data(pwm); in berlin_pwm_free() 87 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); in berlin_pwm_config() local 92 cycles = clk_get_rate(pwm->clk); in berlin_pwm_config() 112 value = berlin_pwm_readl(pwm, pwm_dev->hwpwm, BERLIN_PWM_CONTROL); in berlin_pwm_config() 115 berlin_pwm_writel(pwm, pwm_dev->hwpwm, value, BERLIN_PWM_CONTROL); in berlin_pwm_config() 117 berlin_pwm_writel(pwm, pwm_dev->hwpwm, duty, BERLIN_PWM_DUTY); in berlin_pwm_config() 118 berlin_pwm_writel(pwm, pwm_dev->hwpwm, period, BERLIN_PWM_TCNT); in berlin_pwm_config() [all …]
|
D | pwm-tegra.c | 79 static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in tegra_pwm_config() argument 129 if (!pwm_is_enabled(pwm)) { in tegra_pwm_config() 136 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_config() 141 if (!pwm_is_enabled(pwm)) in tegra_pwm_config() 147 static int tegra_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_enable() argument 157 val = pwm_readl(pc, pwm->hwpwm); in tegra_pwm_enable() 159 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_enable() 164 static void tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_disable() argument 169 val = pwm_readl(pc, pwm->hwpwm); in tegra_pwm_disable() 171 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_disable() [all …]
|
D | sysfs.c | 28 struct pwm_device *pwm; member 41 return export->pwm; in child_to_pwm_device() 48 const struct pwm_device *pwm = child_to_pwm_device(child); in period_show() local 51 pwm_get_state(pwm, &state); in period_show() 61 struct pwm_device *pwm = export->pwm; in period_store() local 71 pwm_get_state(pwm, &state); in period_store() 73 ret = pwm_apply_state(pwm, &state); in period_store() 83 const struct pwm_device *pwm = child_to_pwm_device(child); in duty_cycle_show() local 86 pwm_get_state(pwm, &state); in duty_cycle_show() 96 struct pwm_device *pwm = export->pwm; in duty_cycle_store() local [all …]
|
D | pwm-img.c | 88 static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in img_pwm_config() argument 127 val &= ~(PWM_CTRL_CFG_DIV_MASK << PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm)); in img_pwm_config() 129 PWM_CTRL_CFG_DIV_SHIFT(pwm->hwpwm); in img_pwm_config() 134 img_pwm_writel(pwm_chip, PWM_CH_CFG(pwm->hwpwm), val); in img_pwm_config() 139 static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in img_pwm_enable() argument 145 val |= BIT(pwm->hwpwm); in img_pwm_enable() 150 PERIP_PWM_PDM_CONTROL_CH_SHIFT(pwm->hwpwm), 0); in img_pwm_enable() 155 static void img_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in img_pwm_disable() argument 161 val &= ~BIT(pwm->hwpwm); in img_pwm_disable() 191 struct img_pwm_chip *pwm; in img_pwm_probe() local [all …]
|
D | pwm-sun4i.c | 108 struct pwm_device *pwm, in sun4i_pwm_get_state() argument 123 prescaler = prescaler_table[PWM_REG_PRESCAL(val, pwm->hwpwm)]; in sun4i_pwm_get_state() 128 if (val & BIT_CH(PWM_ACT_STATE, pwm->hwpwm)) in sun4i_pwm_get_state() 133 if (val & BIT_CH(PWM_CLK_GATING | PWM_EN, pwm->hwpwm)) in sun4i_pwm_get_state() 138 val = sun4i_pwm_readl(sun4i_pwm, PWM_CH_PRD(pwm->hwpwm)); in sun4i_pwm_get_state() 204 static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in sun4i_pwm_apply() argument 214 pwm_get_state(pwm, &cstate); in sun4i_pwm_apply() 242 if (PWM_REG_PRESCAL(ctrl, pwm->hwpwm) != prescaler) { in sun4i_pwm_apply() 244 ctrl &= ~BIT_CH(PWM_CLK_GATING, pwm->hwpwm); in sun4i_pwm_apply() 247 ctrl &= ~BIT_CH(PWM_PRESCAL_MASK, pwm->hwpwm); in sun4i_pwm_apply() [all …]
|
D | pwm-bfin.c | 30 static int bfin_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in bfin_pwm_request() argument 35 if (pwm->hwpwm >= ARRAY_SIZE(pwm_to_gptimer_per)) in bfin_pwm_request() 42 priv->pin = pwm_to_gptimer_per[pwm->hwpwm]; in bfin_pwm_request() 50 pwm_set_chip_data(pwm, priv); in bfin_pwm_request() 55 static void bfin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in bfin_pwm_free() argument 57 struct bfin_pwm *priv = pwm_get_chip_data(pwm); in bfin_pwm_free() 65 static int bfin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in bfin_pwm_config() argument 68 struct bfin_pwm *priv = pwm_get_chip_data(pwm); in bfin_pwm_config() 90 static int bfin_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in bfin_pwm_enable() argument 92 struct bfin_pwm *priv = pwm_get_chip_data(pwm); in bfin_pwm_enable() [all …]
|
D | pwm-twl.c | 43 #define TWL4030_PWM_TOGGLE(pwm, x) ((x) << (pwm)) argument 57 #define TWL6030_PWM_TOGGLE(pwm, x) ((x) << (pwm * 3)) argument 71 static int twl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl_pwm_config() argument 94 base = pwm->hwpwm * 3; in twl_pwm_config() 100 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl_pwm_config() 105 static int twl4030_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwm_enable() argument 114 dev_err(chip->dev, "%s: Failed to read GPBR1\n", pwm->label); in twl4030_pwm_enable() 118 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMXCLK_ENABLE); in twl4030_pwm_enable() 122 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwm_enable() 124 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMX_ENABLE); in twl4030_pwm_enable() [all …]
|
D | pwm-pxa.c | 63 static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in pxa_pwm_config() argument 72 offset = pwm->hwpwm ? 0x10 : 0; in pxa_pwm_config() 107 static int pxa_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in pxa_pwm_enable() argument 114 static void pxa_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in pxa_pwm_disable() argument 157 struct pwm_device *pwm; in pxa_pwm_of_xlate() local 159 pwm = pwm_request_from_chip(pc, 0, NULL); in pxa_pwm_of_xlate() 160 if (IS_ERR(pwm)) in pxa_pwm_of_xlate() 161 return pwm; in pxa_pwm_of_xlate() 163 pwm->args.period = args->args[0]; in pxa_pwm_of_xlate() 165 return pwm; in pxa_pwm_of_xlate() [all …]
|
D | pwm-jz4740.c | 38 static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_request() argument 44 if (pwm->hwpwm < 2) in jz4740_pwm_request() 47 jz4740_timer_start(pwm->hwpwm); in jz4740_pwm_request() 52 static void jz4740_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_free() argument 54 jz4740_timer_set_ctrl(pwm->hwpwm, 0); in jz4740_pwm_free() 56 jz4740_timer_stop(pwm->hwpwm); in jz4740_pwm_free() 59 static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_enable() argument 61 uint32_t ctrl = jz4740_timer_get_ctrl(pwm->pwm); in jz4740_pwm_enable() 64 jz4740_timer_set_ctrl(pwm->hwpwm, ctrl); in jz4740_pwm_enable() 65 jz4740_timer_enable(pwm->hwpwm); in jz4740_pwm_enable() [all …]
|
D | pwm-stmpe.c | 43 static int stmpe_24xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in stmpe_24xx_pwm_enable() argument 52 pwm->hwpwm); in stmpe_24xx_pwm_enable() 56 value = ret | BIT(pwm->hwpwm); in stmpe_24xx_pwm_enable() 61 pwm->hwpwm); in stmpe_24xx_pwm_enable() 69 struct pwm_device *pwm) in stmpe_24xx_pwm_disable() argument 78 pwm->hwpwm); in stmpe_24xx_pwm_disable() 82 value = ret & ~BIT(pwm->hwpwm); in stmpe_24xx_pwm_disable() 87 pwm->hwpwm); in stmpe_24xx_pwm_disable() 103 static int stmpe_24xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in stmpe_24xx_pwm_config() argument 117 if (pwm_is_enabled(pwm)) { in stmpe_24xx_pwm_config() [all …]
|
D | pwm-lpss.c | 49 static inline u32 pwm_lpss_read(const struct pwm_device *pwm) in pwm_lpss_read() argument 51 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_read() 53 return readl(lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_read() 56 static inline void pwm_lpss_write(const struct pwm_device *pwm, u32 value) in pwm_lpss_write() argument 58 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_write() 60 writel(value, lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_write() 63 static int pwm_lpss_wait_for_update(struct pwm_device *pwm) in pwm_lpss_wait_for_update() argument 65 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_wait_for_update() 66 const void __iomem *addr = lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM; in pwm_lpss_wait_for_update() 84 dev_err(pwm->chip->dev, "PWM_SW_UPDATE was not cleared\n"); in pwm_lpss_wait_for_update() [all …]
|
D | pwm-crc.c | 50 static int crc_pwm_enable(struct pwm_chip *c, struct pwm_device *pwm) in crc_pwm_enable() argument 59 static void crc_pwm_disable(struct pwm_chip *c, struct pwm_device *pwm) in crc_pwm_disable() argument 66 static int crc_pwm_config(struct pwm_chip *c, struct pwm_device *pwm, in crc_pwm_config() argument 78 if (pwm_get_period(pwm) != period_ns) { in crc_pwm_config() 82 crc_pwm_disable(c, pwm); in crc_pwm_config() 89 crc_pwm_enable(c, pwm); in crc_pwm_config() 107 struct crystalcove_pwm *pwm; in crystalcove_pwm_probe() local 111 pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL); in crystalcove_pwm_probe() 112 if (!pwm) in crystalcove_pwm_probe() 115 pwm->chip.dev = &pdev->dev; in crystalcove_pwm_probe() [all …]
|
D | pwm-pca9685.c | 100 struct pwm_device *pwm; in pca9685_pwm_gpio_request() local 104 pwm = &pca->chip.pwms[offset]; in pca9685_pwm_gpio_request() 106 if (pwm->flags & (PWMF_REQUESTED | PWMF_EXPORTED)) { in pca9685_pwm_gpio_request() 111 pwm_set_chip_data(pwm, (void *)1); in pca9685_pwm_gpio_request() 118 static bool pca9685_pwm_is_gpio(struct pca9685 *pca, struct pwm_device *pwm) in pca9685_pwm_is_gpio() argument 124 if (pwm->hwpwm >= PCA9685_MAXCHAN) { in pca9685_pwm_is_gpio() 136 } else if (pwm_get_chip_data(pwm)) { in pca9685_pwm_is_gpio() 147 struct pwm_device *pwm = &pca->chip.pwms[offset]; in pca9685_pwm_gpio_get() local 150 regmap_read(pca->regmap, LED_N_ON_H(pwm->hwpwm), &value); in pca9685_pwm_gpio_get() 159 struct pwm_device *pwm = &pca->chip.pwms[offset]; in pca9685_pwm_gpio_set() local [all …]
|
D | pwm-vt8500.c | 39 #define REG_CTRL(pwm) (((pwm) << 4) + 0x00) argument 40 #define REG_SCALAR(pwm) (((pwm) << 4) + 0x04) argument 41 #define REG_PERIOD(pwm) (((pwm) << 4) + 0x08) argument 42 #define REG_DUTY(pwm) (((pwm) << 4) + 0x0C) argument 80 static int vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in vt8500_pwm_config() argument 116 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config() 117 pwm_busy_wait(vt8500, pwm->hwpwm, STATUS_SCALAR_UPDATE); in vt8500_pwm_config() 119 writel(pv, vt8500->base + REG_PERIOD(pwm->hwpwm)); in vt8500_pwm_config() 120 pwm_busy_wait(vt8500, pwm->hwpwm, STATUS_PERIOD_UPDATE); in vt8500_pwm_config() 122 writel(dc, vt8500->base + REG_DUTY(pwm->hwpwm)); in vt8500_pwm_config() [all …]
|
D | pwm-twl-led.c | 69 static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, in twl4030_pwmled_config() argument 92 base = pwm->hwpwm * 2 + TWL4030_PWMA_REG; in twl4030_pwmled_config() 98 dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label); in twl4030_pwmled_config() 103 static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm) in twl4030_pwmled_enable() argument 112 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_enable() 116 val |= TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_enable() 120 dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label); in twl4030_pwmled_enable() 128 struct pwm_device *pwm) in twl4030_pwmled_disable() argument 137 dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label); in twl4030_pwmled_disable() 141 val &= ~TWL4030_LED_TOGGLE(pwm->hwpwm, TWL4030_LED_PINS); in twl4030_pwmled_disable() [all …]
|
D | pwm-hibvt.c | 80 static void hibvt_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in hibvt_pwm_enable() argument 84 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_enable() 88 static void hibvt_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in hibvt_pwm_disable() argument 92 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_disable() 96 static void hibvt_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in hibvt_pwm_config() argument 107 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG0_ADDR(pwm->hwpwm), in hibvt_pwm_config() 110 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG1_ADDR(pwm->hwpwm), in hibvt_pwm_config() 115 struct pwm_device *pwm, in hibvt_pwm_set_polarity() argument 121 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_set_polarity() 124 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() 166 struct pwm_device *pwm, int duty_ns) in lpc18xx_pwm_config_duty() argument 169 struct lpc18xx_pwm_data *lpc18xx_data = pwm_get_chip_data(pwm); in lpc18xx_pwm_config_duty() 184 static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in lpc18xx_pwm_config() argument 209 pwm->hwpwm); in lpc18xx_pwm_config() 224 lpc18xx_pwm_config_duty(chip, pwm, duty_ns); in lpc18xx_pwm_config() 230 struct pwm_device *pwm, in lpc18xx_pwm_set_polarity() argument 236 static int lpc18xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in lpc18xx_pwm_enable() argument [all …]
|
D | pwm-mediatek.c | 67 static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm) in mtk_pwm_clk_enable() argument 80 ret = clk_prepare_enable(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]); in mtk_pwm_clk_enable() 94 static void mtk_pwm_clk_disable(struct pwm_chip *chip, struct pwm_device *pwm) in mtk_pwm_clk_disable() argument 98 clk_disable_unprepare(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]); in mtk_pwm_clk_disable() 116 static int mtk_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in mtk_pwm_config() argument 120 struct clk *clk = pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]; in mtk_pwm_config() 124 ret = mtk_pwm_clk_enable(chip, pwm); in mtk_pwm_config() 136 mtk_pwm_clk_disable(chip, pwm); in mtk_pwm_config() 141 mtk_pwm_writel(pc, pwm->hwpwm, PWMCON, BIT(15) | clkdiv); in mtk_pwm_config() 142 mtk_pwm_writel(pc, pwm->hwpwm, PWMDWIDTH, period_ns / resolution); in mtk_pwm_config() [all …]
|
D | pwm-atmel-tcb.c | 53 struct pwm_device *pwm, in atmel_tcb_pwm_set_polarity() argument 56 struct atmel_tcb_pwm_device *tcbpwm = pwm_get_chip_data(pwm); in atmel_tcb_pwm_set_polarity() 64 struct pwm_device *pwm) in atmel_tcb_pwm_request() argument 70 unsigned group = pwm->hwpwm / 2; in atmel_tcb_pwm_request() 71 unsigned index = pwm->hwpwm % 2; in atmel_tcb_pwm_request() 85 pwm_set_chip_data(pwm, tcbpwm); in atmel_tcb_pwm_request() 116 tcbpwmc->pwms[pwm->hwpwm] = tcbpwm; in atmel_tcb_pwm_request() 121 static void atmel_tcb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in atmel_tcb_pwm_free() argument 124 struct atmel_tcb_pwm_device *tcbpwm = pwm_get_chip_data(pwm); in atmel_tcb_pwm_free() 127 clk_disable_unprepare(tc->clk[pwm->hwpwm / 2]); in atmel_tcb_pwm_free() [all …]
|
/drivers/clocksource/ |
D | samsung_pwm_timer.c | 83 static struct samsung_pwm_clocksource pwm; variable 96 reg = readl(pwm.base + REG_TCFG0); in samsung_timer_set_prescale() 99 writel(reg, pwm.base + REG_TCFG0); in samsung_timer_set_prescale() 111 bits = (fls(divisor) - 1) - pwm.variant.div_base; in samsung_timer_set_divisor() 115 reg = readl(pwm.base + REG_TCFG1); in samsung_timer_set_divisor() 118 writel(reg, pwm.base + REG_TCFG1); in samsung_timer_set_divisor() 133 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_stop() 135 writel_relaxed(tcon, pwm.base + REG_TCON); in samsung_time_stop() 151 tcon = readl_relaxed(pwm.base + REG_TCON); in samsung_time_setup() 156 writel_relaxed(tcnt, pwm.base + REG_TCNTB(channel)); in samsung_time_setup() [all …]
|
/drivers/input/keyboard/ |
D | lm8323.c | 159 struct lm8323_pwm pwm[LM8323_NUM_PWMS]; member 363 static void pwm_done(struct lm8323_pwm *pwm) in pwm_done() argument 365 mutex_lock(&pwm->lock); in pwm_done() 366 pwm->running = false; in pwm_done() 367 if (pwm->desired_brightness != pwm->brightness) in pwm_done() 368 schedule_work(&pwm->work); in pwm_done() 369 mutex_unlock(&pwm->lock); in pwm_done() 404 pwm_done(&lm->pwm[i]); in lm8323_irq() 428 static void lm8323_write_pwm_one(struct lm8323_pwm *pwm, int pos, u16 cmd) in lm8323_write_pwm_one() argument 430 lm8323_write(pwm->chip, 4, LM8323_CMD_PWM_WRITE, (pos << 2) | pwm->id, in lm8323_write_pwm_one() [all …]
|
/drivers/hwmon/ |
D | pwm-fan.c | 33 struct pwm_device *pwm; member 41 static int __set_pwm(struct pwm_fan_ctx *ctx, unsigned long pwm) in __set_pwm() argument 48 if (ctx->pwm_value == pwm) in __set_pwm() 51 pwm_init_state(ctx->pwm, &state); in __set_pwm() 52 period = ctx->pwm->args.period; in __set_pwm() 53 state.duty_cycle = DIV_ROUND_UP(pwm * (period - 1), MAX_PWM); in __set_pwm() 54 state.enabled = pwm ? true : false; in __set_pwm() 56 ret = pwm_apply_state(ctx->pwm, &state); in __set_pwm() 58 ctx->pwm_value = pwm; in __set_pwm() 64 static void pwm_fan_update_state(struct pwm_fan_ctx *ctx, unsigned long pwm) in pwm_fan_update_state() argument [all …]
|