Skip to content

Commit 6b00e72

Browse files
miquelraynalsuperna9999
authored andcommitted
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: Miquel Raynal <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Maxime Ripard <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Tested-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 9943981 commit 6b00e72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix,
142142
u16 txbuf = ((prefix & 1) << 8) | data;
143143

144144
xfer.tx_buf = &txbuf;
145-
xfer.bits_per_word = 9;
146145
xfer.len = sizeof(txbuf);
147146

148147
return spi_sync_transfer(ctx->spi, &xfer, 1);
@@ -436,6 +435,11 @@ static int st7789v_probe(struct spi_device *spi)
436435
spi_set_drvdata(spi, ctx);
437436
ctx->spi = spi;
438437

438+
spi->bits_per_word = 9;
439+
ret = spi_setup(spi);
440+
if (ret < 0)
441+
return dev_err_probe(&spi->dev, ret, "Failed to setup spi\n");
442+
439443
ctx->info = device_get_match_data(&spi->dev);
440444

441445
drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs,

0 commit comments

Comments
 (0)