diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c index 321db927d638..489dcf355d34 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c @@ -22,15 +22,14 @@ * Authors: Ben Skeggs * Martin Peres */ - #include "priv.h" struct nv50_therm_priv { - struct nouveau_therm_priv base; + struct nvkm_therm_priv base; }; static int -pwm_info(struct nouveau_therm *therm, int *line, int *ctrl, int *indx) +pwm_info(struct nvkm_therm *therm, int *line, int *ctrl, int *indx) { if (*line == 0x04) { *ctrl = 0x00e100; @@ -55,7 +54,7 @@ pwm_info(struct nouveau_therm *therm, int *line, int *ctrl, int *indx) } int -nv50_fan_pwm_ctrl(struct nouveau_therm *therm, int line, bool enable) +nv50_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable) { u32 data = enable ? 0x00000001 : 0x00000000; int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id); @@ -65,7 +64,7 @@ nv50_fan_pwm_ctrl(struct nouveau_therm *therm, int line, bool enable) } int -nv50_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) +nv50_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) { int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id); if (ret) @@ -81,7 +80,7 @@ nv50_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty) } int -nv50_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) +nv50_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) { int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id); if (ret) @@ -93,7 +92,7 @@ nv50_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty) } int -nv50_fan_pwm_clock(struct nouveau_therm *therm, int line) +nv50_fan_pwm_clock(struct nvkm_therm *therm, int line) { int chipset = nv_device(therm)->chipset; int crystal = nv_device(therm)->crystal; @@ -119,16 +118,16 @@ nv50_fan_pwm_clock(struct nouveau_therm *therm, int line) } static void -nv50_sensor_setup(struct nouveau_therm *therm) +nv50_sensor_setup(struct nvkm_therm *therm) { nv_mask(therm, 0x20010, 0x40000000, 0x0); mdelay(20); /* wait for the temperature to stabilize */ } static int -nv50_temp_get(struct nouveau_therm *therm) +nv50_temp_get(struct nvkm_therm *therm) { - struct nouveau_therm_priv *priv = (void *)therm; + struct nvkm_therm_priv *priv = (void *)therm; struct nvbios_therm_sensor *sensor = &priv->bios_sensor; int core_temp; @@ -151,15 +150,15 @@ nv50_temp_get(struct nouveau_therm *therm) } static int -nv50_therm_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) +nv50_therm_ctor(struct nvkm_object *parent, + struct nvkm_object *engine, + struct nvkm_oclass *oclass, void *data, u32 size, + struct nvkm_object **pobject) { struct nv50_therm_priv *priv; int ret; - ret = nouveau_therm_create(parent, engine, oclass, &priv); + ret = nvkm_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; @@ -169,29 +168,29 @@ nv50_therm_ctor(struct nouveau_object *parent, priv->base.base.pwm_set = nv50_fan_pwm_set; priv->base.base.pwm_clock = nv50_fan_pwm_clock; priv->base.base.temp_get = nv50_temp_get; - priv->base.sensor.program_alarms = nouveau_therm_program_alarms_polling; + priv->base.sensor.program_alarms = nvkm_therm_program_alarms_polling; nv_subdev(priv)->intr = nv40_therm_intr; - return nouveau_therm_preinit(&priv->base.base); + return nvkm_therm_preinit(&priv->base.base); } static int -nv50_therm_init(struct nouveau_object *object) +nv50_therm_init(struct nvkm_object *object) { - struct nouveau_therm *therm = (void *)object; + struct nvkm_therm *therm = (void *)object; nv50_sensor_setup(therm); - return _nouveau_therm_init(object); + return _nvkm_therm_init(object); } -struct nouveau_oclass +struct nvkm_oclass nv50_therm_oclass = { .handle = NV_SUBDEV(THERM, 0x50), - .ofuncs = &(struct nouveau_ofuncs) { + .ofuncs = &(struct nvkm_ofuncs) { .ctor = nv50_therm_ctor, - .dtor = _nouveau_therm_dtor, + .dtor = _nvkm_therm_dtor, .init = nv50_therm_init, - .fini = _nouveau_therm_fini, + .fini = _nvkm_therm_fini, }, }; |