]> git.baikalelectronics.ru Git - kernel.git/commit
drm/bridge/synopsys: dsi: handle endianness correctly in dw_mipi_dsi_write()
authorBrian Norris <briannorris@chromium.org>
Tue, 9 Jan 2018 20:32:48 +0000 (12:32 -0800)
committerArchit Taneja <architt@codeaurora.org>
Tue, 16 Jan 2018 06:51:52 +0000 (12:21 +0530)
commit5dfacf12375c3587a49c94d81c8ab87778b47a77
tree41b16e369f761074324ac4db86d8e8d31979430b
parent640bcac4c2068d9a25e381ce023622b6f5953223
drm/bridge/synopsys: dsi: handle endianness correctly in dw_mipi_dsi_write()

We're filling the "remainder" word with little-endian data, then writing
it out to IO registers with endian-correcting writel(). That probably
won't work on big-endian systems.

Let's mark the "remainder" variable as LE32 (since we fill it with
memcpy()) and do the swapping explicitly.

Some of this function could be done more easily without memcpy(), but
the unaligned "remainder" case is a little hard to do without
potentially overrunning 'tx_buf', so I just applied the same solution in
all cases (memcpy() + le32_to_cpu()).

Tested only on a little-endian system.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180109203248.139249-2-briannorris@chromium.org
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c