Commit 6b00e72e authored by Miquel Raynal's avatar Miquel Raynal Committed by Neil Armstrong

drm/panel: sitronix-st7789v: Use 9 bits per spi word by default

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Reviewed-by: default avatarSebastian Reichel <sre@kernel.org>
Tested-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230714013756.1546769-17-sre@kernel.org
parent 9943981a
...@@ -142,7 +142,6 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix, ...@@ -142,7 +142,6 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix,
u16 txbuf = ((prefix & 1) << 8) | data; u16 txbuf = ((prefix & 1) << 8) | data;
xfer.tx_buf = &txbuf; xfer.tx_buf = &txbuf;
xfer.bits_per_word = 9;
xfer.len = sizeof(txbuf); xfer.len = sizeof(txbuf);
return spi_sync_transfer(ctx->spi, &xfer, 1); return spi_sync_transfer(ctx->spi, &xfer, 1);
...@@ -436,6 +435,11 @@ static int st7789v_probe(struct spi_device *spi) ...@@ -436,6 +435,11 @@ static int st7789v_probe(struct spi_device *spi)
spi_set_drvdata(spi, ctx); spi_set_drvdata(spi, ctx);
ctx->spi = spi; 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); ctx->info = device_get_match_data(&spi->dev);
drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs, drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs,
......
Markdown is supported
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