Lines Matching +full:fan +full:-

29 #include <subdev/bios/fan.h>
40 struct nvkm_fanpwm *fan = (void *)therm->fan; in nvkm_fanpwm_get() local
41 struct nvkm_device *device = therm->subdev.device; in nvkm_fanpwm_get()
42 struct nvkm_gpio *gpio = device->gpio; in nvkm_fanpwm_get()
43 int card_type = device->card_type; in nvkm_fanpwm_get()
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()
51 duty = divs - duty; 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
62 int card_type = therm->subdev.device->card_type; in nvkm_fanpwm_set()
66 divs = fan->base.perf.pwm_divisor; in nvkm_fanpwm_set()
67 if (fan->base.bios.pwm_freq) { in nvkm_fanpwm_set()
69 if (therm->func->pwm_clock) 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()
76 duty = divs - duty; 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()
87 struct nvkm_device *device = therm->subdev.device; in nvkm_fanpwm_create()
88 struct nvkm_bios *bios = device->bios; in nvkm_fanpwm_create()
89 struct nvkm_fanpwm *fan; in nvkm_fanpwm_create() local
95 if (!nvkm_boolopt(device->cfgopt, "NvFanPWM", func->param) || in nvkm_fanpwm_create()
96 !therm->func->pwm_ctrl || info.type == NVBIOS_THERM_FAN_TOGGLE || in nvkm_fanpwm_create()
97 therm->func->pwm_get(therm, func->line, &divs, &duty) == -ENODEV) in nvkm_fanpwm_create()
98 return -ENODEV; in nvkm_fanpwm_create()
100 fan = kzalloc(sizeof(*fan), GFP_KERNEL); in nvkm_fanpwm_create()
101 if (!fan) in nvkm_fanpwm_create()
102 return -ENOMEM; in nvkm_fanpwm_create()
104 therm->fan = &fan->base; 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()