aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index df69b92ba164..dbc94f300297 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -196,8 +196,8 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev)
196 } 196 }
197} 197}
198 198
199static struct radeon_gpio_rec radeon_lookup_gpio(struct radeon_device *rdev, 199struct radeon_gpio_rec radeon_atombios_lookup_gpio(struct radeon_device *rdev,
200 u8 id) 200 u8 id)
201{ 201{
202 struct atom_context *ctx = rdev->mode_info.atom_context; 202 struct atom_context *ctx = rdev->mode_info.atom_context;
203 struct radeon_gpio_rec gpio; 203 struct radeon_gpio_rec gpio;
@@ -221,6 +221,7 @@ static struct radeon_gpio_rec radeon_lookup_gpio(struct radeon_device *rdev,
221 if (id == pin->ucGPIO_ID) { 221 if (id == pin->ucGPIO_ID) {
222 gpio.id = pin->ucGPIO_ID; 222 gpio.id = pin->ucGPIO_ID;
223 gpio.reg = le16_to_cpu(pin->usGpioPin_AIndex) * 4; 223 gpio.reg = le16_to_cpu(pin->usGpioPin_AIndex) * 4;
224 gpio.shift = pin->ucGpioPinBitShift;
224 gpio.mask = (1 << pin->ucGpioPinBitShift); 225 gpio.mask = (1 << pin->ucGpioPinBitShift);
225 gpio.valid = true; 226 gpio.valid = true;
226 break; 227 break;
@@ -801,7 +802,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
801 hpd_record = 802 hpd_record =
802 (ATOM_HPD_INT_RECORD *) 803 (ATOM_HPD_INT_RECORD *)
803 record; 804 record;
804 gpio = radeon_lookup_gpio(rdev, 805 gpio = radeon_atombios_lookup_gpio(rdev,
805 hpd_record->ucHPDIntGPIOID); 806 hpd_record->ucHPDIntGPIOID);
806 hpd = radeon_atom_get_hpd_info_from_gpio(rdev, &gpio); 807 hpd = radeon_atom_get_hpd_info_from_gpio(rdev, &gpio);
807 hpd.plugged_state = hpd_record->ucPlugged_PinState; 808 hpd.plugged_state = hpd_record->ucPlugged_PinState;
@@ -2128,7 +2129,7 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2128 rdev->pm.power_state[state_index].clock_info[0].voltage.type = 2129 rdev->pm.power_state[state_index].clock_info[0].voltage.type =
2129 VOLTAGE_GPIO; 2130 VOLTAGE_GPIO;
2130 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio = 2131 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio =
2131 radeon_lookup_gpio(rdev, 2132 radeon_atombios_lookup_gpio(rdev,
2132 power_info->info.asPowerPlayInfo[i].ucVoltageDropIndex); 2133 power_info->info.asPowerPlayInfo[i].ucVoltageDropIndex);
2133 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH) 2134 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH)
2134 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high = 2135 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high =
@@ -2164,7 +2165,7 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2164 rdev->pm.power_state[state_index].clock_info[0].voltage.type = 2165 rdev->pm.power_state[state_index].clock_info[0].voltage.type =
2165 VOLTAGE_GPIO; 2166 VOLTAGE_GPIO;
2166 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio = 2167 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio =
2167 radeon_lookup_gpio(rdev, 2168 radeon_atombios_lookup_gpio(rdev,
2168 power_info->info_2.asPowerPlayInfo[i].ucVoltageDropIndex); 2169 power_info->info_2.asPowerPlayInfo[i].ucVoltageDropIndex);
2169 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH) 2170 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH)
2170 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high = 2171 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high =
@@ -2200,7 +2201,7 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
2200 rdev->pm.power_state[state_index].clock_info[0].voltage.type = 2201 rdev->pm.power_state[state_index].clock_info[0].voltage.type =
2201 VOLTAGE_GPIO; 2202 VOLTAGE_GPIO;
2202 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio = 2203 rdev->pm.power_state[state_index].clock_info[0].voltage.gpio =
2203 radeon_lookup_gpio(rdev, 2204 radeon_atombios_lookup_gpio(rdev,
2204 power_info->info_3.asPowerPlayInfo[i].ucVoltageDropIndex); 2205 power_info->info_3.asPowerPlayInfo[i].ucVoltageDropIndex);
2205 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH) 2206 if (misc & ATOM_PM_MISCINFO_VOLTAGE_DROP_ACTIVE_HIGH)
2206 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high = 2207 rdev->pm.power_state[state_index].clock_info[0].voltage.active_high =
@@ -2248,6 +2249,14 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r
2248 2249
2249 /* add the i2c bus for thermal/fan chip */ 2250 /* add the i2c bus for thermal/fan chip */
2250 if (controller->ucType > 0) { 2251 if (controller->ucType > 0) {
2252 if (controller->ucFanParameters & ATOM_PP_FANPARAMETERS_NOFAN)
2253 rdev->pm.no_fan = true;
2254 rdev->pm.fan_pulses_per_revolution =
2255 controller->ucFanParameters & ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK;
2256 if (rdev->pm.fan_pulses_per_revolution) {
2257 rdev->pm.fan_min_rpm = controller->ucFanMinRPM;
2258 rdev->pm.fan_max_rpm = controller->ucFanMaxRPM;
2259 }
2251 if (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) { 2260 if (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) {
2252 DRM_INFO("Internal thermal controller %s fan control\n", 2261 DRM_INFO("Internal thermal controller %s fan control\n",
2253 (controller->ucFanParameters & 2262 (controller->ucFanParameters &