Home
last modified time | relevance | path

Searched refs:duty (Results 1 - 25 of 125) sorted by relevance

12345

/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/therm/
H A Dfanpwm.c44 u32 divs, duty; in nvkm_fanpwm_get() local
47 ret = therm->func->pwm_get(therm, fan->func.line, &divs, &duty); in nvkm_fanpwm_get()
49 divs = max(divs, duty); in nvkm_fanpwm_get()
51 duty = divs - duty; in nvkm_fanpwm_get()
52 return (duty * 100) / divs; in nvkm_fanpwm_get()
63 u32 divs, duty; in nvkm_fanpwm_set() local
74 duty = ((divs * percent) + 99) / 100; in nvkm_fanpwm_set()
76 duty = divs - duty; in nvkm_fanpwm_set()
91 u32 divs, duty; nvkm_fanpwm_create() local
[all...]
H A Dfan.c39 int duty; in nvkm_fan_update() local
52 /* check that we're not already at the target duty cycle */ in nvkm_fan_update()
53 duty = fan->get(therm); in nvkm_fan_update()
54 if (duty == target) { in nvkm_fan_update()
60 if (!immediate && duty >= 0) { in nvkm_fan_update()
65 if (duty < target) in nvkm_fan_update()
66 duty = min(duty + 3, target); in nvkm_fan_update()
67 else if (duty > target) in nvkm_fan_update()
68 duty in nvkm_fan_update()
[all...]
H A Dbase.c44 u16 duty, i; in nvkm_therm_update_trip() local
59 duty = cur_trip->fan_duty; in nvkm_therm_update_trip()
62 duty = 0; in nvkm_therm_update_trip()
66 return duty; in nvkm_therm_update_trip()
74 u16 duty; in nvkm_therm_compute_linear_duty() local
83 duty = (temp - linear_min_temp); in nvkm_therm_compute_linear_duty()
84 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_compute_linear_duty()
85 duty /= (linear_max_temp - linear_min_temp); in nvkm_therm_compute_linear_duty()
86 duty += therm->fan->bios.min_duty; in nvkm_therm_compute_linear_duty()
87 return duty; in nvkm_therm_compute_linear_duty()
113 int duty = -1; nvkm_therm_update() local
[all...]
H A Dgf119.c67 gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in gf119_fan_pwm_get() argument
76 *duty = nvkm_rd32(device, 0x00e118 + (indx * 8)); in gf119_fan_pwm_get()
81 *duty = nvkm_rd32(device, 0x0200dc) & 0x1fff; in gf119_fan_pwm_get()
89 gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in gf119_fan_pwm_set() argument
97 nvkm_wr32(device, 0x00e118 + (indx * 8), duty | 0x80000000); in gf119_fan_pwm_set()
100 nvkm_wr32(device, 0x0200dc, duty | 0x40000000); in gf119_fan_pwm_set()
H A Dgm107.c34 gm107_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in gm107_fan_pwm_get() argument
38 *duty = nvkm_rd32(device, 0x10eb24) & 0x1fff; in gm107_fan_pwm_get()
43 gm107_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in gm107_fan_pwm_set() argument
47 nvkm_wr32(device, 0x10eb14, duty | 0x80000000); in gm107_fan_pwm_set()
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/therm/
H A Dfanpwm.c44 u32 divs, duty; in nvkm_fanpwm_get() local
47 ret = therm->func->pwm_get(therm, fan->func.line, &divs, &duty); in nvkm_fanpwm_get()
49 divs = max(divs, duty); in nvkm_fanpwm_get()
51 duty = divs - duty; in nvkm_fanpwm_get()
52 return (duty * 100) / divs; in nvkm_fanpwm_get()
63 u32 divs, duty; in nvkm_fanpwm_set() local
74 duty = ((divs * percent) + 99) / 100; in nvkm_fanpwm_set()
76 duty = divs - duty; in nvkm_fanpwm_set()
91 u32 divs, duty; nvkm_fanpwm_create() local
[all...]
H A Dfan.c39 int duty; in nvkm_fan_update() local
52 /* check that we're not already at the target duty cycle */ in nvkm_fan_update()
53 duty = fan->get(therm); in nvkm_fan_update()
54 if (duty == target) { in nvkm_fan_update()
60 if (!immediate && duty >= 0) { in nvkm_fan_update()
65 if (duty < target) in nvkm_fan_update()
66 duty = min(duty + 3, target); in nvkm_fan_update()
67 else if (duty > target) in nvkm_fan_update()
68 duty in nvkm_fan_update()
[all...]
H A Dbase.c44 u16 duty, i; in nvkm_therm_update_trip() local
59 duty = cur_trip->fan_duty; in nvkm_therm_update_trip()
62 duty = 0; in nvkm_therm_update_trip()
66 return duty; in nvkm_therm_update_trip()
74 u16 duty; in nvkm_therm_compute_linear_duty() local
83 duty = (temp - linear_min_temp); in nvkm_therm_compute_linear_duty()
84 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_compute_linear_duty()
85 duty /= (linear_max_temp - linear_min_temp); in nvkm_therm_compute_linear_duty()
86 duty += therm->fan->bios.min_duty; in nvkm_therm_compute_linear_duty()
87 return duty; in nvkm_therm_compute_linear_duty()
113 int duty = -1; nvkm_therm_update() local
[all...]
H A Dgf119.c68 gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in gf119_fan_pwm_get() argument
77 *duty = nvkm_rd32(device, 0x00e118 + (indx * 8)); in gf119_fan_pwm_get()
82 *duty = nvkm_rd32(device, 0x0200dc) & 0x1fff; in gf119_fan_pwm_get()
90 gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in gf119_fan_pwm_set() argument
98 nvkm_wr32(device, 0x00e118 + (indx * 8), duty | 0x80000000); in gf119_fan_pwm_set()
101 nvkm_wr32(device, 0x0200dc, duty | 0x40000000); in gf119_fan_pwm_set()
H A Dgm107.c34 gm107_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in gm107_fan_pwm_get() argument
38 *duty = nvkm_rd32(device, 0x10eb24) & 0x1fff; in gm107_fan_pwm_get()
43 gm107_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in gm107_fan_pwm_set() argument
47 nvkm_wr32(device, 0x10eb14, duty | 0x80000000); in gm107_fan_pwm_set()
/kernel/linux/linux-6.6/drivers/pwm/
H A Dpwm-ntxec.c16 * - The period and duty cycle can't be changed together in one atomic action.
45 * The time base used in the EC is 8MHz, or 125ns. Period and duty cycle are
58 int period, int duty) in ntxec_pwm_set_raw_period_and_duty_cycle()
63 * Changes to the period and duty cycle take effect as soon as the in ntxec_pwm_set_raw_period_and_duty_cycle()
66 * duty cycle is fully written. If, in such a case, the old duty cycle in ntxec_pwm_set_raw_period_and_duty_cycle()
69 * To minimize the time between the changes to period and duty cycle in ntxec_pwm_set_raw_period_and_duty_cycle()
75 { NTXEC_REG_DUTY_HIGH, ntxec_reg8(duty >> 8) }, in ntxec_pwm_set_raw_period_and_duty_cycle()
77 { NTXEC_REG_DUTY_LOW, ntxec_reg8(duty) }, in ntxec_pwm_set_raw_period_and_duty_cycle()
87 unsigned int period, duty; in ntxec_pwm_apply() local
57 ntxec_pwm_set_raw_period_and_duty_cycle(struct pwm_chip *chip, int period, int duty) ntxec_pwm_set_raw_period_and_duty_cycle() argument
[all...]
H A Dpwm-sunplus.c60 u32 dd_freq, duty, mode0, mode1; in sunplus_pwm_apply() local
103 /* cal and set pwm duty */ in sunplus_pwm_apply()
111 duty = SP7021_PWM_DUTY_DD_SEL(pwm->hwpwm) | SP7021_PWM_DUTY_MAX; in sunplus_pwm_apply()
117 duty = mul_u64_u64_div_u64(state->duty_cycle, clk_rate, in sunplus_pwm_apply()
119 duty = SP7021_PWM_DUTY_DD_SEL(pwm->hwpwm) | duty; in sunplus_pwm_apply()
121 writel(duty, priv->base + SP7021_PWM_DUTY(pwm->hwpwm)); in sunplus_pwm_apply()
132 u32 mode0, dd_freq, duty; in sunplus_pwm_get_state() local
140 duty = readl(priv->base + SP7021_PWM_DUTY(pwm->hwpwm)); in sunplus_pwm_get_state()
141 duty in sunplus_pwm_get_state()
[all...]
H A Dpwm-renesas-tpu.c78 u16 duty; member
179 tpu_pwm_write(tpd, TPU_TGRAn, tpd->duty); in tpu_pwm_timer_start()
183 tpd->channel, tpd->duty, tpd->period); in tpu_pwm_timer_start()
227 tpd->duty = 0; in tpu_pwm_request()
253 u32 duty; in tpu_pwm_config() local
305 duty = mul_u64_u64_div_u64(clk_rate, duty_ns, in tpu_pwm_config()
308 duty = 0; in tpu_pwm_config()
311 "rate %u, prescaler %u, period %u, duty %u\n", in tpu_pwm_config()
312 clk_rate, 1 << (2 * prescaler), (u32)period, duty); in tpu_pwm_config()
319 tpd->duty in tpu_pwm_config()
[all...]
H A Dpwm-atmel-tcb.c37 unsigned duty; /* PWM duty expressed in clk cycles */ member
81 tcbpwm->duty = 0; in atmel_tcb_pwm_request()
95 &tcbpwm->duty); in atmel_tcb_pwm_request()
99 &tcbpwm->duty); in atmel_tcb_pwm_request()
131 * If duty is 0 the timer will be stopped and we have to in atmel_tcb_pwm_disable()
138 if (tcbpwm->duty == 0) in atmel_tcb_pwm_disable()
188 * If duty is 0 the timer will be stopped and we have to in atmel_tcb_pwm_enable()
195 if (tcbpwm->duty == 0) in atmel_tcb_pwm_enable()
221 * If duty i in atmel_tcb_pwm_enable()
273 unsigned duty; atmel_tcb_pwm_config() local
[all...]
/kernel/linux/linux-5.10/drivers/pwm/
H A Dpwm-renesas-tpu.c78 u16 duty; member
179 tpu_pwm_write(pwm, TPU_TGRAn, pwm->duty); in tpu_pwm_timer_start()
183 pwm->channel, pwm->duty, pwm->period); in tpu_pwm_timer_start()
227 pwm->duty = 0; in tpu_pwm_request()
254 u32 duty; in tpu_pwm_config() local
276 duty = clk_rate / prescalers[prescaler] in tpu_pwm_config()
278 if (duty > period) in tpu_pwm_config()
281 duty = 0; in tpu_pwm_config()
285 "rate %u, prescaler %u, period %u, duty %u\n", in tpu_pwm_config()
286 clk_rate, prescalers[prescaler], period, duty); in tpu_pwm_config()
[all...]
H A Dpwm-atmel-tcb.c36 unsigned duty; /* PWM duty expressed in clk cycles */ member
96 tcbpwm->duty = 0; in atmel_tcb_pwm_request()
108 tcbpwm->duty = in atmel_tcb_pwm_request()
111 tcbpwm->duty = in atmel_tcb_pwm_request()
153 * If duty is 0 the timer will be stopped and we have to in atmel_tcb_pwm_disable()
160 if (tcbpwm->duty == 0) in atmel_tcb_pwm_disable()
212 * If duty is 0 the timer will be stopped and we have to in atmel_tcb_pwm_enable()
219 if (tcbpwm->duty == 0) in atmel_tcb_pwm_enable()
245 * If duty i in atmel_tcb_pwm_enable()
295 unsigned duty; atmel_tcb_pwm_config() local
[all...]
/kernel/linux/linux-5.10/include/trace/events/
H A Dclk.h189 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
191 TP_ARGS(core, duty),
201 __entry->num = duty->num;
202 __entry->den = duty->den;
211 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
213 TP_ARGS(core, duty)
218 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
220 TP_ARGS(core, duty)
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/volt/
H A Dgk104.c43 u32 div, duty; in gk104_volt_get() local
46 duty = nvkm_rd32(device, 0x20344); in gk104_volt_get()
48 return bios->base + bios->pwm_range * duty / div; in gk104_volt_get()
56 u32 div, duty; in gk104_volt_set() local
60 duty = DIV_ROUND_UP((uv - bios->base) * div, bios->pwm_range); in gk104_volt_set()
63 nvkm_wr32(device, 0x20344, 0x80000000 | duty); in gk104_volt_set()
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/
H A Dnouveau_led.c42 u32 div, duty; in nouveau_led_get_brightness() local
45 duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; in nouveau_led_get_brightness()
48 return duty * LED_FULL / div; in nouveau_led_get_brightness()
62 u32 div, duty; in nouveau_led_set_brightness() local
65 duty = value * div / LED_FULL; in nouveau_led_set_brightness()
73 nvif_wr32(device, 0x61c884, 0xc0000000 | duty); in nouveau_led_set_brightness()
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/
H A Dnouveau_led.c42 u32 div, duty; in nouveau_led_get_brightness() local
45 duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; in nouveau_led_get_brightness()
48 return duty * LED_FULL / div; in nouveau_led_get_brightness()
62 u32 div, duty; in nouveau_led_set_brightness() local
65 duty = value * div / LED_FULL; in nouveau_led_set_brightness()
73 nvif_wr32(device, 0x61c884, 0xc0000000 | duty); in nouveau_led_set_brightness()
/kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/volt/
H A Dgk104.c43 u32 div, duty; in gk104_volt_get() local
46 duty = nvkm_rd32(device, 0x20344); in gk104_volt_get()
48 return bios->base + bios->pwm_range * duty / div; in gk104_volt_get()
56 u32 div, duty; in gk104_volt_set() local
60 duty = DIV_ROUND_UP((uv - bios->base) * div, bios->pwm_range); in gk104_volt_set()
63 nvkm_wr32(device, 0x20344, 0x80000000 | duty); in gk104_volt_set()
/kernel/linux/linux-5.10/drivers/clk/meson/
H A Dsclk-div.c12 * The duty cycle may also be set for the LR clock variant. The duty cycle
125 struct clk_duty *duty) in sclk_div_set_duty_cycle()
131 memcpy(&sclk->cached_duty, duty, sizeof(*duty)); in sclk_div_set_duty_cycle()
139 struct clk_duty *duty) in sclk_div_get_duty_cycle()
146 duty->num = 1; in sclk_div_get_duty_cycle()
147 duty->den = 2; in sclk_div_get_duty_cycle()
152 duty->num = hi + 1; in sclk_div_get_duty_cycle()
153 duty in sclk_div_get_duty_cycle()
124 sclk_div_set_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) sclk_div_set_duty_cycle() argument
138 sclk_div_get_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) sclk_div_get_duty_cycle() argument
[all...]
/kernel/linux/linux-6.6/drivers/clk/meson/
H A Dsclk-div.c12 * The duty cycle may also be set for the LR clock variant. The duty cycle
126 struct clk_duty *duty) in sclk_div_set_duty_cycle()
132 memcpy(&sclk->cached_duty, duty, sizeof(*duty)); in sclk_div_set_duty_cycle()
140 struct clk_duty *duty) in sclk_div_get_duty_cycle()
147 duty->num = 1; in sclk_div_get_duty_cycle()
148 duty->den = 2; in sclk_div_get_duty_cycle()
153 duty->num = hi + 1; in sclk_div_get_duty_cycle()
154 duty in sclk_div_get_duty_cycle()
125 sclk_div_set_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) sclk_div_set_duty_cycle() argument
139 sclk_div_get_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) sclk_div_get_duty_cycle() argument
[all...]
/kernel/linux/linux-6.6/drivers/leds/rgb/
H A Dleds-pwm-multicolor.c36 unsigned long long duty; in led_pwm_mc_set() local
45 duty = priv->leds[i].state.period; in led_pwm_mc_set()
46 duty *= mc_cdev->subled_info[i].brightness; in led_pwm_mc_set()
47 do_div(duty, cdev->max_brightness); in led_pwm_mc_set()
50 duty = priv->leds[i].state.period - duty; in led_pwm_mc_set()
52 priv->leds[i].state.duty_cycle = duty; in led_pwm_mc_set()
53 priv->leds[i].state.enabled = duty > 0; in led_pwm_mc_set()
/kernel/linux/linux-5.10/drivers/leds/
H A Dleds-pwm.c45 unsigned long long duty = led_dat->pwmstate.period; in led_pwm_set() local
47 duty *= brightness; in led_pwm_set()
48 do_div(duty, max); in led_pwm_set()
51 duty = led_dat->pwmstate.period - duty; in led_pwm_set()
53 led_dat->pwmstate.duty_cycle = duty; in led_pwm_set()

Completed in 11 milliseconds

12345