diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi index b98b89298f2e1..8bc94b348dc83 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi @@ -6,6 +6,7 @@ */ #include "bl5340_dvk_nrf5340_cpuapp_common-pinctrl.dtsi" #include +#include / { chosen { @@ -130,6 +131,7 @@ rotation = <270>; width = <320>; height = <240>; + pixel-format = <0x20>; }; }; }; diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts index 1d9551c7cc132..4e1728a2fa834 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts @@ -9,7 +9,7 @@ #include "m5stack_core2-pinctrl.dtsi" #include "grove_connectors.dtsi" #include "m5stack_mbus_connectors.dtsi" -#include +#include #include #include @@ -68,7 +68,7 @@ mipi-max-frequency = <30000000>; reg = <0>; vin-supply = <&lcd_bg>; - pixel-format = ; + pixel-format = <0x20>; display-inversion; width = <320>; height = <240>; diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi index 3ec883e31fd5b..8fedc92ddc1ed 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include "m5stack_cores3-pinctrl.dtsi" #include "m5stack_mbus_connectors.dtsi" #include "grove_connectors.dtsi" @@ -56,7 +56,7 @@ mipi-max-frequency = <30000000>; reg = <0>; vin-supply = <&vcc_bl>; - pixel-format = ; + pixel-format = <0x20>; display-inversion; width = <320>; height = <240>; diff --git a/boards/m5stack/m5stack_fire/m5stack_fire_procpu.dts b/boards/m5stack/m5stack_fire/m5stack_fire_procpu.dts index 9cc132a6963f6..5a508369e365c 100644 --- a/boards/m5stack/m5stack_fire/m5stack_fire_procpu.dts +++ b/boards/m5stack/m5stack_fire/m5stack_fire_procpu.dts @@ -10,7 +10,7 @@ #include "m5stack_fire-pinctrl.dtsi" #include "grove_connectors.dtsi" #include "m5stack_mbus_connectors.dtsi" -#include +#include #include #include @@ -95,7 +95,7 @@ compatible = "ilitek,ili9342c"; mipi-max-frequency = <30000000>; reg = <0>; - pixel-format = ; + pixel-format = <0x20>; display-inversion; width = <320>; height = <240>; diff --git a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_mipi_dbi.overlay b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_mipi_dbi.overlay index acc98c5f2a94a..3a7e41c8c96bc 100644 --- a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_mipi_dbi.overlay +++ b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_mipi_dbi.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include / { @@ -52,7 +52,7 @@ reg = <0>; width = <240>; height = <320>; - pixel-format = ; + pixel-format = ; rotation = <0>; }; }; diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay index acc98c5f2a94a..fac0eaff57024 100644 --- a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include / { @@ -52,7 +52,7 @@ reg = <0>; width = <240>; height = <320>; - pixel-format = ; + pixel-format = <0x20>; rotation = <0>; }; }; diff --git a/boards/seeed/wio_terminal/wio_terminal.dts b/boards/seeed/wio_terminal/wio_terminal.dts index d50411aee2ad3..4aa5ccb07d278 100644 --- a/boards/seeed/wio_terminal/wio_terminal.dts +++ b/boards/seeed/wio_terminal/wio_terminal.dts @@ -8,7 +8,7 @@ #include "wio_terminal-pinctrl.dtsi" #include "grove_connectors.dtsi" #include "raspberrypi_40pins_connector.dtsi" -#include +#include #include / { @@ -148,7 +148,7 @@ compatible = "ilitek,ili9341"; mipi-max-frequency = <24000000>; reg = <0>; - pixel-format = ; + pixel-format = <0x20>; rotation = <270>; width = <320>; height = <240>; diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/boards/rd_rw612_bga.overlay b/boards/shields/adafruit_2_8_tft_touch_v2/boards/rd_rw612_bga.overlay index 9a6ed1d8541db..95de85a086582 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/boards/rd_rw612_bga.overlay +++ b/boards/shields/adafruit_2_8_tft_touch_v2/boards/rd_rw612_bga.overlay @@ -5,6 +5,7 @@ */ #include +#include / { chosen { @@ -44,7 +45,7 @@ reg = <0>; width = <320>; height = <240>; - pixel-format = ; + pixel-format = ; rotation = <90>; frmctr1 = [00 18]; pwctrl1 = [23 00]; diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi index ebf165acf5c00..6a9efd4f68cf9 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi +++ b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include / { @@ -35,7 +35,7 @@ reg = <0>; width = <320>; height = <240>; - pixel-format = ; + pixel-format = ; rotation = <90>; frmctr1 = [00 18]; pwctrl1 = [23 00]; diff --git a/boards/shields/buydisplay_2_8_tft_touch_arduino/buydisplay_2_8_tft_touch_arduino.overlay b/boards/shields/buydisplay_2_8_tft_touch_arduino/buydisplay_2_8_tft_touch_arduino.overlay index 69866276b339f..0a98fe02d0311 100644 --- a/boards/shields/buydisplay_2_8_tft_touch_arduino/buydisplay_2_8_tft_touch_arduino.overlay +++ b/boards/shields/buydisplay_2_8_tft_touch_arduino/buydisplay_2_8_tft_touch_arduino.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include / { @@ -36,7 +36,7 @@ reg = <0>; width = <240>; height = <320>; - pixel-format = ; + pixel-format = ; rotation = <0>; frmctr1 = [00 18]; pwctrl1 = [23 00]; diff --git a/boards/shields/buydisplay_3_5_tft_touch_arduino/buydisplay_3_5_tft_touch_arduino.overlay b/boards/shields/buydisplay_3_5_tft_touch_arduino/buydisplay_3_5_tft_touch_arduino.overlay index 7f2faa2df707b..8b240fb5ccf1f 100644 --- a/boards/shields/buydisplay_3_5_tft_touch_arduino/buydisplay_3_5_tft_touch_arduino.overlay +++ b/boards/shields/buydisplay_3_5_tft_touch_arduino/buydisplay_3_5_tft_touch_arduino.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include / { @@ -34,7 +34,7 @@ compatible = "ilitek,ili9488"; mipi-max-frequency = <25000000>; reg = <0>; - pixel-format = ; + pixel-format = ; width = <320>; height = <480>; rotation = <0>; diff --git a/boards/shields/x_nucleo_gfx01m2/x_nucleo_gfx01m2.overlay b/boards/shields/x_nucleo_gfx01m2/x_nucleo_gfx01m2.overlay index 9a302a2c0e46a..812fa68422d90 100644 --- a/boards/shields/x_nucleo_gfx01m2/x_nucleo_gfx01m2.overlay +++ b/boards/shields/x_nucleo_gfx01m2/x_nucleo_gfx01m2.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include @@ -74,7 +74,7 @@ width = <240>; height = <320>; rotation = <180>; - pixel-format = ; + pixel-format = ; frmctr1 = [00 1f]; /* 60Hz frame rate */ }; }; diff --git a/boards/st/st25dv_mb1283_disco/st25dv_mb1283_disco.dts b/boards/st/st25dv_mb1283_disco/st25dv_mb1283_disco.dts index 64db6092e969f..d2a22a51c33e4 100644 --- a/boards/st/st25dv_mb1283_disco/st25dv_mb1283_disco.dts +++ b/boards/st/st25dv_mb1283_disco/st25dv_mb1283_disco.dts @@ -8,7 +8,7 @@ #include "st/f4/stm32f405Xg.dtsi" #include "st/f4/stm32f405vgtx-pinctrl.dtsi" #include -#include +#include / { model = "ST ST25DV Discovery Kit with MB1283"; @@ -86,7 +86,7 @@ compatible = "ilitek,ili9341"; mipi-max-frequency = ; reg = <0>; - pixel-format = ; + pixel-format = <0x20>; rotation = <0>; width = <240>; height = <320>; diff --git a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts index 8637a7a858d83..b35309080ccd9 100644 --- a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts +++ b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts @@ -8,7 +8,7 @@ /dts-v1/; #include #include -#include +#include #include / { @@ -81,7 +81,7 @@ width = <240>; height = <320>; rotation = <180>; - pixel-format = ; + pixel-format = <0x20>; pwctrla = [39 2c 00 34 02]; pwctrlb = [00 c1 30]; timctrla = [85 00 78]; @@ -253,7 +253,7 @@ width = <240>; height = <320>; - pixel-format = ; + pixel-format = <0x20>; display-timings { compatible = "zephyr,panel-timing"; diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 0d3cc307219a0..76ec1d5ebb657 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -60,6 +60,15 @@ MDIO MDIO bus enabling/disabling is now handled internally by the MDIO drivers. (:github:`99690`). +Display +======= + +* For ILI9XXX controllers, the usage of ``ILI9XXX_PIXEL_FORMAT_x`` in devicetrees for panel color format selection + has been updated to ``PANEL_PIXEL_FORMAT_x``. Out-of-tree boards and shields should be updated accordingly. + (:github:`99267`). +* For ILI9341 controller, display mirroring configuration has been updated to conform with the described behavior + of the sample ``samples/drivers/display``. (:github:`99267`). + QSPI === diff --git a/drivers/display/display_ili9xxx.c b/drivers/display/display_ili9xxx.c index ef258cfed8922..f44af0956601d 100644 --- a/drivers/display/display_ili9xxx.c +++ b/drivers/display/display_ili9xxx.c @@ -7,8 +7,7 @@ */ #include "display_ili9xxx.h" - -#include +#include #include #include @@ -295,7 +294,7 @@ ili9xxx_set_pixel_format(const struct device *dev, uint8_t tx_data; uint8_t bytes_per_pixel; - if (pixel_format == PIXEL_FORMAT_RGB_565) { + if (pixel_format == PIXEL_FORMAT_RGB_565 || pixel_format == PIXEL_FORMAT_BGR_565) { bytes_per_pixel = 2U; tx_data = ILI9XXX_PIXSET_MCU_16_BIT | ILI9XXX_PIXSET_RGB_16_BIT; } else if (pixel_format == PIXEL_FORMAT_RGB_888) { @@ -324,7 +323,8 @@ static int ili9xxx_set_orientation(const struct device *dev, struct ili9xxx_data *data = dev->data; int r; - uint8_t tx_data = ILI9XXX_MADCTL_BGR; + uint8_t tx_data = data->pixel_format == PIXEL_FORMAT_BGR_565 + ? ILI9XXX_MADCTL_BGR : 0; if (config->quirks->cmd_set == CMD_SET_1) { if (orientation == DISPLAY_ORIENTATION_NORMAL) { tx_data |= ILI9XXX_MADCTL_MX; @@ -368,7 +368,7 @@ static void ili9xxx_get_capabilities(const struct device *dev, memset(capabilities, 0, sizeof(struct display_capabilities)); capabilities->supported_pixel_formats = - PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_RGB_888; + PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_RGB_888 | PIXEL_FORMAT_BGR_565; capabilities->current_pixel_format = data->pixel_format; if (data->orientation == DISPLAY_ORIENTATION_NORMAL || @@ -392,10 +392,15 @@ static int ili9xxx_configure(const struct device *dev) enum display_orientation orientation; /* pixel format */ - if (config->pixel_format == ILI9XXX_PIXEL_FORMAT_RGB565) { + if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_565) { pixel_format = PIXEL_FORMAT_RGB_565; - } else { + } else if (config->pixel_format == PANEL_PIXEL_FORMAT_BGR_565) { + pixel_format = PIXEL_FORMAT_BGR_565; + } else if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_888) { pixel_format = PIXEL_FORMAT_RGB_888; + } else { + LOG_ERR("Unsupported pixel format in DT"); + return -ENOTSUP; } r = ili9xxx_set_pixel_format(dev, pixel_format); @@ -511,7 +516,7 @@ static const struct ili9xxx_quirks ili9340_quirks = { #ifdef CONFIG_ILI9341 static const struct ili9xxx_quirks ili9341_quirks = { - .cmd_set = CMD_SET_1, + .cmd_set = CMD_SET_2, }; #endif diff --git a/drivers/display/display_ili9xxx.h b/drivers/display/display_ili9xxx.h index cb3774246c72a..b8491902df4cd 100644 --- a/drivers/display/display_ili9xxx.h +++ b/drivers/display/display_ili9xxx.h @@ -59,7 +59,7 @@ enum madctl_cmd_set { CMD_SET_1, /* Default for most of ILI9xxx display controllers */ - CMD_SET_2, /* Used by ILI9342c */ + CMD_SET_2, /* Used by ILI9342c & ILI9341 */ }; struct ili9xxx_quirks { diff --git a/dts/bindings/display/ilitek,ili9xxx-common.yaml b/dts/bindings/display/ilitek,ili9xxx-common.yaml index 7ce2f5eaa9c59..bcd32e0bcc071 100644 --- a/dts/bindings/display/ilitek,ili9xxx-common.yaml +++ b/dts/bindings/display/ilitek,ili9xxx-common.yaml @@ -8,23 +8,12 @@ description: | Ilitek ILI9XXX is a color TFT-LCD controller series. include: - - display-controller.yaml + - lcd-controller.yaml - name: mipi-dbi-spi-device.yaml property-blocklist: - te-delay properties: - pixel-format: - type: int - default: 0 - enum: - - 0 # RGB565 - - 1 # RGB888 - description: - Display pixel format. Note that when RGB888 pixel format is selected - only 6 color bits are actually used being in practice equivalent to - RGB666. - rotation: type: int default: 0 diff --git a/include/zephyr/dt-bindings/display/ili9xxx.h b/include/zephyr/dt-bindings/display/ili9xxx.h deleted file mode 100644 index 8035600fb90ef..0000000000000 --- a/include/zephyr/dt-bindings/display/ili9xxx.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2020 Teslabs Engineering S.L. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_DISPLAY_ILI9XXX_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_DISPLAY_ILI9XXX_H_ - -/* Pixel formats */ -#define ILI9XXX_PIXEL_FORMAT_RGB565 0U -#define ILI9XXX_PIXEL_FORMAT_RGB888 1U - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_DISPLAY_ILI9XXX_H_ */ diff --git a/tests/drivers/display/display_read_write/adafruit_2_8_tft_touch_rgb565.overlay b/tests/drivers/display/display_read_write/adafruit_2_8_tft_touch_rgb565.overlay index 5465b3c5c4108..d5fdbdcaee855 100644 --- a/tests/drivers/display/display_read_write/adafruit_2_8_tft_touch_rgb565.overlay +++ b/tests/drivers/display/display_read_write/adafruit_2_8_tft_touch_rgb565.overlay @@ -4,10 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include &adafruit_2_8_tft_touch_v2_ili9340 { - pixel-format = ; + pixel-format = ; }; &adafruit_2_8_tft_touch_v2_mipi_dbi {