/Linux-v4.19/drivers/gpu/drm/nouveau/nvkm/subdev/therm/ |
D | fanpwm.c | 44 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() 78 ret = therm->func->pwm_set(therm, fan->func.line, divs, duty); in nvkm_fanpwm_set() 91 u32 divs, duty; in nvkm_fanpwm_create() local [all …]
|
D | fan.c | 39 int duty; in nvkm_fan_update() local 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 = max(duty - 3, target); in nvkm_fan_update() 70 duty = target; in nvkm_fan_update() 73 nvkm_debug(subdev, "FAN update: %d\n", duty); in nvkm_fan_update() [all …]
|
D | base.c | 42 u16 duty, i; in nvkm_therm_update_trip() local 57 duty = cur_trip->fan_duty; in nvkm_therm_update_trip() 60 duty = 0; in nvkm_therm_update_trip() 64 return duty; in nvkm_therm_update_trip() 72 u16 duty; in nvkm_therm_compute_linear_duty() local 81 duty = (temp - linear_min_temp); in nvkm_therm_compute_linear_duty() 82 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_compute_linear_duty() 83 duty /= (linear_max_temp - linear_min_temp); in nvkm_therm_compute_linear_duty() 84 duty += therm->fan->bios.min_duty; in nvkm_therm_compute_linear_duty() 85 return duty; in nvkm_therm_compute_linear_duty() [all …]
|
D | gf119.c | 67 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()
|
D | gm107.c | 34 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()
|
D | fantog.c | 46 int duty; in nvkm_fantog_update() local 53 duty = !nvkm_gpio_get(gpio, 0, DCB_GPIO_FAN, 0xff); in nvkm_fantog_update() 54 nvkm_gpio_set(gpio, 0, DCB_GPIO_FAN, 0xff, duty); in nvkm_fantog_update() 56 if (percent != (duty * 100)) { in nvkm_fantog_update() 58 if (!duty) in nvkm_fantog_update()
|
D | nv40.c | 121 nv40_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in nv40_fan_pwm_get() argument 128 *duty = (reg & 0x7fff0000) >> 16; in nv40_fan_pwm_get() 137 *duty = (reg & 0x7fffffff); in nv40_fan_pwm_get() 149 nv40_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in nv40_fan_pwm_set() argument 154 nvkm_mask(device, 0x0010f0, 0x7fff7fff, (duty << 16) | divs); in nv40_fan_pwm_set() 158 nvkm_mask(device, 0x0015f4, 0x7fffffff, duty); in nv40_fan_pwm_set()
|
D | nv50.c | 66 nv50_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) in nv50_fan_pwm_get() argument 75 *duty = nvkm_rd32(device, 0x00e118 + (id * 8)); in nv50_fan_pwm_get() 83 nv50_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) in nv50_fan_pwm_set() argument 91 nvkm_wr32(device, 0x00e118 + (id * 8), duty | 0x80000000); in nv50_fan_pwm_set()
|
/Linux-v4.19/drivers/pwm/ |
D | pwm-renesas-tpu.c | 86 u16 duty; member 187 tpu_pwm_write(pwm, TPU_TGRAn, pwm->duty); in tpu_pwm_timer_start() 191 pwm->channel, pwm->duty, pwm->period); in tpu_pwm_timer_start() 235 pwm->duty = 0; in tpu_pwm_request() 262 u32 duty; in tpu_pwm_config() local 284 duty = clk_rate / prescalers[prescaler] in tpu_pwm_config() 286 if (duty > period) in tpu_pwm_config() 289 duty = 0; in tpu_pwm_config() 294 clk_rate, prescalers[prescaler], period, duty); in tpu_pwm_config() 301 pwm->duty = duty; in tpu_pwm_config() [all …]
|
D | pwm-atmel-tcb.c | 36 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() 160 if (tcbpwm->duty == 0) in atmel_tcb_pwm_disable() 219 if (tcbpwm->duty == 0) in atmel_tcb_pwm_enable() 250 if (tcbpwm->duty != tcbpwm->period && tcbpwm->duty > 0) { in atmel_tcb_pwm_enable() 269 __raw_writel(tcbpwm->duty, regs + ATMEL_TC_REG(group, RA)); in atmel_tcb_pwm_enable() 271 __raw_writel(tcbpwm->duty, regs + ATMEL_TC_REG(group, RB)); in atmel_tcb_pwm_enable() 295 unsigned duty; in atmel_tcb_pwm_config() local [all …]
|
D | pwm-clps711x.c | 72 unsigned int duty; in clps711x_pwm_config() local 77 duty = clps711x_get_duty(pwm, duty_ns); in clps711x_pwm_config() 78 clps711x_pwm_update_val(priv, pwm->hwpwm, duty); in clps711x_pwm_config() 86 unsigned int duty; in clps711x_pwm_enable() local 88 duty = clps711x_get_duty(pwm, pwm_get_duty_cycle(pwm)); in clps711x_pwm_enable() 89 clps711x_pwm_update_val(priv, pwm->hwpwm, duty); in clps711x_pwm_enable()
|
D | pwm-rockchip.c | 44 unsigned long duty; member 84 tmp = readl_relaxed(pc->base + pc->data->regs.duty); in rockchip_pwm_get_state() 108 unsigned long period, duty; in rockchip_pwm_config() local 124 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config() 137 writel(duty, pc->base + pc->data->regs.duty); in rockchip_pwm_config() 238 .duty = 0x04, 251 .duty = 0x08, 265 .duty = 0x08, 279 .duty = 0x08,
|
D | pwm-jz4740.c | 91 unsigned long period, duty; in jz4740_pwm_config() local 110 duty = period - tmp; in jz4740_pwm_config() 112 if (duty >= period) in jz4740_pwm_config() 113 duty = period - 1; in jz4740_pwm_config() 120 jz4740_timer_set_duty(pwm->hwpwm, duty); in jz4740_pwm_config()
|
D | pwm-berlin.c | 44 u32 duty; member 96 u32 value, duty, period; in berlin_pwm_config() local 114 duty = cycles; in berlin_pwm_config() 123 berlin_pwm_writel(pwm, pwm_dev->hwpwm, duty, BERLIN_PWM_DUTY); in berlin_pwm_config() 255 channel->duty = berlin_pwm_readl(pwm, i, BERLIN_PWM_DUTY); in berlin_pwm_suspend() 282 berlin_pwm_writel(pwm, i, channel->duty, BERLIN_PWM_DUTY); in berlin_pwm_resume()
|
/Linux-v4.19/drivers/leds/ |
D | leds-pwm.c | 30 int duty; member 40 int new_duty = led_dat->duty; in __led_pwm_set() 56 unsigned long long duty = led_dat->period; in led_pwm_set() local 58 duty *= brightness; in led_pwm_set() 59 do_div(duty, max); in led_pwm_set() 62 duty = led_dat->period - duty; in led_pwm_set() 64 led_dat->duty = duty; in led_pwm_set()
|
/Linux-v4.19/include/trace/events/ |
D | clk.h | 197 TP_PROTO(struct clk_core *core, struct clk_duty *duty), 199 TP_ARGS(core, duty), 209 __entry->num = duty->num; 210 __entry->den = duty->den; 219 TP_PROTO(struct clk_core *core, struct clk_duty *duty), 221 TP_ARGS(core, duty) 226 TP_PROTO(struct clk_core *core, struct clk_duty *duty), 228 TP_ARGS(core, duty)
|
/Linux-v4.19/drivers/gpu/drm/nouveau/ |
D | nouveau_led.c | 42 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()
|
/Linux-v4.19/drivers/gpu/drm/nouveau/nvkm/subdev/volt/ |
D | gk104.c | 43 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()
|
/Linux-v4.19/drivers/clk/meson/ |
D | sclk-div.c | 121 struct clk_duty *duty) in sclk_div_set_duty_cycle() argument 127 memcpy(&sclk->cached_duty, duty, sizeof(*duty)); in sclk_div_set_duty_cycle() 135 struct clk_duty *duty) in sclk_div_get_duty_cycle() argument 142 duty->num = 1; in sclk_div_get_duty_cycle() 143 duty->den = 2; in sclk_div_get_duty_cycle() 148 duty->num = hi + 1; in sclk_div_get_duty_cycle() 149 duty->den = sclk->cached_div; in sclk_div_get_duty_cycle()
|
/Linux-v4.19/Documentation/devicetree/bindings/input/ |
D | pwm-vibrator.txt | 4 strength increases based on the duty cycle of the enable PWM channel 5 (100% duty cycle meaning strongest vibration, 0% meaning no vibration). 8 driven at fixed duty cycle. If available this is can be used to increase 18 - direction-duty-cycle-ns: Duty cycle of the direction PWM channel in 64 direction-duty-cycle-ns = <1000000000>;
|
/Linux-v4.19/Documentation/devicetree/bindings/regulator/ |
D | pwm-regulator.txt | 7 predefined voltage <=> duty-cycle values must be 10 Intermediary duty-cycle values which would normally 19 appropriate duty-cycle values. This allows for a much 22 assumption that a %50 duty-cycle value will cause the 35 Second cell is duty-cycle in percent (%) 38 - pwm-dutycycle-unit: Integer value encoding the duty cycle unit. If not 71 * Inverted PWM logic, and the duty cycle range is limited
|
/Linux-v4.19/Documentation/hwmon/ |
D | vt1211 | 167 Each PWM has 4 associated distinct output duty-cycles: full, high, low and 172 thermal thresholds exist that controls both PWMs output duty-cycles. The 181 pwm[1-2]_auto_point4_pwm full speed duty-cycle (hard-wired to 255) 182 pwm[1-2]_auto_point3_pwm high speed duty-cycle 183 pwm[1-2]_auto_point2_pwm low speed duty-cycle 184 pwm[1-2]_auto_point1_pwm off duty-cycle (hard-wired to 0) 194 PWM output duty-cycle based on the input temperature: 199 full speed duty-cycle full speed duty-cycle 201 high speed duty-cycle full speed duty-cycle 203 low speed duty-cycle high speed duty-cycle [all …]
|
D | dme1737 | 143 attribute that needs to be set to the maximum attainable RPM (fan at 100% duty- 155 manual mode, the fan speed is set by writing the duty-cycle value to the 157 current duty-cycle as set by the fan controller in the chip. All PWM outputs 168 duty-cycles: full, low, and min. Full is internally hard-wired to 255 (100%) 174 pwm[1-3]_auto_point2_pwm full-speed duty-cycle (255, i.e., 100%) 175 pwm[1-3]_auto_point1_pwm low-speed duty-cycle 176 pwm[1-3]_auto_pwm_min min-speed duty-cycle 183 The chip adjusts the output duty-cycle linearly in the range of auto_point1_pwm 186 auto_point1_temp_hyst value, the output duty-cycle is set to the auto_pwm_min 189 duty-cycle. If any of the temperatures rise above the auto_point3_temp value, [all …]
|
/Linux-v4.19/drivers/media/rc/ |
D | ir-rx51.c | 55 int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, ir_rx51->freq); in init_timing_params() local 57 duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100); in init_timing_params() 59 pwm_config(pwm, duty, period); in init_timing_params() 185 static int ir_rx51_set_duty_cycle(struct rc_dev *dev, u32 duty) in ir_rx51_set_duty_cycle() argument 189 ir_rx51->duty_cycle = duty; in ir_rx51_set_duty_cycle()
|
/Linux-v4.19/Documentation/devicetree/bindings/leds/backlight/ |
D | pwm-backlight.txt | 19 0 will do. The actual brightness level (PWM duty cycle) 20 will be interpolated from these values. 0 means a 0% duty 22 represents a 100% duty cycle (brightest). 27 resolution pwm duty cycle can be used without
|