diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-11-22 17:56:32 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-22 18:23:29 -0500 |
commit | e33df25fecd31be889a878bc75313817bc292bac (patch) | |
tree | 8e42dddd4d00d3dd475c05bf4588c49d0682cfcc /drivers/gpu/drm/radeon | |
parent | d5e455e48b095df7f5381dff028f8523aaf565a9 (diff) |
drm/radeon/kms: add thermal sensor support for fusion APUs
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/evergreend.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 4 |
4 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 7f859ffe99ce..075d6c172595 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -57,6 +57,14 @@ u32 evergreen_get_temp(struct radeon_device *rdev) | |||
57 | return actual_temp * 1000; | 57 | return actual_temp * 1000; |
58 | } | 58 | } |
59 | 59 | ||
60 | u32 sumo_get_temp(struct radeon_device *rdev) | ||
61 | { | ||
62 | u32 temp = RREG32(CG_THERMAL_STATUS) & 0xff; | ||
63 | u32 actual_temp = (temp >> 1) & 0xff; | ||
64 | |||
65 | return actual_temp * 1000; | ||
66 | } | ||
67 | |||
60 | void evergreen_pm_misc(struct radeon_device *rdev) | 68 | void evergreen_pm_misc(struct radeon_device *rdev) |
61 | { | 69 | { |
62 | int req_ps_idx = rdev->pm.requested_power_state_index; | 70 | int req_ps_idx = rdev->pm.requested_power_state_index; |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 9644b1cbfb09..87fcaba76695 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
@@ -164,11 +164,13 @@ | |||
164 | #define SE_SC_BUSY (1 << 29) | 164 | #define SE_SC_BUSY (1 << 29) |
165 | #define SE_DB_BUSY (1 << 30) | 165 | #define SE_DB_BUSY (1 << 30) |
166 | #define SE_CB_BUSY (1 << 31) | 166 | #define SE_CB_BUSY (1 << 31) |
167 | 167 | /* evergreen */ | |
168 | #define CG_MULT_THERMAL_STATUS 0x740 | 168 | #define CG_MULT_THERMAL_STATUS 0x740 |
169 | #define ASIC_T(x) ((x) << 16) | 169 | #define ASIC_T(x) ((x) << 16) |
170 | #define ASIC_T_MASK 0x7FF0000 | 170 | #define ASIC_T_MASK 0x7FF0000 |
171 | #define ASIC_T_SHIFT 16 | 171 | #define ASIC_T_SHIFT 16 |
172 | /* APU */ | ||
173 | #define CG_THERMAL_STATUS 0x678 | ||
172 | 174 | ||
173 | #define HDP_HOST_PATH_CNTL 0x2C00 | 175 | #define HDP_HOST_PATH_CNTL 0x2C00 |
174 | #define HDP_NONSURFACE_BASE 0x2C04 | 176 | #define HDP_NONSURFACE_BASE 0x2C04 |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index bf3a4fc82964..0507ee7e16eb 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -180,6 +180,7 @@ void rs690_pm_info(struct radeon_device *rdev); | |||
180 | extern u32 rv6xx_get_temp(struct radeon_device *rdev); | 180 | extern u32 rv6xx_get_temp(struct radeon_device *rdev); |
181 | extern u32 rv770_get_temp(struct radeon_device *rdev); | 181 | extern u32 rv770_get_temp(struct radeon_device *rdev); |
182 | extern u32 evergreen_get_temp(struct radeon_device *rdev); | 182 | extern u32 evergreen_get_temp(struct radeon_device *rdev); |
183 | extern u32 sumo_get_temp(struct radeon_device *rdev); | ||
183 | 184 | ||
184 | /* | 185 | /* |
185 | * Fences. | 186 | * Fences. |
@@ -687,6 +688,7 @@ enum radeon_int_thermal_type { | |||
687 | THERMAL_TYPE_RV6XX, | 688 | THERMAL_TYPE_RV6XX, |
688 | THERMAL_TYPE_RV770, | 689 | THERMAL_TYPE_RV770, |
689 | THERMAL_TYPE_EVERGREEN, | 690 | THERMAL_TYPE_EVERGREEN, |
691 | THERMAL_TYPE_SUMO, | ||
690 | }; | 692 | }; |
691 | 693 | ||
692 | struct radeon_voltage { | 694 | struct radeon_voltage { |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 8c9b2ef32c68..ac4efb0f1cb4 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -449,6 +449,9 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev, | |||
449 | case THERMAL_TYPE_EVERGREEN: | 449 | case THERMAL_TYPE_EVERGREEN: |
450 | temp = evergreen_get_temp(rdev); | 450 | temp = evergreen_get_temp(rdev); |
451 | break; | 451 | break; |
452 | case THERMAL_TYPE_SUMO: | ||
453 | temp = sumo_get_temp(rdev); | ||
454 | break; | ||
452 | default: | 455 | default: |
453 | temp = 0; | 456 | temp = 0; |
454 | break; | 457 | break; |
@@ -487,6 +490,7 @@ static int radeon_hwmon_init(struct radeon_device *rdev) | |||
487 | case THERMAL_TYPE_RV6XX: | 490 | case THERMAL_TYPE_RV6XX: |
488 | case THERMAL_TYPE_RV770: | 491 | case THERMAL_TYPE_RV770: |
489 | case THERMAL_TYPE_EVERGREEN: | 492 | case THERMAL_TYPE_EVERGREEN: |
493 | case THERMAL_TYPE_SUMO: | ||
490 | rdev->pm.int_hwmon_dev = hwmon_device_register(rdev->dev); | 494 | rdev->pm.int_hwmon_dev = hwmon_device_register(rdev->dev); |
491 | if (IS_ERR(rdev->pm.int_hwmon_dev)) { | 495 | if (IS_ERR(rdev->pm.int_hwmon_dev)) { |
492 | err = PTR_ERR(rdev->pm.int_hwmon_dev); | 496 | err = PTR_ERR(rdev->pm.int_hwmon_dev); |