/linux/drivers/pwm/ |
H A D | pwm-raspberrypi-poe.c | 30 unsigned int duty_cycle; member 91 state->duty_cycle = DIV_ROUND_UP(rpipwm->duty_cycle * RPI_PWM_PERIOD_NS, in raspberrypi_pwm_get_state() 93 state->enabled = !!(rpipwm->duty_cycle); in raspberrypi_pwm_get_state() 103 unsigned int duty_cycle; in raspberrypi_pwm_apply() local 111 duty_cycle = 0; in raspberrypi_pwm_apply() 112 else if (state->duty_cycle < RPI_PWM_PERIOD_NS) in raspberrypi_pwm_apply() 113 duty_cycle = DIV_ROUND_DOWN_ULL(state->duty_cycle * RPI_PWM_MAX_DUTY, in raspberrypi_pwm_apply() 116 duty_cycle = RPI_PWM_MAX_DUTY; in raspberrypi_pwm_apply() 118 if (duty_cycle == rpipwm->duty_cycle) in raspberrypi_pwm_apply() 122 duty_cycle); in raspberrypi_pwm_apply() [all …]
|
H A D | pwm-gpio.c | 53 dividend = dest->duty_cycle; in pwm_gpio_round() 55 dest->duty_cycle -= remainder; in pwm_gpio_round() 66 if (!state->duty_cycle || state->duty_cycle == state->period) { in pwm_gpio_toggle() 72 return level ? state->duty_cycle : state->period - state->duty_cycle; in pwm_gpio_toggle() 88 new_level = !!gpwm->state.duty_cycle; in pwm_gpio_timer() 107 if (state->duty_cycle && state->duty_cycle < hrtimer_resolution) in pwm_gpio_apply() 110 if (state->duty_cycle != state->period && in pwm_gpio_apply() 111 (state->period - state->duty_cycle < hrtimer_resolution)) in pwm_gpio_apply() 145 next_toggle = pwm_gpio_toggle(gpwm, !!state->duty_cycle); in pwm_gpio_apply()
|
H A D | pwm-visconti.c | 49 u32 period, duty_cycle, pwmc0; in visconti_pwm_apply() local 67 if (state->duty_cycle > period) in visconti_pwm_apply() 68 duty_cycle = period; in visconti_pwm_apply() 70 duty_cycle = state->duty_cycle; in visconti_pwm_apply() 78 duty_cycle /= 1000; in visconti_pwm_apply() 94 duty_cycle >>= pwmc0; in visconti_pwm_apply() 99 writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); in visconti_pwm_apply() 117 state->duty_cycle = (duty << pwmc0_clk) * NSEC_PER_USEC; in visconti_pwm_get_state()
|
H A D | pwm-twl-led.c | 76 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config() local 91 if (duty_cycle == 1) in twl4030_pwmled_config() 92 duty_cycle = 2; in twl4030_pwmled_config() 93 else if (duty_cycle > TWL4030_LED_MAX) in twl4030_pwmled_config() 94 duty_cycle = 1; in twl4030_pwmled_config() 98 pwm_config[1] = duty_cycle; in twl4030_pwmled_config() 178 state->duty_cycle, state->period); in twl4030_pwmled_apply() 196 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config() local 200 on_time = duty_cycle & 0xff; in twl6030_pwmled_config() 278 state->duty_cycle, state->period); in twl6030_pwmled_apply()
|
H A D | pwm-clk.c | 47 u64 duty_cycle = state->duty_cycle; in pwm_clk_apply() local 75 duty_cycle = period - duty_cycle; in pwm_clk_apply() 77 return clk_set_duty_cycle(pcchip->clk, duty_cycle, period); in pwm_clk_apply()
|
H A D | core.c | 84 .duty_cycle = wf->duty_length_ns, in pwm_wf2state() 91 .duty_cycle = wf->period_length_ns - wf->duty_length_ns, in pwm_wf2state() 106 .duty_length_ns = state->duty_cycle, in pwm_state2wf() 112 .duty_length_ns = state->period - state->duty_cycle, in pwm_state2wf() 113 .duty_offset_ns = state->duty_cycle, in pwm_state2wf() 467 s2.duty_cycle = s1.period - s1.duty_cycle; in pwm_apply_debug() 475 state->duty_cycle < state->period) in pwm_apply_debug() 490 if (state->enabled && s2.enabled && state->period < s2.period && s2.duty_cycle) in pwm_apply_debug() 498 last->duty_cycle > s2.duty_cycle && in pwm_apply_debug() 499 last->duty_cycle <= state->duty_cycle) in pwm_apply_debug() [all …]
|
H A D | pwm-sl28cpld.c | 75 #define SL28CPLD_PWM_FROM_DUTY_CYCLE(duty_cycle) \ argument 76 (DIV_ROUND_DOWN_ULL((duty_cycle), NSEC_PER_SEC / SL28CPLD_PWM_CLK)) 109 state->duty_cycle = SL28CPLD_PWM_TO_DUTY_CYCLE(reg); in sl28cpld_pwm_get_state() 120 state->duty_cycle = min(state->duty_cycle, state->period); in sl28cpld_pwm_get_state() 152 cycle = SL28CPLD_PWM_FROM_DUTY_CYCLE(state->duty_cycle); in sl28cpld_pwm_apply()
|
H A D | pwm-adp5585.c | 59 u64 period, duty_cycle; in pwm_adp5585_apply() local 77 duty_cycle = min(state->duty_cycle, period); in pwm_adp5585_apply() 83 on = div_u64(duty_cycle, NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_apply() 130 state->duty_cycle = on * (NSEC_PER_SEC / ADP5585_PWM_OSC_FREQ_HZ); in pwm_adp5585_get_state()
|
H A D | pwm-twl.c | 62 int duty_cycle = DIV64_U64_ROUND_UP(duty_ns * TWL_PWM_MAX, period_ns) + 1; in twl_pwm_config() local 77 if (duty_cycle == 1) in twl_pwm_config() 78 duty_cycle = 2; in twl_pwm_config() 79 else if (duty_cycle > TWL_PWM_MAX) in twl_pwm_config() 80 duty_cycle = 1; in twl_pwm_config() 84 pwm_config[1] = duty_cycle; in twl_pwm_config() 296 err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period); in twl4030_pwm_apply() 321 err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period); in twl6030_pwm_apply()
|
H A D | pwm-iqs620a.c | 71 unsigned int duty_cycle; in iqs620_pwm_apply() local 95 duty_cycle = min_t(u64, state->duty_cycle, IQS620_PWM_PERIOD_NS); in iqs620_pwm_apply() 96 duty_scale = duty_cycle * 256 / IQS620_PWM_PERIOD_NS; in iqs620_pwm_apply() 128 state->duty_cycle = DIV_ROUND_UP(iqs620_pwm->duty_scale * in iqs620_pwm_get_state()
|
H A D | pwm-intel-lgm.c | 67 u32 duty_cycle, val; in lgm_pwm_apply() local 77 duty_cycle = min_t(u64, state->duty_cycle, pc->period); in lgm_pwm_apply() 78 val = duty_cycle * LGM_PWM_MAX_DUTY_CYCLE / pc->period; in lgm_pwm_apply() 101 state->duty_cycle = DIV_ROUND_UP(duty * pc->period, LGM_PWM_MAX_DUTY_CYCLE); in lgm_pwm_get_state()
|
H A D | pwm-cros-ec.c | 128 u16 duty_cycle; in cros_ec_pwm_apply() local 142 duty_cycle = state->enabled ? state->duty_cycle : 0; in cros_ec_pwm_apply() 144 ret = cros_ec_pwm_set_duty(ec_pwm, pwm->hwpwm, duty_cycle); in cros_ec_pwm_apply() 164 state->duty_cycle = ret; in cros_ec_pwm_get_state()
|
H A D | pwm-imx-tpm.c | 124 real_state->duty_cycle = 0; in pwm_imx_tpm_round_state() 126 real_state->duty_cycle = state->duty_cycle; in pwm_imx_tpm_round_state() 128 tmp = (u64)p->mod * real_state->duty_cycle; in pwm_imx_tpm_round_state() 154 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in pwm_imx_tpm_get_state() 226 if (state->duty_cycle != c.duty_cycle) { in pwm_imx_tpm_apply_hw()
|
H A D | pwm-sifive.c | 124 state->duty_cycle = in pwm_sifive_get_state() 136 unsigned int duty_cycle; in pwm_sifive_apply() local 148 duty_cycle = state->duty_cycle; in pwm_sifive_apply() 150 duty_cycle = 0; in pwm_sifive_apply() 158 num = (u64)duty_cycle * (1U << PWM_SIFIVE_CMPWIDTH); in pwm_sifive_apply()
|
H A D | pwm-pxa.c | 106 u64 duty_cycle; in pxa_pwm_apply() local 116 duty_cycle = state->enabled ? state->duty_cycle : 0; in pxa_pwm_apply() 118 err = pxa_pwm_config(chip, pwm, duty_cycle, state->period); in pxa_pwm_apply()
|
/linux/include/linux/ |
H A D | pwm.h | 90 u64 duty_cycle; member 157 return state.duty_cycle; in pwm_get_duty_cycle() 205 state->duty_cycle = 0; in pwm_init_state() 228 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle() 251 pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, in pwm_set_relative_duty_cycle() argument 254 if (!scale || duty_cycle > scale) in pwm_set_relative_duty_cycle() 257 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle() 271 unsigned int duty_cycle; member 413 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config() 416 state.duty_cycle = duty_ns; in pwm_config()
|
/linux/drivers/media/rc/ |
H A D | pwm-ir-tx.c | 26 u32 duty_cycle; member 39 static int pwm_ir_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in pwm_ir_set_duty_cycle() argument 43 pwm_ir->duty_cycle = duty_cycle; in pwm_ir_set_duty_cycle() 73 pwm_set_relative_duty_cycle(&state, pwm_ir->duty_cycle, 100); in pwm_ir_tx_sleep() 103 pwm_set_relative_duty_cycle(&state, pwm_ir->duty_cycle, 100); in pwm_ir_tx_atomic() 164 pwm_ir->duty_cycle = 50; in pwm_ir_probe()
|
H 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()
|
H 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() 331 ir->duty_cycle = MIRTX_DEFAULT_DUTY_CYCLE; in meson_irtx_probe()
|
/linux/Documentation/translations/zh_CN/scheduler/ |
H A D | sched-capacity.rst | 132 task_util(p) = duty_cycle(p) 148 可以算出 duty_cycle(p) == 25%。 157 可以算出 duty_cycle(p) == 50%,尽管两次执行中,任务的行为完全一致(也就是说,执行的工作量 162 task_util_freq_inv(p) = duty_cycle(p) * (curr_frequency(cpu) / max_frequency(cpu)) 191 - duty_cycle(p) == 25%,如果任务p在CPU0上按最大频率运行。 192 - duty_cycle(p) == 75%,如果任务p在CPU1上按最大频率运行。 196 task_util_cpu_inv(p) = duty_cycle(p) * (capacity(cpu) / max_capacity) 208 task_util_inv(p) = duty_cycle(p) * ------------------- * -------------
|
/linux/drivers/leds/ |
H 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/video/backlight/ |
H A D | pwm_bl.c | 78 u64 duty_cycle; in compute_duty_cycle() local 81 duty_cycle = pb->levels[brightness]; in compute_duty_cycle() 83 duty_cycle = brightness; in compute_duty_cycle() 85 duty_cycle *= state->period - lth; in compute_duty_cycle() 86 do_div(duty_cycle, pb->scale); in compute_duty_cycle() 88 return duty_cycle + lth; in compute_duty_cycle() 102 state.duty_cycle = compute_duty_cycle(pb, brightness, &state); in pwm_backlight_update_status() 111 state.duty_cycle = 0; in pwm_backlight_update_status() 624 state.duty_cycle = 0; in pwm_backlight_remove() 640 state.duty_cycle = 0; in pwm_backlight_shutdown() [all …]
|
/linux/drivers/net/wireless/ath/ath9k/ |
H 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() 199 btcoex->duty_cycle += (mci->num_bdr ? ATH_MCI_BDR_DUTY_CYCLE : 0); in ath_mci_update_scheme() 200 if (btcoex->duty_cycle > ATH_MCI_MAX_DUTY_CYCLE) in ath_mci_update_scheme() [all …]
|
/linux/include/trace/events/ |
H A D | pwm.h | 141 __field(u64, duty_cycle) 149 __entry->duty_cycle = state->duty_cycle; 156 __entry->period, __entry->duty_cycle,
|
/linux/drivers/hwmon/ |
H A D | tc654.c | 127 u8 duty_cycle; /* The DUTY_CYCLE register is a 4-bit read/ member 178 data->duty_cycle = ret & 0x0f; in tc654_update_client() 378 pwm = tc654_pwm_map[data->duty_cycle]; in pwm_show() 392 data->duty_cycle = 0; in _set_pwm() 395 data->duty_cycle = val - 1; in _set_pwm() 403 data->duty_cycle); in _set_pwm() 487 *state = data->duty_cycle + 1; /* offset PWM States by 1 */ in tc654_get_cur_state()
|