From a046ff2df85bbab113ed3f78d94d5f957a16df7c Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 2 Feb 2022 23:30:22 +0100 Subject: video: add MIPI DBI Type C Option 3 support Import the Linux v5.15 state of the driver to allow easy porting of MIPI-DBI displays like the Ilitek 9431 added in a follow-up commit. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220202223023.341817-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- commands/Kconfig | 15 ++ commands/Makefile | 1 + commands/mipi_dbi.c | 104 ++++++++++ drivers/video/Kconfig | 3 + drivers/video/Makefile | 1 + drivers/video/mipi_dbi.c | 467 +++++++++++++++++++++++++++++++++++++++++++ include/spi/spi.h | 20 ++ include/video/mipi_dbi.h | 105 ++++++++++ include/video/mipi_display.h | 150 ++++++++++++++ 9 files changed, 866 insertions(+) create mode 100644 commands/mipi_dbi.c create mode 100644 drivers/video/mipi_dbi.c create mode 100644 include/video/mipi_dbi.h create mode 100644 include/video/mipi_display.h diff --git a/commands/Kconfig b/commands/Kconfig index ba8ca5cdeb..caef1e8fb5 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -1969,6 +1969,21 @@ config CMD_SPI -w BIT bits per word (default 8) -v verbose +config CMD_MIPI_DBI + bool + depends on DRIVER_VIDEO_MIPI_DBI && SPI + select PRINTF_HEXSTR + prompt "mipi_dbi command" + help + write/read from MIPI DBI SPI device + + Usage: mipi_dbi [-wld] [REG] [DATA...] + + Options: + -l list all MIPI DBI devices + -d DEVICE select specific device (default is first registered) + -w issue write command + config CMD_LED_TRIGGER bool depends on LED_TRIGGERS diff --git a/commands/Makefile b/commands/Makefile index db78d0b877..fffb6d979e 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -67,6 +67,7 @@ obj-$(CONFIG_CMD_GPIO) += gpio.o obj-$(CONFIG_CMD_UNCOMPRESS) += uncompress.o obj-$(CONFIG_CMD_I2C) += i2c.o obj-$(CONFIG_CMD_SPI) += spi.o +obj-$(CONFIG_CMD_MIPI_DBI) += mipi_dbi.o obj-$(CONFIG_CMD_UBI) += ubi.o obj-$(CONFIG_CMD_UBIFORMAT) += ubiformat.o obj-$(CONFIG_CMD_MENU) += menu.o diff --git a/commands/mipi_dbi.c b/commands/mipi_dbi.c new file mode 100644 index 0000000000..b9b665b721 --- /dev/null +++ b/commands/mipi_dbi.c @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: © 2022 Ahmad Fatoum + +#include +#include +#include +#include