39 int card_type = nv_device(therm)->card_type;
43 if (!priv->
fan.pwm_get)
48 ret = priv->
fan.pwm_get(therm, func.
line, &divs, &duty);
49 if (ret == 0 && divs) {
50 divs =
max(divs, duty);
51 if (card_type <= NV_40 || (func.
log[0] & 1))
53 return (duty * 100) / divs;
56 return gpio->
get(gpio, 0, func.
func, func.
line) * 100;
68 int card_type = nv_device(therm)->card_type;
75 if (!priv->
fan.pwm_set)
78 if (percent < priv->bios_fan.min_duty)
80 if (percent > priv->
bios_fan.max_duty)
88 if (priv->
fan.pwm_clock)
89 divs = priv->
fan.pwm_clock(therm);
93 duty = ((divs *
percent) + 99) / 100;
94 if (card_type <= NV_40 || (func.
log[0] & 1))
97 ret = priv->
fan.pwm_set(therm, func.
line, divs, duty);
120 start = ptimer->
read(ptimer);
129 start = ptimer->
read(ptimer);
133 }
while (cycles < 5 && ptimer->
read(ptimer) - start < 250000000);
134 end = ptimer->
read(ptimer);
137 tach = (
u64)60000000000ULL;
138 do_div(tach, (end - start));
150 if (priv->
fan.mode == mode)
159 nv_info(therm,
"switch fan to no-control mode\n");
162 nv_info(therm,
"switch fan to manual mode\n");
228 nv_error(therm,
"parsing the thermal table failed\n");
229 nouveau_therm_fan_safety_checks(therm);