Skip to content
Commit 478f32ab authored by Prashant Malani's avatar Prashant Malani
Browse files

platform/chrome: cros_typec_vdm: Fix VDO copy

The usage of memcpy() affects the representation of the VDOs as they are
copied to the EC Host Command buffer. Specifically, all higher order
bits get dropped (for example: a VDO of 0x406 just gets copied as 0x6).

Avoid this by explicitly copying each VDO in the array. The number of
VDOs generated by alternate mode drivers in their VDMs is almost always
just 1 (apart from the header) so this doesn't affect performance in a
meaningful way).

Fixes: 40a9b13a

 ("platform/chrome: cros_typec_vdm: Add VDM send support")
Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20230113182626.1149539-1-pmalani@chromium.org
Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
parent 13aba1e5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment