summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-11-11 00:46:49 +0100
committerLinus Walleij <linus.walleij@linaro.org>2020-11-16 00:46:50 +0100
commit49ef0c6d7dd2bdc3cee3dc004545a373742cd752 (patch)
tree00919814ac8405e39353be1dc8702c1963304296 /drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
parent846939118270863bc074fb734a1c2e0690ddb444 (diff)
downloadlinux-49ef0c6d7dd2bdc3cee3dc004545a373742cd752.tar.bz2
drm/panel: s6e63m0: Simplify SPI writing
This writing code is equivalent to the spi_write() helper in the SPI framework. Insert a comment that this will always work fine since SPI buffers are in native endianness. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Cc: Stephan Gerhold <stephan@gerhold.net> Cc: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201110234653.2248594-2-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c')
-rw-r--r--drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
index d298d780220d..75f00ed4810b 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
@@ -25,16 +25,9 @@ static int s6e63m0_spi_dcs_read(struct device *dev, const u8 cmd, u8 *data)
static int s6e63m0_spi_write_word(struct device *dev, u16 data)
{
struct spi_device *spi = to_spi_device(dev);
- struct spi_transfer xfer = {
- .len = 2,
- .tx_buf = &data,
- };
- struct spi_message msg;
- spi_message_init(&msg);
- spi_message_add_tail(&xfer, &msg);
-
- return spi_sync(spi, &msg);
+ /* SPI buffers are always in CPU order */
+ return spi_write(spi, &data, 2);
}
static int s6e63m0_spi_dcs_write(struct device *dev, const u8 *data, size_t len)