From 55d22c4944824bf8e574fa056f0ec7bb08378b3e Mon Sep 17 00:00:00 2001 From: Ioannis Karachalios Date: Wed, 6 Mar 2024 18:33:27 +0200 Subject: [PATCH] boards: renesas: dts: Add overlay files to support LCDC In order to avoid defining almost the same overlays for different sample codes and/or applications a common overlay file per display interface is defined under the boards dts folder. In doing so, an application/sample code will only have to define another overlay explicitly under application's board folder if more blocks are to be enabled. In either case, users should explicitly invoke the requested overfiles at 'west build' invokation by using the DTC_OVERLAY_FILE system variable. (cherry picked from commit 6afea7c51cc802037e0809d4ce1c31a6256fee05) Original-Signed-off-by: Ioannis Karachalios GitOrigin-RevId: 6afea7c51cc802037e0809d4ce1c31a6256fee05 Change-Id: I9c8d1712cf9b72b5380d710ba7e08648c957a94b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5356059 Tested-by: ChromeOS Prod (Robot) Reviewed-by: Tristan Honscheid Commit-Queue: Tristan Honscheid Tested-by: Tristan Honscheid --- .../renesas/da1469x_dk_pro/da1469x_dk_pro.dts | 7 -- .../dts/da1469x_dk_pro_lcdc.overlay | 65 +++++++++++++++++++ .../dts}/da1469x_dk_pro_mipi_dbi.overlay | 11 +++- .../boards/da1469x_dk_pro_mipi_dbi.overlay | 31 --------- samples/drivers/display/sample.yaml | 2 +- 5 files changed, 75 insertions(+), 41 deletions(-) create mode 100644 boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay rename {samples/modules/lvgl/demos/boards => boards/renesas/da1469x_dk_pro/dts}/da1469x_dk_pro_mipi_dbi.overlay (79%) delete mode 100644 samples/drivers/display/boards/da1469x_dk_pro_mipi_dbi.overlay diff --git a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts index 9c019fa3a0c..f83098f6f19 100644 --- a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts +++ b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts @@ -172,10 +172,3 @@ zephyr_udc0: &usbd { pinctrl-0 = <&spi2_controller>; pinctrl-names = "default"; }; - -&mipi_dbi { - pinctrl-0 = <&mipi_dbi_default>; - pinctrl-1 = <&mipi_dbi_read>; - pinctrl-2 = <&mipi_dbi_sleep>; - pinctrl-names = "default", "read", "sleep"; -}; diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay new file mode 100644 index 00000000000..afdfb061c05 --- /dev/null +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Renesas Electronics Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include + #include + +/ { + chosen { + zephyr,display = &lcdc; + }; + + lvgl_pointer { + input = <&display_touch>; + status = "okay"; + swap-xy; + }; +}; + +&dma { + status = "okay"; +}; + +&i2c2 { + clock-frequency = <400000>; + + display_touch: ft6206@38 { + compatible = "focaltech,ft5336"; + status = "okay"; + reg = <0x38>; + int-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; + }; +}; + +&lcdc { + status = "okay"; + pinctrl-0 = <&display_controller_default>; + pinctrl-names = "default"; + width = <480>; + height = <272>; + disp-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + pixel-format = ; + + /* + * Panel settings for the NHD-4.3-480272EF-ASXP-CTP + * display panel model which integrates the SC7283 + * driver IC. + */ + display-timings { + compatible = "zephyr,panel-timing"; + hsync-len = <2>; + hfront-porch = <2>; + hback-porch = <3>; + vsync-len = <2>; + vfront-porch = <2>; + vback-porch = <2>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <1>; + clock-frequency = <12000000>; + }; +}; diff --git a/samples/modules/lvgl/demos/boards/da1469x_dk_pro_mipi_dbi.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay similarity index 79% rename from samples/modules/lvgl/demos/boards/da1469x_dk_pro_mipi_dbi.overlay rename to boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay index adf3a174c74..81dbc363d62 100644 --- a/samples/modules/lvgl/demos/boards/da1469x_dk_pro_mipi_dbi.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay @@ -32,10 +32,17 @@ }; }; -&mipi_dbi { - reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; +&lcdc { + compatible = "renesas,smartbond-mipi-dbi"; status = "okay"; + reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; spi-dev = <&spi2>; + pinctrl-0 = <&mipi_dbi_default>; + pinctrl-1 = <&mipi_dbi_read>; + pinctrl-2 = <&mipi_dbi_sleep>; + pinctrl-names = "default", "read", "sleep"; + #address-cells = <1>; + #size-cells = <0>; ili9340: ili9340@0 { compatible = "ilitek,ili9340"; diff --git a/samples/drivers/display/boards/da1469x_dk_pro_mipi_dbi.overlay b/samples/drivers/display/boards/da1469x_dk_pro_mipi_dbi.overlay deleted file mode 100644 index 81a4bdd8645..00000000000 --- a/samples/drivers/display/boards/da1469x_dk_pro_mipi_dbi.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Renesas Electronics Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include - #include - - / { - chosen { - zephyr,display = &ili9340; - }; - }; - - &mipi_dbi { - reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; - status = "okay"; - spi-dev = <&spi2>; - - ili9340: ili9340@0 { - compatible = "ilitek,ili9340"; - mipi-max-frequency = <48000000>; - status = "okay"; - reg = <0>; - width = <240>; - height = <320>; - pixel-format = ; - rotation = <0>; - }; -}; diff --git a/samples/drivers/display/sample.yaml b/samples/drivers/display/sample.yaml index 2b834dab0f6..39b56903b92 100644 --- a/samples/drivers/display/sample.yaml +++ b/samples/drivers/display/sample.yaml @@ -110,7 +110,7 @@ tests: sample.display.mipi_dbi: platform_allow: - da1469x_dk_pro - extra_args: DTC_OVERLAY_FILE="boards/da1469x_dk_pro_mipi_dbi.overlay" + extra_args: DTC_OVERLAY_FILE="da1469x_dk_pro_mipi_dbi.overlay" tags: - display - mipi_dbi