[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230714013756.1546769-17-sre@kernel.org>
Date: Fri, 14 Jul 2023 03:37:53 +0200
From: Sebastian Reichel <sre@...nel.org>
To: Sebastian Reichel <sre@...nel.org>
Cc: Gerald Loacker <gerald.loacker@...fvision.net>,
Michael Riesch <michael.riesch@...fvision.net>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Thierry Reding <thierry.reding@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org, Maxime Ripard <mripard@...nel.org>
Subject: [PATCH v3 16/19] drm/panel: sitronix-st7789v: Use 9 bits per spi word by default
From: Miquel Raynal <miquel.raynal@...tlin.com>
The Sitronix controller expects 9-bit words, provide this as default at
probe time rather than specifying this in each and every access.
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
Reviewed-by: Sam Ravnborg <sam@...nborg.org>
Acked-by: Maxime Ripard <mripard@...nel.org>
Reviewed-by: Sebastian Reichel <sre@...nel.org>
Tested-by: Sebastian Reichel <sre@...nel.org>
Signed-off-by: Sebastian Reichel <sre@...nel.org>
---
drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
index 55e475471f43..33bdf9ee4085 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
@@ -142,7 +142,6 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix,
u16 txbuf = ((prefix & 1) << 8) | data;
xfer.tx_buf = &txbuf;
- xfer.bits_per_word = 9;
xfer.len = sizeof(txbuf);
return spi_sync_transfer(ctx->spi, &xfer, 1);
@@ -436,6 +435,11 @@ static int st7789v_probe(struct spi_device *spi)
spi_set_drvdata(spi, ctx);
ctx->spi = spi;
+ spi->bits_per_word = 9;
+ ret = spi_setup(spi);
+ if (ret < 0)
+ return dev_err_probe(&spi->dev, ret, "Failed to setup spi\n");
+
ctx->info = device_get_match_data(&spi->dev);
drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs,
--
2.40.1
Powered by blists - more mailing lists