diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 173f378428a9..fda1e4130af7 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -3397,6 +3397,50 @@ radeon_atom_is_voltage_gpio(struct radeon_device *rdev, | |||
3397 | return false; | 3397 | return false; |
3398 | } | 3398 | } |
3399 | 3399 | ||
3400 | int radeon_atom_get_svi2_info(struct radeon_device *rdev, | ||
3401 | u8 voltage_type, | ||
3402 | u8 *svd_gpio_id, u8 *svc_gpio_id) | ||
3403 | { | ||
3404 | int index = GetIndexIntoMasterTable(DATA, VoltageObjectInfo); | ||
3405 | u8 frev, crev; | ||
3406 | u16 data_offset, size; | ||
3407 | union voltage_object_info *voltage_info; | ||
3408 | union voltage_object *voltage_object = NULL; | ||
3409 | |||
3410 | if (atom_parse_data_header(rdev->mode_info.atom_context, index, &size, | ||
3411 | &frev, &crev, &data_offset)) { | ||
3412 | voltage_info = (union voltage_object_info *) | ||
3413 | (rdev->mode_info.atom_context->bios + data_offset); | ||
3414 | |||
3415 | switch (frev) { | ||
3416 | case 3: | ||
3417 | switch (crev) { | ||
3418 | case 1: | ||
3419 | voltage_object = (union voltage_object *) | ||
3420 | atom_lookup_voltage_object_v3(&voltage_info->v3, | ||
3421 | voltage_type, | ||
3422 | VOLTAGE_OBJ_SVID2); | ||
3423 | if (voltage_object) { | ||
3424 | *svd_gpio_id = voltage_object->v3.asSVID2Obj.ucSVDGpioId; | ||
3425 | *svc_gpio_id = voltage_object->v3.asSVID2Obj.ucSVCGpioId; | ||
3426 | } else { | ||
3427 | return -EINVAL; | ||
3428 | } | ||
3429 | break; | ||
3430 | default: | ||
3431 | DRM_ERROR("unknown voltage object table\n"); | ||
3432 | return -EINVAL; | ||
3433 | } | ||
3434 | break; | ||
3435 | default: | ||
3436 | DRM_ERROR("unknown voltage object table\n"); | ||
3437 | return -EINVAL; | ||
3438 | } | ||
3439 | |||
3440 | } | ||
3441 | return 0; | ||
3442 | } | ||
3443 | |||
3400 | int radeon_atom_get_max_voltage(struct radeon_device *rdev, | 3444 | int radeon_atom_get_max_voltage(struct radeon_device *rdev, |
3401 | u8 voltage_type, u16 *max_voltage) | 3445 | u8 voltage_type, u16 *max_voltage) |
3402 | { | 3446 | { |