summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/therm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 07:54:07 +0300
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 05:40:09 +0300
commitcb8bb9cedb6015eafd56ef9e9c5b2c216e8e7960 (patch)
treef4333cb97eaf8f656603dd99e39f0bafee9f4e34 /drivers/gpu/drm/nouveau/nvkm/subdev/therm
parentda06b46b720687117178d3ee85a601762f1c36b5 (diff)
downloadlinux-cb8bb9cedb6015eafd56ef9e9c5b2c216e8e7960.tar.xz
drm/nouveau/tmr: cosmetic changes
This is purely preparation for upcoming commits, there should be no code changes here. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/therm')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c8
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c18
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c4
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c8
4 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
index abb3fdc18910..87c20d197102 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
@@ -83,7 +83,7 @@ static void
nvkm_therm_update(struct nvkm_therm *obj, int mode)
{
struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base);
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
unsigned long flags;
bool immd = true;
bool poll = true;
@@ -96,7 +96,7 @@ nvkm_therm_update(struct nvkm_therm *obj, int mode)
switch (mode) {
case NVKM_THERM_CTRL_MANUAL:
- ptimer->alarm_cancel(ptimer, &therm->alarm);
+ tmr->alarm_cancel(tmr, &therm->alarm);
duty = nvkm_therm_fan_get(&therm->base);
if (duty < 0)
duty = 100;
@@ -120,12 +120,12 @@ nvkm_therm_update(struct nvkm_therm *obj, int mode)
break;
case NVKM_THERM_CTRL_NONE:
default:
- ptimer->alarm_cancel(ptimer, &therm->alarm);
+ tmr->alarm_cancel(tmr, &therm->alarm);
poll = false;
}
if (list_empty(&therm->alarm.head) && poll)
- ptimer->alarm(ptimer, 1000000000ULL, &therm->alarm);
+ tmr->alarm(tmr, 1000000000ULL, &therm->alarm);
spin_unlock_irqrestore(&therm->lock, flags);
if (duty >= 0) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
index 37b9f47f663c..83ebf366a221 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
@@ -32,7 +32,7 @@ static int
nvkm_fan_update(struct nvkm_fan *fan, bool immediate, int target)
{
struct nvkm_therm_priv *therm = (void *)fan->parent;
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
unsigned long flags;
int ret = 0;
int duty;
@@ -94,7 +94,7 @@ nvkm_fan_update(struct nvkm_fan *fan, bool immediate, int target)
else
delay = bump_period;
- ptimer->alarm(ptimer, delay * 1000 * 1000, &fan->alarm);
+ tmr->alarm(tmr, delay * 1000 * 1000, &fan->alarm);
}
return ret;
@@ -125,7 +125,7 @@ int
nvkm_therm_fan_sense(struct nvkm_therm *obj)
{
struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base);
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
struct nvkm_gpio *gpio = nvkm_gpio(therm);
u32 cycles, cur, prev;
u64 start, end, tach;
@@ -137,7 +137,7 @@ nvkm_therm_fan_sense(struct nvkm_therm *obj)
* When the fan spins, it changes the value of GPIO FAN_SENSE.
* We get 4 changes (0 -> 1 -> 0 -> 1) per complete rotation.
*/
- start = ptimer->read(ptimer);
+ start = tmr->read(tmr);
prev = gpio->get(gpio, 0, therm->fan->tach.func, therm->fan->tach.line);
cycles = 0;
do {
@@ -146,12 +146,12 @@ nvkm_therm_fan_sense(struct nvkm_therm *obj)
cur = gpio->get(gpio, 0, therm->fan->tach.func, therm->fan->tach.line);
if (prev != cur) {
if (!start)
- start = ptimer->read(ptimer);
+ start = tmr->read(tmr);
cycles++;
prev = cur;
}
- } while (cycles < 5 && ptimer->read(ptimer) - start < 250000000);
- end = ptimer->read(ptimer);
+ } while (cycles < 5 && tmr->read(tmr) - start < 250000000);
+ end = tmr->read(tmr);
if (cycles == 5) {
tach = (u64)60000000000ULL;
@@ -217,10 +217,10 @@ int
nvkm_therm_fan_fini(struct nvkm_therm *obj, bool suspend)
{
struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base);
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
if (suspend)
- ptimer->alarm_cancel(ptimer, &therm->fan->alarm);
+ tmr->alarm_cancel(tmr, &therm->fan->alarm);
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c
index 138ee99ec0ea..88cc190f5a3e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c
@@ -39,7 +39,7 @@ static void
nvkm_fantog_update(struct nvkm_fantog *fan, int percent)
{
struct nvkm_therm_priv *therm = (void *)fan->base.parent;
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
struct nvkm_gpio *gpio = nvkm_gpio(therm);
unsigned long flags;
int duty;
@@ -56,7 +56,7 @@ nvkm_fantog_update(struct nvkm_fantog *fan, int percent)
u64 next_change = (percent * fan->period_us) / 100;
if (!duty)
next_change = fan->period_us - next_change;
- ptimer->alarm(ptimer, next_change * 1000, &fan->alarm);
+ tmr->alarm(tmr, next_change * 1000, &fan->alarm);
}
spin_unlock_irqrestore(&fan->lock, flags);
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
index a6f46ed0e2ae..41628de3bf6c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
@@ -169,7 +169,7 @@ alarm_timer_callback(struct nvkm_alarm *alarm)
struct nvkm_therm_priv *therm =
container_of(alarm, struct nvkm_therm_priv, sensor.therm_poll_alarm);
struct nvbios_therm_sensor *sensor = &therm->bios_sensor;
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
unsigned long flags;
spin_lock_irqsave(&therm->sensor.alarm_program_lock, flags);
@@ -191,7 +191,7 @@ alarm_timer_callback(struct nvkm_alarm *alarm)
/* schedule the next poll in one second */
if (therm->base.temp_get(&therm->base) >= 0 && list_empty(&alarm->head))
- ptimer->alarm(ptimer, 1000000000ULL, alarm);
+ tmr->alarm(tmr, 1000000000ULL, alarm);
}
void
@@ -223,10 +223,10 @@ int
nvkm_therm_sensor_fini(struct nvkm_therm *obj, bool suspend)
{
struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base);
- struct nvkm_timer *ptimer = nvkm_timer(therm);
+ struct nvkm_timer *tmr = nvkm_timer(therm);
if (suspend)
- ptimer->alarm_cancel(ptimer, &therm->sensor.therm_poll_alarm);
+ tmr->alarm_cancel(tmr, &therm->sensor.therm_poll_alarm);
return 0;
}