summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2024-06-04 15:20:30 +0200
committerNoralf Trønnes <noralf@tronnes.org>2024-06-07 16:09:05 +0200
commitdf3fb27a74a4eeb1436129024a7e957c2e83a95e (patch)
tree5fa581b838af87aebbc139951010ed857dbd6236 /include/drm
parentf34f014c84122d38c70455911e7343016fc8eb14 (diff)
downloadlwn-df3fb27a74a4eeb1436129024a7e957c2e83a95e.tar.gz
lwn-df3fb27a74a4eeb1436129024a7e957c2e83a95e.zip
drm/mipi-dbi: Make bits per word configurable for pixel transfers
MIPI DCS write/set commands have 8 bit parameters except for the write_memory commands where it depends on the pixel format. drm_mipi_dbi does currently only support RGB565 which is 16-bit and it has to make sure that the pixels enters the SPI bus in big endian format since the MIPI DBI spec doesn't have support for little endian. drm_mipi_dbi is optimized for DBI interface option 3 which means that the 16-bit bytes are swapped by the upper layer if the SPI bus does not support 16 bits per word, signified by the swap_bytes member. In order to support both 16-bit and 24-bit pixel transfers we need a way to tell the DBI command layer the format of the buffer. Add a write_memory_bpw member that the upper layer can use to tell how many bits per word to use for the SPI transfer. v4: - Expand the commit message (Dmitry) Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240604-panel-mipi-dbi-rgb666-v4-3-d7c2bcb9b78d@tronnes.org Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_mipi_dbi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
index e8e0f8d39f3a..b36596efdcc3 100644
--- a/include/drm/drm_mipi_dbi.h
+++ b/include/drm/drm_mipi_dbi.h
@@ -57,6 +57,11 @@ struct mipi_dbi {
struct spi_device *spi;
/**
+ * @write_memory_bpw: Bits per word used on a MIPI_DCS_WRITE_MEMORY_START transfer
+ */
+ unsigned int write_memory_bpw;
+
+ /**
* @dc: Optional D/C gpio.
*/
struct gpio_desc *dc;