/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 | 3 obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o 4 obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o 5 obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o 6 obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o 7 obj-$(CONFIG_PWM_BCM_IPROC) += pwm-bcm-iproc.o 8 obj-$(CONFIG_PWM_BCM_KONA) += pwm-bcm-kona.o 9 obj-$(CONFIG_PWM_BCM2835) += pwm-bcm2835.o 10 obj-$(CONFIG_PWM_BERLIN) += pwm-berlin.o 11 obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o 12 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() 81 pwm_set_chip_data(pwm, NULL); in berlin_pwm_free() 88 struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip); in berlin_pwm_config() local 93 cycles = clk_get_rate(pwm->clk); in berlin_pwm_config() 113 value = berlin_pwm_readl(pwm, pwm_dev->hwpwm, BERLIN_PWM_CONTROL); in berlin_pwm_config() 116 berlin_pwm_writel(pwm, pwm_dev->hwpwm, value, BERLIN_PWM_CONTROL); in berlin_pwm_config() 118 berlin_pwm_writel(pwm, pwm_dev->hwpwm, duty, BERLIN_PWM_DUTY); in berlin_pwm_config() [all …]
|
D | pwm-tegra.c | 73 static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in tegra_pwm_config() argument 126 if (!pwm_is_enabled(pwm)) { in tegra_pwm_config() 133 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_config() 138 if (!pwm_is_enabled(pwm)) in tegra_pwm_config() 144 static int tegra_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_enable() argument 154 val = pwm_readl(pc, pwm->hwpwm); in tegra_pwm_enable() 156 pwm_writel(pc, pwm->hwpwm, val); in tegra_pwm_enable() 161 static void tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in tegra_pwm_disable() argument 166 val = pwm_readl(pc, pwm->hwpwm); in tegra_pwm_disable() 168 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 | 99 static int sun4i_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in sun4i_pwm_config() argument 157 if (sun4i_pwm->data->has_rdy && (val & PWM_RDY(pwm->hwpwm))) { in sun4i_pwm_config() 163 clk_gate = val & BIT_CH(PWM_CLK_GATING, pwm->hwpwm); in sun4i_pwm_config() 165 val &= ~BIT_CH(PWM_CLK_GATING, pwm->hwpwm); in sun4i_pwm_config() 170 val &= ~BIT_CH(PWM_PRESCAL_MASK, pwm->hwpwm); in sun4i_pwm_config() 171 val |= BIT_CH(prescaler, pwm->hwpwm); in sun4i_pwm_config() 175 sun4i_pwm_writel(sun4i_pwm, val, PWM_CH_PRD(pwm->hwpwm)); in sun4i_pwm_config() 189 static int sun4i_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, in sun4i_pwm_set_polarity() argument 206 val &= ~BIT_CH(PWM_ACT_STATE, pwm->hwpwm); in sun4i_pwm_set_polarity() 208 val |= BIT_CH(PWM_ACT_STATE, pwm->hwpwm); in sun4i_pwm_set_polarity() [all …]
|
D | pwm-jz4740.c | 50 static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_request() argument 52 unsigned int gpio = jz4740_pwm_gpio_list[pwm->hwpwm]; in jz4740_pwm_request() 59 if (pwm->hwpwm < 2) in jz4740_pwm_request() 62 ret = gpio_request(gpio, pwm->label); in jz4740_pwm_request() 71 jz4740_timer_start(pwm->hwpwm); in jz4740_pwm_request() 76 static void jz4740_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_free() argument 78 unsigned int gpio = jz4740_pwm_gpio_list[pwm->hwpwm]; in jz4740_pwm_free() 80 jz4740_timer_set_ctrl(pwm->hwpwm, 0); in jz4740_pwm_free() 85 jz4740_timer_stop(pwm->hwpwm); in jz4740_pwm_free() 88 static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) in jz4740_pwm_enable() argument [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-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-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-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-lpss.c | 69 static inline u32 pwm_lpss_read(const struct pwm_device *pwm) in pwm_lpss_read() argument 71 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_read() 73 return readl(lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_read() 76 static inline void pwm_lpss_write(const struct pwm_device *pwm, u32 value) in pwm_lpss_write() argument 78 struct pwm_lpss_chip *lpwm = to_lpwm(pwm->chip); in pwm_lpss_write() 80 writel(value, lpwm->regs + pwm->hwpwm * PWM_SIZE + PWM); in pwm_lpss_write() 83 static void pwm_lpss_update(struct pwm_device *pwm) in pwm_lpss_update() argument 85 pwm_lpss_write(pwm, pwm_lpss_read(pwm) | PWM_SW_UPDATE); in pwm_lpss_update() 90 static int pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm, in pwm_lpss_config() argument 118 ctrl = pwm_lpss_read(pwm); in pwm_lpss_config() [all …]
|
D | pwm-pca9685.c | 90 static int pca9685_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in pca9685_pwm_config() argument 129 if (pwm->hwpwm >= PCA9685_MAXCHAN) in pca9685_pwm_config() 132 reg = LED_N_OFF_H(pwm->hwpwm); in pca9685_pwm_config() 141 if (pwm->hwpwm >= PCA9685_MAXCHAN) in pca9685_pwm_config() 144 reg = LED_N_OFF_L(pwm->hwpwm); in pca9685_pwm_config() 148 if (pwm->hwpwm >= PCA9685_MAXCHAN) in pca9685_pwm_config() 151 reg = LED_N_OFF_H(pwm->hwpwm); in pca9685_pwm_config() 156 if (pwm->hwpwm >= PCA9685_MAXCHAN) in pca9685_pwm_config() 159 reg = LED_N_ON_H(pwm->hwpwm); in pca9685_pwm_config() 169 if (pwm->hwpwm >= PCA9685_MAXCHAN) in pca9685_pwm_config() [all …]
|
D | pwm-atmel.c | 70 void (*config)(struct pwm_chip *chip, struct pwm_device *pwm, 108 static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in atmel_pwm_config() argument 118 if (pwm_is_enabled(pwm) && (period_ns != pwm_get_period(pwm))) { in atmel_pwm_config() 150 val = atmel_pwm_ch_readl(atmel_pwm, pwm->hwpwm, PWM_CMR); in atmel_pwm_config() 152 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, PWM_CMR, val); in atmel_pwm_config() 153 atmel_pwm->config(chip, pwm, dty, prd); in atmel_pwm_config() 156 atmel_pwm->updated_pwms &= ~(1 << pwm->hwpwm); in atmel_pwm_config() 163 static void atmel_pwm_config_v1(struct pwm_chip *chip, struct pwm_device *pwm, in atmel_pwm_config_v1() argument 170 atmel_pwm_ch_writel(atmel_pwm, pwm->hwpwm, PWMV1_CUPD, dty); in atmel_pwm_config_v1() 172 val = atmel_pwm_ch_readl(atmel_pwm, pwm->hwpwm, PWM_CMR); in atmel_pwm_config_v1() [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-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-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 47 pwm_get_args(ctx->pwm, &pargs); in __set_pwm() 50 if (ctx->pwm_value == pwm) in __set_pwm() 53 duty = DIV_ROUND_UP(pwm * (pargs.period - 1), MAX_PWM); in __set_pwm() 54 ret = pwm_config(ctx->pwm, duty, pargs.period); in __set_pwm() 58 if (pwm == 0) in __set_pwm() 59 pwm_disable(ctx->pwm); in __set_pwm() 62 ret = pwm_enable(ctx->pwm); in __set_pwm() 67 ctx->pwm_value = pwm; in __set_pwm() [all …]
|
/drivers/staging/greybus/ |
D | pwm.c | 23 struct pwm_chip *pwm; member 191 static int gb_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) in gb_pwm_request() argument 195 return gb_pwm_activate_operation(pwmc, pwm->hwpwm); in gb_pwm_request() 198 static void gb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) in gb_pwm_free() argument 202 if (pwm_is_enabled(pwm)) in gb_pwm_free() 205 gb_pwm_deactivate_operation(pwmc, pwm->hwpwm); in gb_pwm_free() 208 static int gb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in gb_pwm_config() argument 213 return gb_pwm_config_operation(pwmc, pwm->hwpwm, duty_ns, period_ns); in gb_pwm_config() 216 static int gb_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, in gb_pwm_set_polarity() argument 221 return gb_pwm_set_polarity_operation(pwmc, pwm->hwpwm, polarity); in gb_pwm_set_polarity() [all …]
|