diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-08-07 19:34:53 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-08-30 16:30:38 -0400 |
commit | 4543eda52113d1e2cc0e9bf416f79597e6ef1ec7 (patch) | |
tree | 16ea2493eb505eaedd2c933348a1440d5e82aa7d /drivers/gpu/drm/radeon/atombios_dp.c | |
parent | 1bd4cff651350380f9fb6847313cb78e84c03846 (diff) |
drm/radeon: fix endian bugs in hw i2c atom routines
Need to swap the data fetched over i2c properly. This
is the same fix as the endian fix for aux channel
transactions.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_dp.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_dp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 32501f6ec991..16023986d301 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
@@ -50,7 +50,7 @@ static char *pre_emph_names[] = { | |||
50 | * or from atom. Note that atom operates on | 50 | * or from atom. Note that atom operates on |
51 | * dw units. | 51 | * dw units. |
52 | */ | 52 | */ |
53 | static void radeon_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le) | 53 | void radeon_atom_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le) |
54 | { | 54 | { |
55 | #ifdef __BIG_ENDIAN | 55 | #ifdef __BIG_ENDIAN |
56 | u8 src_tmp[20], dst_tmp[20]; /* used for byteswapping */ | 56 | u8 src_tmp[20], dst_tmp[20]; /* used for byteswapping */ |
@@ -100,7 +100,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
100 | 100 | ||
101 | base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1); | 101 | base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1); |
102 | 102 | ||
103 | radeon_copy_swap(base, send, send_bytes, true); | 103 | radeon_atom_copy_swap(base, send, send_bytes, true); |
104 | 104 | ||
105 | args.v1.lpAuxRequest = cpu_to_le16((u16)(0 + 4)); | 105 | args.v1.lpAuxRequest = cpu_to_le16((u16)(0 + 4)); |
106 | args.v1.lpDataOut = cpu_to_le16((u16)(16 + 4)); | 106 | args.v1.lpDataOut = cpu_to_le16((u16)(16 + 4)); |
@@ -137,7 +137,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
137 | recv_bytes = recv_size; | 137 | recv_bytes = recv_size; |
138 | 138 | ||
139 | if (recv && recv_size) | 139 | if (recv && recv_size) |
140 | radeon_copy_swap(recv, base + 16, recv_bytes, false); | 140 | radeon_atom_copy_swap(recv, base + 16, recv_bytes, false); |
141 | 141 | ||
142 | return recv_bytes; | 142 | return recv_bytes; |
143 | } | 143 | } |