/linux-6.3-rc2/drivers/pwm/ |
A D | pwm-vt8500.c | 108 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config() 111 writel(pv, vt8500->base + REG_PERIOD(pwm->hwpwm)); in vt8500_pwm_config() 114 writel(dc, vt8500->base + REG_DUTY(pwm->hwpwm)); in vt8500_pwm_config() 117 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_config() 119 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_config() 138 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_enable() 140 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_enable() 151 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_disable() 153 writel(val, vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_disable() 166 val = readl(vt8500->base + REG_CTRL(pwm->hwpwm)); in vt8500_pwm_set_polarity() [all …]
|
A D | pwm-jz4740.c | 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() 94 regmap_write(jz->map, TCU_REG_TESR, BIT(pwm->hwpwm)); in jz4740_pwm_enable() 107 regmap_write(jz->map, TCU_REG_TDHRc(pwm->hwpwm), 0xffff); in jz4740_pwm_disable() 108 regmap_write(jz->map, TCU_REG_TDFRc(pwm->hwpwm), 0x0); in jz4740_pwm_disable() 118 regmap_write(jz->map, TCU_REG_TECR, BIT(pwm->hwpwm)); in jz4740_pwm_disable() 176 regmap_write(jz4740->map, TCU_REG_TCNTc(pwm->hwpwm), 0); in jz4740_pwm_apply() 179 regmap_write(jz4740->map, TCU_REG_TDHRc(pwm->hwpwm), duty); in jz4740_pwm_apply() 185 regmap_set_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm), in jz4740_pwm_apply() 202 regmap_update_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm), in jz4740_pwm_apply() [all …]
|
A D | pwm-sunplus.c | 68 mode0 &= ~SP7021_PWM_MODE0_PWMEN(pwm->hwpwm); in sunplus_pwm_apply() 72 mode1 &= ~SP7021_PWM_MODE1_CNT_EN(pwm->hwpwm); in sunplus_pwm_apply() 100 writel(dd_freq, priv->base + SP7021_PWM_FREQ(pwm->hwpwm)); in sunplus_pwm_apply() 104 mode0 |= SP7021_PWM_MODE0_PWMEN(pwm->hwpwm); in sunplus_pwm_apply() 106 mode1 |= SP7021_PWM_MODE1_CNT_EN(pwm->hwpwm); in sunplus_pwm_apply() 109 mode0 |= SP7021_PWM_MODE0_BYPASS(pwm->hwpwm); in sunplus_pwm_apply() 112 mode0 &= ~SP7021_PWM_MODE0_BYPASS(pwm->hwpwm); in sunplus_pwm_apply() 118 duty = SP7021_PWM_DUTY_DD_SEL(pwm->hwpwm) | duty; in sunplus_pwm_apply() 120 writel(duty, priv->base + SP7021_PWM_DUTY(pwm->hwpwm)); in sunplus_pwm_apply() 136 if (mode0 & BIT(pwm->hwpwm)) { in sunplus_pwm_get_state() [all …]
|
A D | pwm-sun4i.c | 131 if ((val & BIT_CH(PWM_BYPASS, pwm->hwpwm)) && in sun4i_pwm_get_state() 149 if (val & BIT_CH(PWM_ACT_STATE, pwm->hwpwm)) in sun4i_pwm_get_state() 268 ctrl |= BIT_CH(PWM_BYPASS, pwm->hwpwm); in sun4i_pwm_apply() 275 ctrl &= ~BIT_CH(PWM_BYPASS, pwm->hwpwm); in sun4i_pwm_apply() 284 ctrl |= BIT_CH(prescaler, pwm->hwpwm); in sun4i_pwm_apply() 291 ctrl &= ~BIT_CH(PWM_ACT_STATE, pwm->hwpwm); in sun4i_pwm_apply() 293 ctrl |= BIT_CH(PWM_ACT_STATE, pwm->hwpwm); in sun4i_pwm_apply() 295 ctrl |= BIT_CH(PWM_CLK_GATING, pwm->hwpwm); in sun4i_pwm_apply() 298 ctrl |= BIT_CH(PWM_EN, pwm->hwpwm); in sun4i_pwm_apply() 316 ctrl &= ~BIT_CH(PWM_CLK_GATING, pwm->hwpwm); in sun4i_pwm_apply() [all …]
|
A D | pwm-atmel.c | 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() 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() 276 atmel_pwm_wait_nonpending(atmel_pwm, pwm->hwpwm); in atmel_pwm_disable() 278 atmel_pwm_writel(atmel_pwm, PWM_DIS, 1 << pwm->hwpwm); in atmel_pwm_disable() 313 cprd = atmel_pwm_ch_readl(atmel_pwm, pwm->hwpwm, in atmel_pwm_apply() 368 if (sr & (1 << pwm->hwpwm)) { in atmel_pwm_get_state() 375 cprd = atmel_pwm_ch_readl(atmel_pwm, pwm->hwpwm, in atmel_pwm_get_state() 382 atmel_pwm_wait_nonpending(atmel_pwm, pwm->hwpwm); in atmel_pwm_get_state() [all …]
|
A D | pwm-sprd.c | 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() 123 struct sprd_pwm_chn *chn = &spc->chn[pwm->hwpwm]; in sprd_pwm_config() 155 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_DUTY, duty); in sprd_pwm_config() 165 struct sprd_pwm_chn *chn = &spc->chn[pwm->hwpwm]; in sprd_pwm_apply() 183 pwm->hwpwm); in sprd_pwm_apply() 193 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_ENABLE, 1); in sprd_pwm_apply() [all …]
|
A D | pwm-bcm-iproc.c | 80 if (value & BIT(IPROC_PWM_CTRL_EN_SHIFT(pwm->hwpwm))) in iproc_pwmc_get_state() 85 if (value & BIT(IPROC_PWM_CTRL_POLARITY_SHIFT(pwm->hwpwm))) in iproc_pwmc_get_state() 98 prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_get_state() 103 value = readl(ip->base + IPROC_PWM_PERIOD_OFFSET(pwm->hwpwm)); in iproc_pwmc_get_state() 155 iproc_pwmc_disable(ip, pwm->hwpwm); in iproc_pwmc_apply() 159 value &= ~IPROC_PWM_PRESCALE_MASK(pwm->hwpwm); in iproc_pwmc_apply() 160 value |= prescale << IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_apply() 164 writel(period, ip->base + IPROC_PWM_PERIOD_OFFSET(pwm->hwpwm)); in iproc_pwmc_apply() 171 value |= 1 << IPROC_PWM_CTRL_POLARITY_SHIFT(pwm->hwpwm); in iproc_pwmc_apply() 173 value &= ~(1 << IPROC_PWM_CTRL_POLARITY_SHIFT(pwm->hwpwm)); in iproc_pwmc_apply() [all …]
|
A D | pwm-stmpe.c | 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() 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() 117 pin = pwm->hwpwm; in stmpe_24xx_pwm_config() 128 pwm->hwpwm); in stmpe_24xx_pwm_config() 134 switch (pwm->hwpwm) { in stmpe_24xx_pwm_config() 153 pwm->hwpwm, duty_ns, period_ns); in stmpe_24xx_pwm_config() [all …]
|
A D | pwm-bcm2835.c | 44 value &= ~(PWM_CONTROL_MASK << PWM_CONTROL_SHIFT(pwm->hwpwm)); in bcm2835_pwm_request() 45 value |= (PWM_MODE << PWM_CONTROL_SHIFT(pwm->hwpwm)); in bcm2835_pwm_request() 57 value &= ~(PWM_CONTROL_MASK << PWM_CONTROL_SHIFT(pwm->hwpwm)); in bcm2835_pwm_free() 103 writel(period_cycles, pc->base + PERIOD(pwm->hwpwm)); in bcm2835_pwm_apply() 107 writel(val, pc->base + DUTY(pwm->hwpwm)); in bcm2835_pwm_apply() 113 val &= ~(PWM_POLARITY << PWM_CONTROL_SHIFT(pwm->hwpwm)); in bcm2835_pwm_apply() 115 val |= PWM_POLARITY << PWM_CONTROL_SHIFT(pwm->hwpwm); in bcm2835_pwm_apply() 119 val |= PWM_ENABLE << PWM_CONTROL_SHIFT(pwm->hwpwm); in bcm2835_pwm_apply() 121 val &= ~(PWM_ENABLE << PWM_CONTROL_SHIFT(pwm->hwpwm)); in bcm2835_pwm_apply()
|
A D | pwm-lpc32xx.c | 54 val = readl(lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_config() 57 writel(val, lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_config() 72 val = readl(lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_enable() 74 writel(val, lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_enable() 84 val = readl(lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_disable() 86 writel(val, lpc32xx->base + (pwm->hwpwm << 2)); in lpc32xx_pwm_disable() 144 val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2)); in lpc32xx_pwm_probe() 146 writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2)); in lpc32xx_pwm_probe()
|
A D | pwm-twl.c | 83 base = pwm->hwpwm * 3; in twl_pwm_config() 107 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMXCLK_ENABLE); in twl4030_pwm_enable() 113 val |= TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMX_ENABLE); in twl4030_pwm_enable() 137 val &= ~TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMX_ENABLE); in twl4030_pwm_disable() 143 val &= ~TWL4030_PWM_TOGGLE(pwm->hwpwm, TWL4030_PWMXCLK_ENABLE); in twl4030_pwm_disable() 159 if (pwm->hwpwm == 1) { in twl4030_pwm_request() 197 if (pwm->hwpwm == 1) in twl4030_pwm_free() 230 val &= ~TWL6030_PWM_TOGGLE(pwm->hwpwm, TWL6030_PWMXR); in twl6030_pwm_enable() 252 val |= TWL6030_PWM_TOGGLE(pwm->hwpwm, TWL6030_PWMXR); in twl6030_pwm_disable() 261 val |= TWL6030_PWM_TOGGLE(pwm->hwpwm, TWL6030_PWMXEN); in twl6030_pwm_disable() [all …]
|
A D | pwm-visconti.c | 53 writel(0, priv->base + PIPGM_PCSR(pwm->hwpwm)); in visconti_pwm_apply() 99 writel(pwmc0, priv->base + PIPGM_PWMC(pwm->hwpwm)); in visconti_pwm_apply() 100 writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); in visconti_pwm_apply() 101 writel(period, priv->base + PIPGM_PCSR(pwm->hwpwm)); in visconti_pwm_apply() 112 period = readl(priv->base + PIPGM_PCSR(pwm->hwpwm)); in visconti_pwm_get_state() 113 duty = readl(priv->base + PIPGM_PDUT(pwm->hwpwm)); in visconti_pwm_get_state() 114 pwmc0 = readl(priv->base + PIPGM_PWMC(pwm->hwpwm)); in visconti_pwm_get_state()
|
A D | pwm-berlin.c | 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() 135 value = berlin_pwm_readl(bpc, pwm->hwpwm, BERLIN_PWM_CONTROL); in berlin_pwm_set_polarity() 142 berlin_pwm_writel(bpc, pwm->hwpwm, value, BERLIN_PWM_CONTROL); in berlin_pwm_set_polarity() 152 value = berlin_pwm_readl(bpc, pwm->hwpwm, BERLIN_PWM_EN); in berlin_pwm_enable() 154 berlin_pwm_writel(bpc, pwm->hwpwm, value, BERLIN_PWM_EN); in berlin_pwm_enable() 165 value = berlin_pwm_readl(bpc, pwm->hwpwm, BERLIN_PWM_EN); in berlin_pwm_disable() 167 berlin_pwm_writel(bpc, pwm->hwpwm, value, BERLIN_PWM_EN); in berlin_pwm_disable()
|
A D | pwm-dwc.c | 116 __dwc_pwm_set_enable(dwc, pwm->hwpwm, false); in __dwc_pwm_configure_timer() 124 dwc_pwm_writel(dwc, low, DWC_TIM_LD_CNT(pwm->hwpwm)); in __dwc_pwm_configure_timer() 125 dwc_pwm_writel(dwc, high, DWC_TIM_LD_CNT2(pwm->hwpwm)); in __dwc_pwm_configure_timer() 134 dwc_pwm_writel(dwc, ctrl, DWC_TIM_CTRL(pwm->hwpwm)); in __dwc_pwm_configure_timer() 139 __dwc_pwm_set_enable(dwc, pwm->hwpwm, state->enabled); in __dwc_pwm_configure_timer() 158 __dwc_pwm_set_enable(dwc, pwm->hwpwm, false); in dwc_pwm_apply() 175 DWC_TIM_CTRL(pwm->hwpwm)) & DWC_TIM_CTRL_EN); in dwc_pwm_get_state() 177 duty = dwc_pwm_readl(dwc, DWC_TIM_LD_CNT(pwm->hwpwm)); in dwc_pwm_get_state() 182 period = dwc_pwm_readl(dwc, DWC_TIM_LD_CNT2(pwm->hwpwm)); in dwc_pwm_get_state()
|
A D | pwm-hibvt.c | 87 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_enable() 95 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_disable() 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() 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() 141 value = readl(base + PWM_CFG0_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state() 144 value = readl(base + PWM_CFG1_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state() 147 value = readl(base + PWM_CTRL_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state()
|
A D | pwm-lpc18xx-sct.c | 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() 174 struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm]; in lpc18xx_pwm_config_duty() 217 pwm->hwpwm); in lpc18xx_pwm_config() 240 struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm]; in lpc18xx_pwm_enable() 263 lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_OUTPUTSET(pwm->hwpwm), in lpc18xx_pwm_enable() 265 lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_OUTPUTCL(pwm->hwpwm), in lpc18xx_pwm_enable() 275 struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm]; in lpc18xx_pwm_disable() 279 lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_OUTPUTSET(pwm->hwpwm), 0); in lpc18xx_pwm_disable() 280 lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_OUTPUTCL(pwm->hwpwm), 0); in lpc18xx_pwm_disable() [all …]
|
A D | pwm-mediatek.c | 86 ret = clk_prepare_enable(pc->clk_pwms[pwm->hwpwm]); in pwm_mediatek_clk_enable() 105 clk_disable_unprepare(pc->clk_pwms[pwm->hwpwm]); in pwm_mediatek_clk_disable() 137 do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm])); 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() 164 pwm_mediatek_writel(pc, pwm->hwpwm, reg_width, cnt_period); in pwm_mediatek_config() 165 pwm_mediatek_writel(pc, pwm->hwpwm, reg_thres, cnt_duty); in pwm_mediatek_config() 183 value |= BIT(pwm->hwpwm); in pwm_mediatek_enable() 195 value &= ~BIT(pwm->hwpwm); in pwm_mediatek_disable()
|
A D | pwm-spear.c | 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() 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() 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()
|
A D | pwm-samsung.c | 123 unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm); in __pwm_samsung_manual_update() 236 pwm->hwpwm); in pwm_samsung_request() 257 unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm); in pwm_samsung_enable() 273 our_chip->disabled_mask &= ~BIT(pwm->hwpwm); in pwm_samsung_enable() 283 unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm); in pwm_samsung_disable() 300 our_chip->disabled_mask |= BIT(pwm->hwpwm); in pwm_samsung_disable() 324 tcnt = readl(our_chip->base + REG_TCNTB(pwm->hwpwm)); in __pwm_samsung_config() 325 oldtcmp = readl(our_chip->base + REG_TCMPB(pwm->hwpwm)); in __pwm_samsung_config() 370 writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm)); in __pwm_samsung_config() 371 writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm)); in __pwm_samsung_config() [all …]
|
A D | pwm-sti.c | 191 ((ncfg == 1) && (pwm->hwpwm == cur->hwpwm)) || in sti_pwm_config() 192 ((ncfg == 1) && (pwm->hwpwm != cur->hwpwm) && period_same) || in sti_pwm_config() 229 ret = regmap_write(pc->regmap, PWM_OUT_VAL(pwm->hwpwm), value); in sti_pwm_config() 235 set_bit(pwm->hwpwm, &pc->configured); in sti_pwm_config() 274 pwm->hwpwm, ret); in sti_pwm_enable() 309 clear_bit(pwm->hwpwm, &pc->configured); in sti_pwm_free() 323 if (pwm->hwpwm >= cdata->cpt_num_devs) { in sti_pwm_capture() 324 dev_err(dev, "device %u is not valid\n", pwm->hwpwm); in sti_pwm_capture() 332 regmap_write(pc->regmap, PWM_CPT_EDGE(pwm->hwpwm), CPT_EDGE_RISING); in sti_pwm_capture() 333 regmap_field_write(pc->pwm_cpt_int_en, BIT(pwm->hwpwm)); in sti_pwm_capture() [all …]
|
A D | pwm-pca9685.c | 381 pca9685_pwm_set_duty(pca, pwm->hwpwm, 0); in __pca9685_pwm_apply() 411 pca9685_pwm_set_duty(pca, pwm->hwpwm, duty); in __pca9685_pwm_apply() 425 set_bit(pwm->hwpwm, pca->pwms_enabled); in pca9685_pwm_apply() 427 clear_bit(pwm->hwpwm, pca->pwms_enabled); in pca9685_pwm_apply() 454 if (pwm->hwpwm >= PCA9685_MAXCHAN) { in pca9685_pwm_get_state() 465 duty = pca9685_pwm_get_duty(pca, pwm->hwpwm); in pca9685_pwm_get_state() 478 if (pwm->hwpwm < PCA9685_MAXCHAN) { in pca9685_pwm_request() 481 set_bit(pwm->hwpwm, pca->pwms_enabled); in pca9685_pwm_request() 495 pca9685_pwm_set_duty(pca, pwm->hwpwm, 0); in pca9685_pwm_free() 496 clear_bit(pwm->hwpwm, pca->pwms_enabled); in pca9685_pwm_free() [all …]
|
A D | pwm-atmel-tcb.c | 76 struct atmel_tcb_pwm_device *tcbpwm = tcbpwmc->pwms[pwm->hwpwm]; in atmel_tcb_pwm_set_polarity() 113 if (pwm->hwpwm == 0) in atmel_tcb_pwm_request() 134 tcbpwmc->pwms[pwm->hwpwm] = tcbpwm; in atmel_tcb_pwm_request() 142 struct atmel_tcb_pwm_device *tcbpwm = tcbpwmc->pwms[pwm->hwpwm]; in atmel_tcb_pwm_free() 145 tcbpwmc->pwms[pwm->hwpwm] = NULL; in atmel_tcb_pwm_free() 152 struct atmel_tcb_pwm_device *tcbpwm = tcbpwmc->pwms[pwm->hwpwm]; in atmel_tcb_pwm_disable() 171 if (pwm->hwpwm == 0) { in atmel_tcb_pwm_disable() 230 if (pwm->hwpwm == 0) { in atmel_tcb_pwm_enable() 253 if (pwm->hwpwm == 0) { in atmel_tcb_pwm_enable() 270 if (pwm->hwpwm == 0) in atmel_tcb_pwm_enable() [all …]
|
A D | sysfs.c | 263 dev_set_name(&export->child, "pwm%u", pwm->hwpwm); in pwm_export_child() 272 pwm_prop[0] = kasprintf(GFP_KERNEL, "EXPORT=pwm%u", pwm->hwpwm); in pwm_export_child() 297 pwm_prop[0] = kasprintf(GFP_KERNEL, "UNEXPORT=pwm%u", pwm->hwpwm); in pwm_unexport_child() 316 unsigned int hwpwm; in export_store() local 319 ret = kstrtouint(buf, 0, &hwpwm); in export_store() 323 if (hwpwm >= chip->npwm) in export_store() 326 pwm = pwm_request_from_chip(chip, hwpwm, "sysfs"); in export_store() 343 unsigned int hwpwm; in unexport_store() local 346 ret = kstrtouint(buf, 0, &hwpwm); in unexport_store() 350 if (hwpwm >= chip->npwm) in unexport_store() [all …]
|
A D | pwm-keembay.c | 103 highlow = readl(priv->base + KMB_PWM_LEADIN_OFFSET(pwm->hwpwm)); in keembay_pwm_get_state() 110 highlow = readl(priv->base + KMB_PWM_HIGHLOW_OFFSET(pwm->hwpwm)); in keembay_pwm_get_state() 138 KMB_PWM_LEADIN_OFFSET(pwm->hwpwm)); in keembay_pwm_apply() 144 keembay_pwm_disable(priv, pwm->hwpwm); in keembay_pwm_apply() 172 writel(pwm_count, priv->base + KMB_PWM_HIGHLOW_OFFSET(pwm->hwpwm)); in keembay_pwm_apply() 175 keembay_pwm_enable(priv, pwm->hwpwm); in keembay_pwm_apply()
|
A D | pwm-stm32.c | 123 ccen = pwm->hwpwm < 2 ? TIM_CCER_CC12E : TIM_CCER_CC34E; in stm32_pwm_raw_capture() 124 ccr = pwm->hwpwm < 2 ? TIM_CCR1 : TIM_CCR3; in stm32_pwm_raw_capture() 212 pwm->hwpwm < 2 ? TIM_CCMR1 : TIM_CCMR2, in stm32_pwm_capture() 213 TIM_CCMR_CC1S | TIM_CCMR_CC2S, pwm->hwpwm & 0x1 ? in stm32_pwm_capture() 218 regmap_update_bits(priv->regmap, TIM_CCER, pwm->hwpwm < 2 ? in stm32_pwm_capture() 219 TIM_CCER_CC12P : TIM_CCER_CC34P, pwm->hwpwm < 2 ? in stm32_pwm_capture() 266 pwm->hwpwm < 2 ? TIM_CCMR1 : TIM_CCMR2, in stm32_pwm_capture() 453 stm32_pwm_disable(priv, pwm->hwpwm); in stm32_pwm_apply() 458 stm32_pwm_set_polarity(priv, pwm->hwpwm, state->polarity); in stm32_pwm_apply() 460 ret = stm32_pwm_config(priv, pwm->hwpwm, in stm32_pwm_apply() [all …]
|