/linux-master/drivers/pwm/ |
H A D | pwm-raspberrypi-poe.c | 8 * - No disable bit, so a disabled PWM is simulated by duty_cycle 0 30 unsigned int duty_cycle; member in struct:raspberrypi_pwm 91 state->duty_cycle = DIV_ROUND_UP(rpipwm->duty_cycle * RPI_PWM_PERIOD_NS, 93 state->enabled = !!(rpipwm->duty_cycle); 103 unsigned int duty_cycle; local 111 duty_cycle = 0; 112 else if (state->duty_cycle < RPI_PWM_PERIOD_NS) 113 duty_cycle = DIV_ROUND_DOWN_ULL(state->duty_cycle * RPI_PWM_MAX_DUT [all...] |
H A D | pwm-visconti.c | 49 u32 period, duty_cycle, pwmc0; local 67 if (state->duty_cycle > period) 68 duty_cycle = period; 70 duty_cycle = state->duty_cycle; 78 duty_cycle /= 1000; 94 duty_cycle >>= pwmc0; 99 writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); 117 state->duty_cycle = (duty << pwmc0_clk) * NSEC_PER_USEC;
|
H A D | pwm-clk.c | 47 u64 duty_cycle = state->duty_cycle; local 63 * We have to enable the clk before setting the rate and duty_cycle, 65 * (potentially) different setting. Also setting period and duty_cycle 75 duty_cycle = period - duty_cycle; 77 return clk_set_duty_cycle(pcchip->clk, duty_cycle, period);
|
H A D | pwm-cros-ec.c | 33 * @duty_cycle: cached duty cycle 36 u16 duty_cycle; member in struct:cros_ec_pwm 139 u16 duty_cycle; local 153 duty_cycle = state->enabled ? state->duty_cycle : 0; 155 ret = cros_ec_pwm_set_duty(ec_pwm, pwm->hwpwm, duty_cycle); 159 channel->duty_cycle = state->duty_cycle; 187 * For the case of the initial hardware readout, channel->duty_cycle 190 if (ret == 0 && channel->duty_cycle > [all...] |
H A D | pwm-sl28cpld.c | 75 #define SL28CPLD_PWM_FROM_DUTY_CYCLE(duty_cycle) \ 76 (DIV_ROUND_DOWN_ULL((duty_cycle), NSEC_PER_SEC / SL28CPLD_PWM_CLK)) 109 state->duty_cycle = SL28CPLD_PWM_TO_DUTY_CYCLE(reg); 114 * might happen that we calculate a duty_cycle greater than the actual 120 state->duty_cycle = min(state->duty_cycle, state->period); 152 cycle = SL28CPLD_PWM_FROM_DUTY_CYCLE(state->duty_cycle);
|
H A D | pwm-twl-led.c | 22 * - A request for .duty_cycle = 0 results in an output wave with one active 76 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; local 91 if (duty_cycle == 1) 92 duty_cycle = 2; 93 else if (duty_cycle > TWL4030_LED_MAX) 94 duty_cycle = 1; 98 pwm_config[1] = duty_cycle; 172 * pwm->state.period && state->duty_cycle == pwm->state.duty_cycle 178 state->duty_cycle, stat 196 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; local [all...] |
H A D | core.c | 60 * best effort inverted .polarity and fixed .duty_cycle respectively. 65 s2.duty_cycle = s1.period - s1.duty_cycle; 73 state->duty_cycle < state->period) 92 last->duty_cycle > s2.duty_cycle && 93 last->duty_cycle <= state->duty_cycle) 96 state->duty_cycle, state->period, 97 s2.duty_cycle, s [all...] |
H A D | pwm-pxa.c | 106 u64 duty_cycle; local 116 duty_cycle = state->enabled ? state->duty_cycle : 0; 118 err = pxa_pwm_config(chip, pwm, duty_cycle, state->period);
|
H A D | pwm-twl.c | 62 int duty_cycle = DIV64_U64_ROUND_UP(duty_ns * TWL_PWM_MAX, period_ns) + 1; local 77 if (duty_cycle == 1) 78 duty_cycle = 2; 79 else if (duty_cycle > TWL_PWM_MAX) 80 duty_cycle = 1; 84 pwm_config[1] = duty_cycle; 296 err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period); 321 err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period);
|
H A D | pwm-imx-tpm.c | 121 real_state->duty_cycle = 0; 123 real_state->duty_cycle = state->duty_cycle; 125 tmp = (u64)p->mod * real_state->duty_cycle; 151 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); 223 if (state->duty_cycle != c.duty_cycle) {
|
H A D | pwm-iqs620a.c | 71 unsigned int duty_cycle; local 86 * duty_cycle = (IQS620_PWM_DUTY_CYCLE + 1) / 256 * 1 ms 95 duty_cycle = min_t(u64, state->duty_cycle, IQS620_PWM_PERIOD_NS); 96 duty_scale = duty_cycle * 256 / IQS620_PWM_PERIOD_NS; 128 state->duty_cycle = DIV_ROUND_UP(iqs620_pwm->duty_scale *
|
H A D | pwm-intel-lgm.c | 67 u32 duty_cycle, val; local 77 duty_cycle = min_t(u64, state->duty_cycle, pc->period); 78 val = duty_cycle * LGM_PWM_MAX_DUTY_CYCLE / pc->period; 101 state->duty_cycle = DIV_ROUND_UP(duty * pc->period, LGM_PWM_MAX_DUTY_CYCLE);
|
H A D | pwm-crc.c | 75 if (pwm_get_duty_cycle(pwm) != state->duty_cycle || 77 u64 level = state->duty_cycle * PWM_MAX_LEVEL; 146 state->duty_cycle =
|
H A D | pwm-dwc-core.c | 52 tmp = DIV_ROUND_CLOSEST_ULL(state->duty_cycle, dwc->clk_ns); 57 tmp = DIV_ROUND_CLOSEST_ULL(state->period - state->duty_cycle, 150 state->duty_cycle = duty;
|
H A D | pwm-sifive.c | 124 state->duty_cycle = 136 unsigned int duty_cycle; local 148 duty_cycle = state->duty_cycle; 150 duty_cycle = 0; 158 num = (u64)duty_cycle * (1U << PWM_SIFIVE_CMPWIDTH);
|
/linux-master/include/trace/events/ |
H A D | pwm.h | 20 __field(u64, duty_cycle) 29 __entry->duty_cycle = state->duty_cycle; 35 TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d", 36 __entry->pwm, __entry->period, __entry->duty_cycle,
|
/linux-master/drivers/media/rc/ |
H A D | gpio-ir-tx.c | 21 unsigned int duty_cycle; member in struct:gpio_ir 30 static int gpio_ir_tx_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) argument 34 gpio_ir->duty_cycle = duty_cycle; 108 pulse = DIV_ROUND_CLOSEST(gpio_ir->duty_cycle * (NSEC_PER_SEC / 100), 110 space = DIV_ROUND_CLOSEST((100 - gpio_ir->duty_cycle) * 189 gpio_ir->duty_cycle = 50;
|
H A D | pwm-ir-tx.c | 26 u32 duty_cycle; member in struct:pwm_ir 39 static int pwm_ir_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) argument 43 pwm_ir->duty_cycle = duty_cycle; 73 pwm_set_relative_duty_cycle(&state, pwm_ir->duty_cycle, 100); 103 pwm_set_relative_duty_cycle(&state, pwm_ir->duty_cycle, 100); 164 pwm_ir->duty_cycle = 50;
|
H A D | rc-loopback.c | 59 static int loop_set_tx_duty_cycle(struct rc_dev *dev, u32 duty_cycle) argument 63 if (duty_cycle < 1 || duty_cycle > 99) { 64 dev_dbg(&dev->dev, "invalid duty cycle: %u\n", duty_cycle); 68 dev_dbg(&dev->dev, "setting duty cycle: %u\n", duty_cycle); 69 lodev->txduty = duty_cycle;
|
H A D | meson-ir-tx.c | 72 unsigned int duty_cycle; member in struct:meson_irtx 82 unsigned int pulse_cnt = DIV_ROUND_CLOSEST(cnt * ir->duty_cycle, 100); 85 dev_dbg(ir->dev, "F_mod = %uHz, T_mod = %luns, duty_cycle = %u%%\n", 228 static int meson_irtx_set_duty_cycle(struct rc_dev *rc, u32 duty_cycle) argument 232 ir->duty_cycle = duty_cycle; 331 ir->duty_cycle = MIRTX_DEFAULT_DUTY_CYCLE;
|
/linux-master/include/linux/ |
H A D | pwm.h | 51 * @duty_cycle: PWM duty cycle (in nanoseconds) 61 u64 duty_cycle; member in struct:pwm_state 128 return state.duty_cycle; 155 * Once the function returns, you can adjust the ->enabled and ->duty_cycle 158 * ->duty_cycle is initially set to zero to avoid cases where the current 159 * ->duty_cycle value exceed the pwm_args->period one, which would trigger 160 * an error if the user calls pwm_apply_might_sleep() without adjusting ->duty_cycle 176 state->duty_cycle = 0; 188 * For example if you want to get the duty_cycle expressed in percent, call: 199 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scal 222 pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, unsigned int scale) argument 242 unsigned int duty_cycle; member in struct:pwm_capture [all...] |
/linux-master/include/media/i2c/ |
H A D | ir-kbd-i2c.h | 30 unsigned int duty_cycle; member in struct:IR_i2c
|
/linux-master/drivers/leds/ |
H A D | leds-lp3944.c | 130 * @duty_cycle: percentage of a period during which a led is ON 133 u8 duty_cycle) 147 if (duty_cycle > LP3944_DUTY_CYCLE_MAX) 150 pwm_value = (duty_cycle * 255) / LP3944_DUTY_CYCLE_MAX; 229 u8 duty_cycle; local 247 /* duty_cycle is the percentage of period during which the led is ON */ 248 duty_cycle = 100 * (*delay_on) / period; 254 duty_cycle = 100 - duty_cycle; 267 err = lp3944_dim_set_dutycycle(led->client, LP3944_DIM0, duty_cycle); 132 lp3944_dim_set_dutycycle(struct i2c_client *client, u8 dim, u8 duty_cycle) argument [all...] |
/linux-master/drivers/staging/greybus/ |
H A D | pwm.c | 196 u64 duty_cycle = state->duty_cycle; local 218 * PWM privodes 64-bit period and duty_cycle, but greybus only accepts 224 if (duty_cycle > period) 225 duty_cycle = period; 227 err = gb_pwm_config_operation(chip, pwm->hwpwm, duty_cycle, period);
|
/linux-master/drivers/net/wireless/ath/ath9k/ |
H A D | mci.c | 106 (100 - btcoex->duty_cycle) / 100; 132 btcoex->duty_cycle = ath_mci_duty_cycle[num_profile]; 149 btcoex->duty_cycle = 30; 160 btcoex->duty_cycle = AR_SREV_9565(sc->sc_ah) ? 40 : 35; 164 btcoex->duty_cycle, btcoex->btcoex_period); 166 btcoex->duty_cycle = 30; 174 btcoex->duty_cycle = 30; 178 btcoex->duty_cycle); 199 btcoex->duty_cycle += (mci->num_bdr ? ATH_MCI_BDR_DUTY_CYCLE : 0); 200 if (btcoex->duty_cycle > ATH_MCI_MAX_DUTY_CYCL [all...] |