Home
last modified time | relevance | path

Searched refs:duty_cycle (Results 1 – 25 of 51) sorted by relevance

123

/Linux-v4.19/drivers/media/rc/
Dpwm-ir-tx.c29 unsigned int duty_cycle; member
38 static int pwm_ir_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in pwm_ir_set_duty_cycle() argument
42 pwm_ir->duty_cycle = duty_cycle; in pwm_ir_set_duty_cycle()
69 duty = DIV_ROUND_CLOSEST(pwm_ir->duty_cycle * period, 100); in pwm_ir_tx()
107 pwm_ir->duty_cycle = 50; in pwm_ir_probe()
Dgpio-ir-tx.c29 unsigned int duty_cycle; member
40 static int gpio_ir_tx_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in gpio_ir_tx_set_duty_cycle() argument
44 gpio_ir->duty_cycle = duty_cycle; in gpio_ir_tx_set_duty_cycle()
76 pulse = DIV_ROUND_CLOSEST(gpio_ir->duty_cycle * (NSEC_PER_SEC / 100), in gpio_ir_tx()
78 space = DIV_ROUND_CLOSEST((100 - gpio_ir->duty_cycle) * in gpio_ir_tx()
155 gpio_ir->duty_cycle = 50; in gpio_ir_tx_probe()
Drc-loopback.c72 static int loop_set_tx_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in loop_set_tx_duty_cycle() argument
76 if (duty_cycle < 1 || duty_cycle > 99) { in loop_set_tx_duty_cycle()
77 dprintk("invalid duty cycle: %u\n", duty_cycle); in loop_set_tx_duty_cycle()
81 dprintk("setting duty cycle: %u\n", duty_cycle); in loop_set_tx_duty_cycle()
82 lodev->txduty = duty_cycle; in loop_set_tx_duty_cycle()
Dir-rx51.c36 unsigned int duty_cycle; /* carrier duty cycle */ member
57 duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100); in init_timing_params()
181 .duty_cycle = 50,
189 ir_rx51->duty_cycle = duty; in ir_rx51_set_duty_cycle()
Dserial_ir.c143 unsigned int duty_cycle; member
193 if (serial_ir.duty_cycle > 50) in send_pulse_irdeo()
233 pulse = DIV_ROUND_CLOSEST(serial_ir.duty_cycle * (NSEC_PER_SEC / 100), in send_pulse_homebrew_softcarrier()
235 space = DIV_ROUND_CLOSEST((100 - serial_ir.duty_cycle) * in send_pulse_homebrew_softcarrier()
575 serial_ir.duty_cycle = 50; in serial_ir_probe()
680 serial_ir.duty_cycle = cycle; in serial_ir_tx_duty_cycle()
Dir-spi.c95 static int ir_spi_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle) in ir_spi_set_duty_cycle() argument
98 int bits = (duty_cycle * 15) / 100; in ir_spi_set_duty_cycle()
Dene_ir.c331 int carrier, duty_cycle; in ene_rx_sense_carrier() local
347 duty_cycle = (hperiod * 100) / period; in ene_rx_sense_carrier()
349 carrier, duty_cycle); in ene_rx_sense_carrier()
353 ev.duty_cycle = duty_cycle; in ene_rx_sense_carrier()
911 static int ene_set_tx_duty_cycle(struct rc_dev *rdev, u32 duty_cycle) in ene_set_tx_duty_cycle() argument
914 dbg("TX: setting duty cycle to %d%%", duty_cycle); in ene_set_tx_duty_cycle()
915 dev->tx_duty_cycle = duty_cycle; in ene_set_tx_duty_cycle()
/Linux-v4.19/include/linux/
Dpwm.h60 unsigned int duty_cycle; member
126 pwm->state.duty_cycle = duty; in pwm_set_duty_cycle()
135 return state.duty_cycle; in pwm_get_duty_cycle()
183 state->duty_cycle = 0; in pwm_init_state()
205 return DIV_ROUND_CLOSEST_ULL((u64)state->duty_cycle * scale, in pwm_get_relative_duty_cycle()
228 pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, in pwm_set_relative_duty_cycle() argument
231 if (!scale || duty_cycle > scale) in pwm_set_relative_duty_cycle()
234 state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * in pwm_set_relative_duty_cycle()
313 unsigned int duty_cycle; member
343 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config()
[all …]
/Linux-v4.19/drivers/pwm/
Dpwm-twl-led.c72 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config() local
87 if (duty_cycle == 1) in twl4030_pwmled_config()
88 duty_cycle = 2; in twl4030_pwmled_config()
89 else if (duty_cycle > TWL4030_LED_MAX) in twl4030_pwmled_config()
90 duty_cycle = 1; in twl4030_pwmled_config()
94 pwm_config[1] = duty_cycle; in twl4030_pwmled_config()
154 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config() local
158 on_time = duty_cycle & 0xff; in twl6030_pwmled_config()
Dpwm-cros-ec.c99 int duty_cycle; in cros_ec_pwm_apply() local
109 duty_cycle = state->enabled ? state->duty_cycle : 0; in cros_ec_pwm_apply()
111 return cros_ec_pwm_set_duty(ec_pwm->ec, pwm->hwpwm, duty_cycle); in cros_ec_pwm_apply()
130 state->duty_cycle = ret; in cros_ec_pwm_get_state()
Dpwm-twl.c74 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL_PWM_MAX, period_ns) + 1; in twl_pwm_config() local
89 if (duty_cycle == 1) in twl_pwm_config()
90 duty_cycle = 2; in twl_pwm_config()
91 else if (duty_cycle > TWL_PWM_MAX) in twl_pwm_config()
92 duty_cycle = 1; in twl_pwm_config()
96 pwm_config[1] = duty_cycle; in twl_pwm_config()
Dcore.c472 state->duty_cycle > state->period) in pwm_apply_state()
511 state->duty_cycle != pwm->state.duty_cycle) { in pwm_apply_state()
513 state->duty_cycle, in pwm_apply_state()
518 pwm->state.duty_cycle = state->duty_cycle; in pwm_apply_state()
591 state.duty_cycle = 0; in pwm_adjust_config()
603 u64 dutycycle = (u64)state.duty_cycle * pargs.period; in pwm_adjust_config()
606 state.duty_cycle = dutycycle; in pwm_adjust_config()
615 state.duty_cycle = state.period - state.duty_cycle; in pwm_adjust_config()
999 seq_printf(s, " duty: %u ns", state.duty_cycle); in pwm_dbg_show()
Dpwm-zx.c97 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, rate); in zx_pwm_get_state()
168 state->duty_cycle != cstate.duty_cycle) { in zx_pwm_apply()
169 ret = zx_pwm_config(chip, pwm, state->duty_cycle, in zx_pwm_apply()
Dpwm-meson.c173 duty == channel->state.duty_cycle) in meson_pwm_calc()
315 state->duty_cycle != channel->state.duty_cycle || in meson_pwm_apply()
330 state->duty_cycle, state->period); in meson_pwm_apply()
336 channel->state.duty_cycle = state->duty_cycle; in meson_pwm_apply()
Dpwm-hibvt.c142 state->duty_cycle = div_u64(value * 1000, freq); in hibvt_pwm_get_state()
155 state->duty_cycle != pwm->state.duty_cycle) in hibvt_pwm_apply()
156 hibvt_pwm_config(chip, pwm, state->duty_cycle, state->period); in hibvt_pwm_apply()
Dpwm-sun4i.c142 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); in sun4i_pwm_get_state()
191 div *= state->duty_cycle; in sun4i_pwm_calculate()
200 state->duty_cycle = DIV_ROUND_CLOSEST_ULL(div, clk_rate); in sun4i_pwm_calculate()
229 (cstate.duty_cycle != state->duty_cycle)) { in sun4i_pwm_apply()
Dsysfs.c88 return sprintf(buf, "%u\n", state.duty_cycle); in duty_cycle_show()
107 state.duty_cycle = val; in duty_cycle_store()
223 return sprintf(buf, "%u %u\n", result.period, result.duty_cycle); in capture_show()
227 static DEVICE_ATTR_RW(duty_cycle);
/Linux-v4.19/drivers/leds/
Dleds-lp3944.c137 u8 duty_cycle) in lp3944_dim_set_dutycycle() argument
151 if (duty_cycle > LP3944_DUTY_CYCLE_MAX) in lp3944_dim_set_dutycycle()
154 pwm_value = (duty_cycle * 255) / LP3944_DUTY_CYCLE_MAX; in lp3944_dim_set_dutycycle()
233 u8 duty_cycle; in lp3944_led_set_blink() local
252 duty_cycle = 100 * (*delay_on) / period; in lp3944_led_set_blink()
258 duty_cycle = 100 - duty_cycle; in lp3944_led_set_blink()
271 err = lp3944_dim_set_dutycycle(led->client, LP3944_DIM0, duty_cycle); in lp3944_led_set_blink()
Dleds-cpcap.c81 static u16 cpcap_led_val(u8 current_limit, u8 duty_cycle) in cpcap_led_val() argument
84 duty_cycle &= 0x0f; /* 4 bit */ in cpcap_led_val()
86 return current_limit << 4 | duty_cycle; in cpcap_led_val()
/Linux-v4.19/drivers/net/wireless/ath/ath9k/
Dmci.c106 (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-v4.19/drivers/video/backlight/
Dpwm_bl.c92 u64 duty_cycle; in compute_duty_cycle() local
95 duty_cycle = pb->levels[brightness]; in compute_duty_cycle()
97 duty_cycle = brightness; in compute_duty_cycle()
99 duty_cycle *= pb->period - lth; in compute_duty_cycle()
100 do_div(duty_cycle, pb->scale); in compute_duty_cycle()
102 return duty_cycle + lth; in compute_duty_cycle()
109 int duty_cycle; in pwm_backlight_update_status() local
120 duty_cycle = compute_duty_cycle(pb, brightness); in pwm_backlight_update_status()
121 pwm_config(pb->pwm, duty_cycle, pb->period); in pwm_backlight_update_status()
/Linux-v4.19/Documentation/media/uapi/rc/
Dlirc-set-send-duty-cycle.rst18 .. c:function:: int ioctl( int fd, LIRC_SET_SEND_DUTY_CYCLE, __u32 *duty_cycle)
27 ``duty_cycle``
/Linux-v4.19/drivers/hwmon/
Dtc654.c135 u8 duty_cycle; /* The DUTY_CYCLE register is a 4-bit read/ member
186 data->duty_cycle = ret & 0x0f; in tc654_update_client()
386 pwm = tc654_pwm_map[data->duty_cycle]; in show_pwm()
411 data->duty_cycle = find_closest(val, tc654_pwm_map, in set_pwm()
419 data->duty_cycle); in set_pwm()
/Linux-v4.19/drivers/media/i2c/cx25840/
Dcx25840-ir.c468 unsigned int duty_cycle) in cduty_tx_s_duty_cycle() argument
471 n = DIV_ROUND_CLOSEST(duty_cycle * 100, 625); /* 16ths of 100% */ in cduty_tx_s_duty_cycle()
800 p->duty_cycle = 50; in cx25840_ir_rx_s_parameters()
801 o->duty_cycle = p->duty_cycle; in cx25840_ir_rx_s_parameters()
986 p->duty_cycle = cduty_tx_s_duty_cycle(c, p->duty_cycle); in cx25840_ir_tx_s_parameters()
987 o->duty_cycle = p->duty_cycle; in cx25840_ir_tx_s_parameters()
1212 .duty_cycle = 25, /* 25 % - RC-5 carrier */
/Linux-v4.19/drivers/media/pci/cx23885/
Dcx23888-ir.c488 unsigned int duty_cycle) in cduty_tx_s_duty_cycle() argument
491 n = DIV_ROUND_CLOSEST(duty_cycle * 100, 625); /* 16ths of 100% */ in cduty_tx_s_duty_cycle()
779 o->duty_cycle = p->duty_cycle = 50; in cx23888_ir_rx_s_parameters()
906 p->duty_cycle = cduty_tx_s_duty_cycle(dev, p->duty_cycle); in cx23888_ir_tx_s_parameters()
907 o->duty_cycle = p->duty_cycle; in cx23888_ir_tx_s_parameters()
1164 .duty_cycle = 25, /* 25 % - RC-5 carrier */

123