From: Martin Peres Date: Sun, 17 Aug 2014 15:33:07 +0000 (+0200) Subject: drm/nouveau/therm/fan: do not use the pwm mode when the vbios tells us to use toggle X-Git-Tag: Ubuntu-5.2.0-15.16~12609^2~36^2~55 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=90a2c1aaa2855b43d35310b41b13357f25517771;p=mirror_ubuntu-eoan-kernel.git drm/nouveau/therm/fan: do not use the pwm mode when the vbios tells us to use toggle Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/fanpwm.c b/drivers/gpu/drm/nouveau/core/subdev/therm/fanpwm.c index 9a5c07340263..c629d7f2a6a4 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/fanpwm.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/fanpwm.c @@ -25,6 +25,8 @@ #include #include +#include +#include #include "priv.h" @@ -86,11 +88,15 @@ nouveau_fanpwm_create(struct nouveau_therm *therm, struct dcb_gpio_func *func) { struct nouveau_device *device = nv_device(therm); struct nouveau_therm_priv *tpriv = (void *)therm; + struct nouveau_bios *bios = nouveau_bios(therm); struct nouveau_fanpwm_priv *priv; + struct nvbios_therm_fan fan; u32 divs, duty; + nvbios_fan_parse(bios, &fan); + if (!nouveau_boolopt(device->cfgopt, "NvFanPWM", func->param) || - !therm->pwm_ctrl || + !therm->pwm_ctrl || fan.type == NVBIOS_THERM_FAN_TOGGLE || therm->pwm_get(therm, func->line, &divs, &duty) == -ENODEV) return -ENODEV;