drm/amdgpu/pp: add missing byte swapping in process_pptables_v1_0.c
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Jun 2018 17:48:10 +0000 (12:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jul 2018 21:39:51 +0000 (16:39 -0500)
Values need to be swapped on big endian.

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c

index 35bd9870ab10811cd46c79adc3d8020267e828cd..4e1fd53938458ed3ff488ce5ad451abf12fe0480 100644 (file)
@@ -183,10 +183,10 @@ static int get_vddc_lookup_table(
                                        ATOM_Tonga_Voltage_Lookup_Record,
                                        entries, vddc_lookup_pp_tables, i);
                record->us_calculated = 0;
-               record->us_vdd = atom_record->usVdd;
-               record->us_cac_low = atom_record->usCACLow;
-               record->us_cac_mid = atom_record->usCACMid;
-               record->us_cac_high = atom_record->usCACHigh;
+               record->us_vdd = le16_to_cpu(atom_record->usVdd);
+               record->us_cac_low = le16_to_cpu(atom_record->usCACLow);
+               record->us_cac_mid = le16_to_cpu(atom_record->usCACMid);
+               record->us_cac_high = le16_to_cpu(atom_record->usCACHigh);
        }
 
        *lookup_table = table;