Skip to content

Commit 900ab59

Browse files
pcercueisravnborg
authored andcommitted
drm/dbi: Fix SPI Type 1 (9-bit) transfer
The function mipi_dbi_spi1_transfer() will transfer its payload as 9-bit data, the 9th (MSB) bit being the data/command bit. In order to do that, it unpacks the 8-bit values into 16-bit values, then sets the 9th bit if the byte corresponds to data, clears it otherwise. The 7 MSB are padding. The array of now 16-bit values is then passed to the SPI core for transfer. This function was broken since its introduction, as the length of the SPI transfer was set to the payload size before its conversion, but the payload doubled in size due to the 8-bit -> 16-bit conversion. Fixes: 02dd95f ("drm/tinydrm: Add MIPI DBI support") Cc: <[email protected]> # 5.4+ Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Reviewed-by: Noralf Trønnes <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2a1658b commit 900ab59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_mipi_dbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc,
923923
}
924924
}
925925

926-
tr.len = chunk;
926+
tr.len = chunk * 2;
927927
len -= chunk;
928928

929929
ret = spi_sync(spi, &m);

0 commit comments

Comments
 (0)