Searched refs:duty_cycle (Results 1 - 25 of 116) sorted by relevance

12345

/linux-master/drivers/pwm/
H A Dpwm-raspberrypi-poe.c8 * - 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 Dpwm-visconti.c49 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 Dpwm-clk.c47 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 Dpwm-cros-ec.c33 * @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 Dpwm-sl28cpld.c75 #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 Dpwm-twl-led.c22 * - 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 Dcore.c60 * 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 Dpwm-pxa.c106 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 Dpwm-twl.c62 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 Dpwm-imx-tpm.c121 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 Dpwm-iqs620a.c71 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 Dpwm-intel-lgm.c67 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 Dpwm-crc.c75 if (pwm_get_duty_cycle(pwm) != state->duty_cycle ||
77 u64 level = state->duty_cycle * PWM_MAX_LEVEL;
146 state->duty_cycle =
H A Dpwm-dwc-core.c52 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 Dpwm-sifive.c124 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 Dpwm.h20 __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 Dgpio-ir-tx.c21 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 Dpwm-ir-tx.c26 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 Drc-loopback.c59 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 Dmeson-ir-tx.c72 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 Dpwm.h51 * @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 Dir-kbd-i2c.h30 unsigned int duty_cycle; member in struct:IR_i2c
/linux-master/drivers/leds/
H A Dleds-lp3944.c130 * @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 Dpwm.c196 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 Dmci.c106 (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...]

Completed in 265 milliseconds

12345