Lines Matching refs:fan
40 struct nvkm_fanpwm *fan = (void *)therm->fan; in nvkm_fanpwm_get() local
47 ret = therm->func->pwm_get(therm, fan->func.line, &divs, &duty); in nvkm_fanpwm_get()
50 if (card_type <= NV_40 || (fan->func.log[0] & 1)) in nvkm_fanpwm_get()
55 return nvkm_gpio_get(gpio, 0, fan->func.func, fan->func.line) * 100; in nvkm_fanpwm_get()
61 struct nvkm_fanpwm *fan = (void *)therm->fan; in nvkm_fanpwm_set() local
66 divs = fan->base.perf.pwm_divisor; in nvkm_fanpwm_set()
67 if (fan->base.bios.pwm_freq) { in nvkm_fanpwm_set()
70 divs = therm->func->pwm_clock(therm, fan->func.line); in nvkm_fanpwm_set()
71 divs /= fan->base.bios.pwm_freq; in nvkm_fanpwm_set()
75 if (card_type <= NV_40 || (fan->func.log[0] & 1)) in nvkm_fanpwm_set()
78 ret = therm->func->pwm_set(therm, fan->func.line, divs, duty); in nvkm_fanpwm_set()
80 ret = therm->func->pwm_ctrl(therm, fan->func.line, true); in nvkm_fanpwm_set()
89 struct nvkm_fanpwm *fan; in nvkm_fanpwm_create() local
100 fan = kzalloc(sizeof(*fan), GFP_KERNEL); in nvkm_fanpwm_create()
101 therm->fan = &fan->base; in nvkm_fanpwm_create()
102 if (!fan) in nvkm_fanpwm_create()
105 fan->base.type = "PWM"; in nvkm_fanpwm_create()
106 fan->base.get = nvkm_fanpwm_get; in nvkm_fanpwm_create()
107 fan->base.set = nvkm_fanpwm_set; in nvkm_fanpwm_create()
108 fan->func = *func; in nvkm_fanpwm_create()