/linux/drivers/pwm/ |
A D | pwm-raspberrypi-poe.c | 31 unsigned int duty_cycle; member 92 state->duty_cycle = DIV_ROUND_UP(rpipwm->duty_cycle * RPI_PWM_PERIOD_NS, in raspberrypi_pwm_get_state() 94 state->enabled = !!(rpipwm->duty_cycle); in raspberrypi_pwm_get_state() 102 unsigned int duty_cycle; in raspberrypi_pwm_apply() local 110 duty_cycle = 0; in raspberrypi_pwm_apply() 112 duty_cycle = DIV_ROUND_DOWN_ULL(state->duty_cycle * RPI_PWM_MAX_DUTY, in raspberrypi_pwm_apply() 115 duty_cycle = RPI_PWM_MAX_DUTY; in raspberrypi_pwm_apply() 117 if (duty_cycle == rpipwm->duty_cycle) in raspberrypi_pwm_apply() 121 duty_cycle); in raspberrypi_pwm_apply() 128 rpipwm->duty_cycle = duty_cycle; in raspberrypi_pwm_apply() [all …]
|
A D | core.c | 454 s2.duty_cycle = s1.period - s1.duty_cycle; in pwm_apply_state_debug() 481 last->duty_cycle > s2.duty_cycle && in pwm_apply_state_debug() 482 last->duty_cycle <= state->duty_cycle) in pwm_apply_state_debug() 489 if (state->enabled && state->duty_cycle < s2.duty_cycle) in pwm_apply_state_debug() 516 (s1.enabled && s1.duty_cycle != last->duty_cycle)) { in pwm_apply_state_debug() 551 state->duty_cycle == pwm->state.duty_cycle && in pwm_apply_state() 598 state->duty_cycle != pwm->state.duty_cycle) { in pwm_apply_state() 600 state->duty_cycle, in pwm_apply_state() 605 pwm->state.duty_cycle = state->duty_cycle; in pwm_apply_state() 678 state.duty_cycle = 0; in pwm_adjust_config() [all …]
|
A D | pwm-visconti.c | 50 u32 period, duty_cycle, pwmc0; in visconti_pwm_apply() local 68 if (state->duty_cycle > period) in visconti_pwm_apply() 69 duty_cycle = period; in visconti_pwm_apply() 71 duty_cycle = state->duty_cycle; in visconti_pwm_apply() 79 duty_cycle /= 1000; in visconti_pwm_apply() 95 duty_cycle >>= pwmc0; in visconti_pwm_apply() 100 writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); in visconti_pwm_apply() 118 state->duty_cycle = (duty << pwmc0_clk) * NSEC_PER_USEC; in visconti_pwm_get_state()
|
A D | pwm-cros-ec.c | 33 u16 duty_cycle; member 120 u16 duty_cycle; in cros_ec_pwm_apply() local 134 duty_cycle = state->enabled ? state->duty_cycle : 0; in cros_ec_pwm_apply() 136 ret = cros_ec_pwm_set_duty(ec_pwm->ec, pwm->hwpwm, duty_cycle); in cros_ec_pwm_apply() 140 channel->duty_cycle = state->duty_cycle; in cros_ec_pwm_apply() 170 if (ret == 0 && channel->duty_cycle > 0) in cros_ec_pwm_get_state() 171 state->duty_cycle = channel->duty_cycle; in cros_ec_pwm_get_state() 173 state->duty_cycle = ret; in cros_ec_pwm_get_state()
|
A D | pwm-twl-led.c | 61 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config() local 76 if (duty_cycle == 1) in twl4030_pwmled_config() 77 duty_cycle = 2; in twl4030_pwmled_config() 78 else if (duty_cycle > TWL4030_LED_MAX) in twl4030_pwmled_config() 79 duty_cycle = 1; in twl4030_pwmled_config() 83 pwm_config[1] = duty_cycle; in twl4030_pwmled_config() 143 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config() local 147 on_time = duty_cycle & 0xff; in twl6030_pwmled_config()
|
A D | pwm-sl28cpld.c | 74 #define SL28CPLD_PWM_FROM_DUTY_CYCLE(duty_cycle) \ argument 75 (DIV_ROUND_DOWN_ULL((duty_cycle), NSEC_PER_SEC / SL28CPLD_PWM_CLK)) 106 state->duty_cycle = SL28CPLD_PWM_TO_DUTY_CYCLE(reg); in sl28cpld_pwm_get_state() 117 state->duty_cycle = min(state->duty_cycle, state->period); in sl28cpld_pwm_get_state() 147 cycle = SL28CPLD_PWM_FROM_DUTY_CYCLE(state->duty_cycle); in sl28cpld_pwm_apply()
|
A D | pwm-iqs620a.c | 66 unsigned int duty_cycle; in iqs620_pwm_apply() local 90 duty_cycle = min_t(u64, state->duty_cycle, IQS620_PWM_PERIOD_NS); in iqs620_pwm_apply() 91 duty_scale = duty_cycle * 256 / IQS620_PWM_PERIOD_NS; in iqs620_pwm_apply() 123 state->duty_cycle = DIV_ROUND_UP(iqs620_pwm->duty_scale * in iqs620_pwm_get_state()
|
A D | pwm-intel-lgm.c | 68 u32 duty_cycle, val; in lgm_pwm_apply() local 78 duty_cycle = min_t(u64, state->duty_cycle, pc->period); in lgm_pwm_apply() 79 val = duty_cycle * LGM_PWM_MAX_DUTY_CYCLE / pc->period; in lgm_pwm_apply() 102 state->duty_cycle = DIV_ROUND_UP(duty * pc->period, LGM_PWM_MAX_DUTY_CYCLE); in lgm_pwm_get_state()
|
A D | pwm-sifive.c | 125 state->duty_cycle = in pwm_sifive_get_state() 154 unsigned int duty_cycle; in pwm_sifive_apply() local 173 duty_cycle = state->duty_cycle; in pwm_sifive_apply() 175 duty_cycle = 0; in pwm_sifive_apply() 183 num = (u64)duty_cycle * (1U << PWM_SIFIVE_CMPWIDTH); in pwm_sifive_apply()
|
A D | pwm-imx-tpm.c | 122 real_state->duty_cycle = 0; in pwm_imx_tpm_round_state() 124 real_state->duty_cycle = state->duty_cycle; in pwm_imx_tpm_round_state() 126 tmp = (u64)p->mod * real_state->duty_cycle; in pwm_imx_tpm_round_state() 152 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_get_state() 222 if (state->duty_cycle != c.duty_cycle) { in pwm_imx_tpm_apply_hw()
|
A D | pwm-twl.c | 63 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL_PWM_MAX, period_ns) + 1; in twl_pwm_config() local 78 if (duty_cycle == 1) in twl_pwm_config() 79 duty_cycle = 2; in twl_pwm_config() 80 else if (duty_cycle > TWL_PWM_MAX) in twl_pwm_config() 81 duty_cycle = 1; in twl_pwm_config() 85 pwm_config[1] = duty_cycle; in twl_pwm_config()
|
A D | pwm-imx27.c | 93 unsigned int duty_cycle; member 167 val = imx->duty_cycle; in pwm_imx27_get_state() 170 state->duty_cycle = DIV_ROUND_UP_ULL(tmp, pwm_clk); in pwm_imx27_get_state() 237 c = clkrate * state->duty_cycle; in pwm_imx27_apply() 272 imx->duty_cycle = duty_cycles; in pwm_imx27_apply()
|
A D | pwm-crc.c | 77 if (pwm_get_duty_cycle(pwm) != state->duty_cycle || in crc_pwm_apply() 79 u64 level = state->duty_cycle * PWM_MAX_LEVEL; in crc_pwm_apply() 148 state->duty_cycle = in crc_pwm_get_state()
|
A D | pwm-hibvt.c | 145 state->duty_cycle = div_u64(value * 1000, freq); in hibvt_pwm_get_state() 160 state->duty_cycle != pwm->state.duty_cycle) { in hibvt_pwm_apply() 161 hibvt_pwm_config(chip, pwm, state->duty_cycle, state->period); in hibvt_pwm_apply()
|
/linux/include/linux/ |
A D | pwm.h | 64 u64 duty_cycle; member 138 pwm->state.duty_cycle = duty; in pwm_set_duty_cycle() 147 return state.duty_cycle; in pwm_get_duty_cycle() 195 state->duty_cycle = 0; in pwm_init_state() 218 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle() 241 pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, in pwm_set_relative_duty_cycle() argument 244 if (!scale || duty_cycle > scale) in pwm_set_relative_duty_cycle() 247 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle() 322 unsigned int duty_cycle; member 352 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config() [all …]
|
/linux/drivers/media/rc/ |
A D | pwm-ir-tx.c | 21 unsigned int duty_cycle; member 30 static int pwm_ir_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in pwm_ir_set_duty_cycle() argument 34 pwm_ir->duty_cycle = duty_cycle; in pwm_ir_set_duty_cycle() 61 duty = DIV_ROUND_CLOSEST(pwm_ir->duty_cycle * period, 100); in pwm_ir_tx() 99 pwm_ir->duty_cycle = 50; in pwm_ir_probe()
|
A D | gpio-ir-tx.c | 21 unsigned int duty_cycle; member 30 static int gpio_ir_tx_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in gpio_ir_tx_set_duty_cycle() argument 34 gpio_ir->duty_cycle = duty_cycle; in gpio_ir_tx_set_duty_cycle() 87 pulse = DIV_ROUND_CLOSEST(gpio_ir->duty_cycle * (NSEC_PER_SEC / 100), in gpio_ir_tx_modulated() 89 space = DIV_ROUND_CLOSEST((100 - gpio_ir->duty_cycle) * in gpio_ir_tx_modulated() 173 gpio_ir->duty_cycle = 50; in gpio_ir_tx_probe()
|
A D | rc-loopback.c | 59 static int loop_set_tx_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in loop_set_tx_duty_cycle() argument 63 if (duty_cycle < 1 || duty_cycle > 99) { in loop_set_tx_duty_cycle() 64 dev_dbg(&dev->dev, "invalid duty cycle: %u\n", duty_cycle); in loop_set_tx_duty_cycle() 68 dev_dbg(&dev->dev, "setting duty cycle: %u\n", duty_cycle); in loop_set_tx_duty_cycle() 69 lodev->txduty = duty_cycle; in loop_set_tx_duty_cycle()
|
A D | meson-ir-tx.c | 72 unsigned int duty_cycle; member 82 unsigned int pulse_cnt = DIV_ROUND_CLOSEST(cnt * ir->duty_cycle, 100); in meson_irtx_set_mod() 228 static int meson_irtx_set_duty_cycle(struct rc_dev *rc, u32 duty_cycle) in meson_irtx_set_duty_cycle() argument 232 ir->duty_cycle = duty_cycle; in meson_irtx_set_duty_cycle() 333 ir->duty_cycle = MIRTX_DEFAULT_DUTY_CYCLE; in meson_irtx_probe()
|
A D | ir-rx51.c | 27 unsigned int duty_cycle; /* carrier duty cycle */ member 48 duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100); in init_timing_params() 172 .duty_cycle = 50, 180 ir_rx51->duty_cycle = duty; in ir_rx51_set_duty_cycle()
|
/linux/include/trace/events/ |
A D | pwm.h | 20 __field(u64, duty_cycle) 28 __entry->duty_cycle = state->duty_cycle; 34 __entry->pwm, __entry->period, __entry->duty_cycle,
|
/linux/drivers/leds/ |
A D | leds-lp3944.c | 133 u8 duty_cycle) in lp3944_dim_set_dutycycle() argument 147 if (duty_cycle > LP3944_DUTY_CYCLE_MAX) in lp3944_dim_set_dutycycle() 150 pwm_value = (duty_cycle * 255) / LP3944_DUTY_CYCLE_MAX; in lp3944_dim_set_dutycycle() 229 u8 duty_cycle; in lp3944_led_set_blink() local 248 duty_cycle = 100 * (*delay_on) / period; in lp3944_led_set_blink() 254 duty_cycle = 100 - duty_cycle; in lp3944_led_set_blink() 267 err = lp3944_dim_set_dutycycle(led->client, LP3944_DIM0, duty_cycle); in lp3944_led_set_blink()
|
/linux/drivers/net/wireless/ath/ath9k/ |
A D | mci.c | 106 (100 - btcoex->duty_cycle) / 100; in ath_mci_adjust_aggr_limit() 132 btcoex->duty_cycle = ath_mci_duty_cycle[num_profile]; in ath_mci_update_scheme() 149 btcoex->duty_cycle = 30; in ath_mci_update_scheme() 160 btcoex->duty_cycle = AR_SREV_9565(sc->sc_ah) ? 40 : 35; in ath_mci_update_scheme() 164 btcoex->duty_cycle, btcoex->btcoex_period); in ath_mci_update_scheme() 166 btcoex->duty_cycle = 30; in ath_mci_update_scheme() 174 btcoex->duty_cycle = 30; in ath_mci_update_scheme() 178 btcoex->duty_cycle); in ath_mci_update_scheme() 200 if (btcoex->duty_cycle > ATH_MCI_MAX_DUTY_CYCLE) in ath_mci_update_scheme() 201 btcoex->duty_cycle = ATH_MCI_MAX_DUTY_CYCLE; in ath_mci_update_scheme() [all …]
|
/linux/drivers/video/backlight/ |
A D | pwm_bl.c | 82 state.duty_cycle = 0; in pwm_backlight_power_off() 93 u64 duty_cycle; in compute_duty_cycle() local 98 duty_cycle = pb->levels[brightness]; in compute_duty_cycle() 100 duty_cycle = brightness; in compute_duty_cycle() 102 duty_cycle *= state.period - lth; in compute_duty_cycle() 103 do_div(duty_cycle, pb->scale); in compute_duty_cycle() 105 return duty_cycle + lth; in compute_duty_cycle() 119 state.duty_cycle = compute_duty_cycle(pb, brightness); in pwm_backlight_update_status()
|
/linux/drivers/hwmon/ |
A D | tc654.c | 126 u8 duty_cycle; /* The DUTY_CYCLE register is a 4-bit read/ member 177 data->duty_cycle = ret & 0x0f; in tc654_update_client() 377 pwm = tc654_pwm_map[data->duty_cycle]; in pwm_show() 402 data->duty_cycle = find_closest(val, tc654_pwm_map, in pwm_store() 410 data->duty_cycle); in pwm_store()
|