Home
last modified time | relevance | path

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

/drivers/gpu/drm/nouveau/core/subdev/therm/
Dfanpwm.c45 u32 divs, duty; in nouveau_fanpwm_get() local
48 ret = therm->pwm_get(therm, priv->func.line, &divs, &duty); in nouveau_fanpwm_get()
50 divs = max(divs, duty); in nouveau_fanpwm_get()
52 duty = divs - duty; in nouveau_fanpwm_get()
53 return (duty * 100) / divs; in nouveau_fanpwm_get()
65 u32 divs, duty; in nouveau_fanpwm_set() local
76 duty = ((divs * percent) + 99) / 100; in nouveau_fanpwm_set()
78 duty = divs - duty; in nouveau_fanpwm_set()
80 ret = therm->pwm_set(therm, priv->func.line, divs, duty); in nouveau_fanpwm_set()
94 u32 divs, duty; in nouveau_fanpwm_create() local
[all …]
Dbase.c40 u16 duty, i; in nouveau_therm_update_trip() local
55 duty = cur_trip->fan_duty; in nouveau_therm_update_trip()
58 duty = 0; in nouveau_therm_update_trip()
62 return duty; in nouveau_therm_update_trip()
72 u16 duty; in nouveau_therm_update_linear() local
81 duty = (temp - linear_min_temp); in nouveau_therm_update_linear()
82 duty *= (priv->fan->bios.max_duty - priv->fan->bios.min_duty); in nouveau_therm_update_linear()
83 duty /= (linear_max_temp - linear_min_temp); in nouveau_therm_update_linear()
84 duty += priv->fan->bios.min_duty; in nouveau_therm_update_linear()
86 return duty; in nouveau_therm_update_linear()
[all …]
Dfan.c44 int duty; in nouveau_fan_update() local
58 duty = fan->get(therm); in nouveau_fan_update()
59 if (duty == target) { in nouveau_fan_update()
65 if (!immediate && duty >= 0) { in nouveau_fan_update()
70 if (duty < target) in nouveau_fan_update()
71 duty = min(duty + 3, target); in nouveau_fan_update()
72 else if (duty > target) in nouveau_fan_update()
73 duty = max(duty - 3, target); in nouveau_fan_update()
75 duty = target; in nouveau_fan_update()
78 nv_debug(therm, "FAN update: %d\n", duty); in nouveau_fan_update()
[all …]
Dnvd0.c69 nvd0_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) in nvd0_fan_pwm_get() argument
77 *duty = nv_rd32(therm, 0x00e118 + (indx * 8)); in nvd0_fan_pwm_get()
82 *duty = nv_rd32(therm, 0x0200dc) & 0x1fff; in nvd0_fan_pwm_get()
90 nvd0_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) in nvd0_fan_pwm_set() argument
97 nv_wr32(therm, 0x00e118 + (indx * 8), duty | 0x80000000); in nvd0_fan_pwm_set()
100 nv_wr32(therm, 0x0200dc, duty | 0x40000000); in nvd0_fan_pwm_set()
Dfantog.c49 int duty; in nouveau_fantog_update() local
56 duty = !gpio->get(gpio, 0, DCB_GPIO_FAN, 0xff); in nouveau_fantog_update()
57 gpio->set(gpio, 0, DCB_GPIO_FAN, 0xff, duty); in nouveau_fantog_update()
59 if (list_empty(&priv->alarm.head) && percent != (duty * 100)) { in nouveau_fantog_update()
61 if (!duty) in nouveau_fantog_update()
Dnv40.c126 nv40_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) in nv40_fan_pwm_get() argument
131 *duty = (reg & 0x7fff0000) >> 16; in nv40_fan_pwm_get()
140 *duty = (reg & 0x7fffffff); in nv40_fan_pwm_get()
152 nv40_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) in nv40_fan_pwm_set() argument
155 nv_mask(therm, 0x0010f0, 0x7fff7fff, (duty << 16) | divs); in nv40_fan_pwm_set()
159 nv_mask(therm, 0x0015f4, 0x7fffffff, duty); in nv40_fan_pwm_set()
Dgm107.c39 gm107_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) in gm107_fan_pwm_get() argument
42 *duty = nv_rd32(therm, 0x10eb24) & 0x1fff; in gm107_fan_pwm_get()
47 gm107_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) in gm107_fan_pwm_set() argument
50 nv_wr32(therm, 0x10eb14, duty | 0x80000000); in gm107_fan_pwm_set()
Dnv50.c68 nv50_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) in nv50_fan_pwm_get() argument
76 *duty = nv_rd32(therm, 0x00e118 + (id * 8)); in nv50_fan_pwm_get()
84 nv50_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) in nv50_fan_pwm_set() argument
91 nv_wr32(therm, 0x00e118 + (id * 8), duty | 0x80000000); in nv50_fan_pwm_set()
/drivers/pwm/
Dpwm-renesas-tpu.c86 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 …]
Dpwm-atmel-tcb.c36 unsigned duty; /* PWM duty expressed in clk cycles */ member
87 tcbpwm->duty = 0; in atmel_tcb_pwm_request()
99 tcbpwm->duty = in atmel_tcb_pwm_request()
102 tcbpwm->duty = in atmel_tcb_pwm_request()
151 if (tcbpwm->duty == 0) in atmel_tcb_pwm_disable()
207 if (tcbpwm->duty == 0) in atmel_tcb_pwm_enable()
238 if (tcbpwm->duty != tcbpwm->period && tcbpwm->duty > 0) { in atmel_tcb_pwm_enable()
257 __raw_writel(tcbpwm->duty, regs + ATMEL_TC_REG(group, RA)); in atmel_tcb_pwm_enable()
259 __raw_writel(tcbpwm->duty, regs + ATMEL_TC_REG(group, RB)); in atmel_tcb_pwm_enable()
282 unsigned duty; in atmel_tcb_pwm_config() local
[all …]
Dpwm-rockchip.c41 unsigned long duty; member
105 unsigned long period, duty; in rockchip_pwm_config() local
122 duty = div; in rockchip_pwm_config()
129 writel(duty, pc->base + pc->data->regs.duty); in rockchip_pwm_config()
190 .duty = 0x04,
202 .duty = 0x08,
214 .duty = 0x08,
Dpwm-clps711x.c72 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()
Dpwm-bfin.c69 unsigned long period, duty; in bfin_pwm_config() local
78 duty = period - val; in bfin_pwm_config()
80 if (duty >= period) in bfin_pwm_config()
81 duty = period - 1; in bfin_pwm_config()
84 set_gptimer_pwidth(priv->pin, duty); in bfin_pwm_config()
Dpwm-jz4740.c113 unsigned long period, duty; in jz4740_pwm_config() local
132 duty = period - tmp; in jz4740_pwm_config()
134 if (duty >= period) in jz4740_pwm_config()
135 duty = period - 1; in jz4740_pwm_config()
142 jz4740_timer_set_duty(pwm->hwpwm, duty); in jz4740_pwm_config()
Dpwm-pca9685.c73 unsigned long long duty; in pca9685_pwm_config() local
98 duty = 4096 * (unsigned long long)duty_ns; in pca9685_pwm_config()
99 duty = DIV_ROUND_UP_ULL(duty, period_ns); in pca9685_pwm_config()
106 regmap_write(pca->regmap, reg, (int)duty & 0xff); in pca9685_pwm_config()
113 regmap_write(pca->regmap, reg, ((int)duty >> 8) & 0xf); in pca9685_pwm_config()
Dpwm-fsl-ftm.c222 unsigned long long duty; in fsl_pwm_calculate_duty() local
226 duty = (unsigned long long)duty_ns * (val + 1); in fsl_pwm_calculate_duty()
227 do_div(duty, period_ns); in fsl_pwm_calculate_duty()
229 return (unsigned long)duty; in fsl_pwm_calculate_duty()
236 u32 period, duty; in fsl_pwm_config() local
270 duty = fsl_pwm_calculate_duty(fpc, period_ns, duty_ns); in fsl_pwm_config()
274 regmap_write(fpc->regmap, FTM_CV(pwm->hwpwm), duty); in fsl_pwm_config()
/drivers/leds/
Dleds-pwm.c33 int duty; member
44 int new_duty = led_dat->duty; in __led_pwm_set()
68 unsigned long long duty = led_dat->period; in led_pwm_set() local
70 duty *= brightness; in led_pwm_set()
71 do_div(duty, max); in led_pwm_set()
74 duty = led_dat->period - duty; in led_pwm_set()
76 led_dat->duty = duty; in led_pwm_set()
/drivers/hwmon/
Dpwm-fan.c40 unsigned long pwm, duty; in set_pwm() local
56 duty = DIV_ROUND_UP(pwm * (ctx->pwm->period - 1), MAX_PWM); in set_pwm()
57 ret = pwm_config(ctx->pwm, duty, ctx->pwm->period); in set_pwm()
164 unsigned long duty; in pwm_fan_resume() local
170 duty = DIV_ROUND_UP(ctx->pwm_value * (ctx->pwm->period - 1), MAX_PWM); in pwm_fan_resume()
171 ret = pwm_config(ctx->pwm, duty, ctx->pwm->period); in pwm_fan_resume()
Df75375s.c780 bool manu, duty; in f75375_init() local
786 duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1); in f75375_init()
787 if (!manu && duty) in f75375_init()
790 else if (manu && !duty) in f75375_init()
793 else if (!manu && !duty) in f75375_init()
/drivers/staging/iio/trigger/
Diio-trig-bfin-timer.c62 unsigned int duty; member
106 if (val <= 4 || val <= st->duty) in iio_bfin_tmr_frequency_store()
110 set_gptimer_pwidth(st->t->id, val - st->duty); in iio_bfin_tmr_frequency_store()
234 st->duty = val; in iio_bfin_tmr_trigger_probe()
245 st->duty = 1; in iio_bfin_tmr_trigger_probe()
/drivers/video/backlight/
Dlp8788_bl.c128 unsigned int duty; in lp8788_pwm_ctrl() local
136 duty = br * period / max_br; in lp8788_pwm_ctrl()
150 pwm_config(bl->pwm, duty, period); in lp8788_pwm_ctrl()
151 if (duty) in lp8788_pwm_ctrl()
Dlp855x_bl.c237 unsigned int duty = br * period / max_br; in lp855x_pwm_ctrl() local
249 pwm_config(lp->pwm, duty, period); in lp855x_pwm_ctrl()
250 if (duty) in lp855x_pwm_ctrl()
Dlm3630a_bl.c166 unsigned int duty = br * period / br_max; in lm3630a_pwm_ctrl() local
168 pwm_config(pchip->pwmd, duty, period); in lm3630a_pwm_ctrl()
169 if (duty) in lm3630a_pwm_ctrl()
/drivers/input/misc/
Dmax8997_haptic.c75 unsigned int duty = chip->pwm_period * chip->level / 100; in max8997_haptic_set_duty_cycle() local
76 ret = pwm_config(chip->pwm, duty, chip->pwm_period); in max8997_haptic_set_duty_cycle()
/drivers/regulator/
DKconfig484 duty cycle can increase or decrease the voltage.