summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-02-12 10:01:51 +1000
committerDave Airlie <airlied@redhat.com>2015-02-12 10:01:51 +1000
commit96abd10ecc2e9ab5c8060697ce721683f387c64e (patch)
tree37452abd7abe3797ab10c97d4f05b720da33ada3 /drivers/gpu/drm/radeon/radeon_pm.c
parent64aa7e342a0a05cc19e278bc0822e2e667ebb645 (diff)
parent410af8d7285a0b96314845c75c39fd612b755688 (diff)
downloadtalos-obmc-linux-96abd10ecc2e9ab5c8060697ce721683f387c64e.tar.gz
talos-obmc-linux-96abd10ecc2e9ab5c8060697ce721683f387c64e.zip
Merge branch 'drm-next-3.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some radeon fixes for 3.20. * 'drm-next-3.20' of git://people.freedesktop.org/~agd5f/linux: drm/radeon: only enable kv/kb dpm interrupts once v3 drm/radeon: workaround for CP HW bug on CIK drm/radeon: Don't try to enable write-combining without PAT drm/radeon: use 0-255 rather than 0-100 for pwm fan range
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 91e1bd246cad..9f758d39420d 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -585,7 +585,7 @@ static ssize_t radeon_hwmon_set_pwm1_enable(struct device *dev,
if (err)
return err;
- switch(value) {
+ switch (value) {
case 1: /* manual, percent-based */
rdev->asic->dpm.fan_ctrl_set_mode(rdev, FDO_PWM_MODE_STATIC);
break;
@@ -608,7 +608,7 @@ static ssize_t radeon_hwmon_get_pwm1_max(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return sprintf(buf, "%i\n", 100); /* pwm uses percent-based fan-control */
+ return sprintf(buf, "%i\n", 255);
}
static ssize_t radeon_hwmon_set_pwm1(struct device *dev,
@@ -623,6 +623,8 @@ static ssize_t radeon_hwmon_set_pwm1(struct device *dev,
if (err)
return err;
+ value = (value * 100) / 255;
+
err = rdev->asic->dpm.set_fan_speed_percent(rdev, value);
if (err)
return err;
@@ -642,6 +644,8 @@ static ssize_t radeon_hwmon_get_pwm1(struct device *dev,
if (err)
return err;
+ speed = (speed * 255) / 100;
+
return sprintf(buf, "%i\n", speed);
}
OpenPOWER on IntegriCloud