Add ilitek ili9341 panel driver
Subsystems (5)
v3 cover Add ilitek ili9341 panel driver
From: Dillon Min <[email protected]>
Since the st,sf-tc240t-9370-t dts binding already exist in stm32f429-disco.dts but, the panel driver didn't get accepted from mainline. it's time to submit patch fot it.
This driver can support two different interface by different dts bindings:
- spi+dpi, use spi to configure register, dpi for graphic data. st,sf-tc240t-9370-t
- only spi, just like tiny/ili9341.c (actually, this part is copy from tiny) adafruit,yx240qv29
I submited the first patch last year, you can find it at [1]. this patch has one major difference from that one, which is replace the low level communication way, from spi_sync() to mipi_dbi_{command, command_stackbuf}() interface, referred from Linus's patch [2].
both the two dpi/dbi interface was tested on stm32f429-disco board, if anyone want to verify this patch, you need apply the clk patch for this board first, you can get it from [3]
[1] "drm/panel: Add ilitek ili9341 panel driver"
https://lore.kernel.org/lkml/[email protected]/
[2] "drm/panel: s6e63m0: Switch to DBI abstraction for SPI"
https://lore.kernel.org/dri-devel/[email protected]/
[3]
https://lore.kernel.org/lkml/[email protected]/
v3:
- add Fixes tags.
- collect reviewed-by tags from linus and jagan.
- replace DRM_ERROR() with dev_err() or drm_err().
- remove kernel-doc markers from struct ili9341_config{}.
- reorder include headers.
- remove the struct device *dev from struct ili9341{}.
- restructure the ili9341_probe() function, add two ili9341_{dbi,dpi)_probe() to make it more readable according to jagan's suggestion, thanks.
for the full drm driver exist in drm/panel need Sam and Laurent's feedback. so, not cover this part at this time, will be update in v4.
v2 link:
https://lore.kernel.org/lkml/[email protected]/
v2:
- replace vcc regulator to bulk regulators in driver, from linus suggestion.
- fix dtbs_check warnings on ili9341 dts binding check.
- add bulk regulation node in ilitek,ili9341.yaml.
v1 link:
https://lore.kernel.org/lkml/[email protected]/
Dillon Min (3):
dt-bindings: display: panel: Add ilitek ili9341 panel bindings
ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding drm/panel: Add ilitek ili9341 panel driver
.../bindings/display/panel/ilitek,ili9341.yaml | 78 ++ arch/arm/boot/dts/stm32f429-disco.dts | 2 +- drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 786 +++++++++++++++++++++ 5 files changed, 878 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9341.c
Signature · 1 line
2.7.4
PATCH v3 1/3 dt-bindings: display: panel: Add ilitek ili9341 panel bindings
From: Dillon Min <[email protected]>
Add documentation for "ilitek,ili9341" panel.
---
v3:
- collect reviewed-by tags from linus.
- add link address.
.../bindings/display/panel/ilitek,ili9341.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml
Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml new file +78 -0
@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/ilitek,ili9341.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek-9341 Display Panel + +maintainers: + - Dillon Min <[email protected]> + +description: | + Ilitek ILI9341 TFT panel driver with SPI control bus + This is a driver for 320x240 TFT panels, accepting a rgb input + streams with 16 bits or 18 bits. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - enum: + # ili9341 240*320 Color on stm32f429-disco board + - st,sf-tc240t-9370-t + - const: ilitek,ili9341 + + reg: true + + dc-gpios: + maxItems: 1 + description: Display data/command selection (D/CX) of this DBI panel + + spi-3wire: true + + spi-max-frequency: + const: 10000000 + + port: true + + vci-supply: + description: Analog voltage supply (2.5 .. 3.3V) + + vddi-supply: + description: Voltage supply for interface logic (1.65 .. 3.3 V) + + vddi-led-supply: + description: Voltage supply for the LED driver (1.65 .. 3.3 V) + +additionalProperties: false + +required: + - compatible + - reg + - dc-gpios + - port + +examples: + - |+ + spi { + #address-cells = <1>; + #size-cells = <0>; + panel: display@0 { + compatible = "st,sf-tc240t-9370-t", + "ilitek,ili9341"; + reg = <0>; + spi-3wire; + spi-max-frequency = <10000000>; + dc-gpios = <&gpiod 13 0>; + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; + }; +... +
Signature · 1 line
2.7.4
PATCH v3 2/3 ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding
In reply to [email protected]From: Dillon Min <[email protected]>
Since the compatible string defined from ilitek,ili9341.yaml is "st,sf-tc240t-9370-t", "ilitek,ili9341"
so, append "ilitek,ili9341" to avoid the below dtbs_check warning.
arch/arm/boot/dts/stm32f429-disco.dt.yaml: display@1: compatible:
['st,sf-tc240t-9370-t'] is too short
---
v3:
- add Fixes tags.
arch/arm/boot/dts/stm32f429-disco.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32f429-disco.dts +1 -1
@@ -192,7 +192,7 @@ display: display@1{ /* Connect panel-ilitek-9341 to ltdc */ - compatible = "st,sf-tc240t-9370-t"; + compatible = "st,sf-tc240t-9370-t", "ilitek,ili9341"; reg = <1>; spi-3wire; spi-max-frequency = <10000000>;
Signature · 1 line
2.7.4
PATCH v3 3/3 drm/panel: Add ilitek ili9341 panel driver
In reply to [email protected]From: Dillon Min <[email protected]>
This driver combines tiny/ili9341.c mipi_dbi_interface driver with mipi_dpi_interface driver, and can support ili9341 with serial mode or parallel rgb interface mode by register configuration.
---
v3:
all the v3 updates are based on Sam and Jagan's review.
- collect reviewed-by tags from linus and jagan.
- replace DRM_ERROR() with dev_err() or drm_err().
- remove kernel-doc markers from struct ili9341_config{}.
- reorder include headers.
- remove the struct device *dev from struct ili9341{}.
- restructure the ili9341_probe() function, add two ili9341_{dbi,dpi)_probe() to make it more readable according to jagan's suggestion, thanks.
For "So this is a full display driver. The more relevant home for this driver is inside drm/tiny/."
I'm not sure if this is to ask me move the dpi code to drm/tiny/ili9341.c, and remove this driver. or just remove the dbi code from this driver, but this will result in two drivers to support the same panel (as Noralf does not agree with it).
so, waiting for the decision from Sam, Laurent, then will update in v4, thanks.
drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 786 +++++++++++++++++++++++++++ 3 files changed, 799 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9341.c
drivers/gpu/drm/panel/Kconfig +12 -0
@@ -124,6 +124,18 @@ config DRM_PANEL_ILITEK_IL9322 Say Y here if you want to enable support for Ilitek IL9322 QVGA (320x240) RGB, YUV and ITU-T BT.656 panels. +config DRM_PANEL_ILITEK_ILI9341 + tristate "Ilitek ILI9341 240x320 QVGA panels" + depends on OF && SPI + depends on DRM_KMS_HELPER + depends on DRM_KMS_CMA_HELPER + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y here if you want to enable support for Ilitek IL9341 + QVGA (240x320) RGB panels. support serial & parallel rgb + interface. + config DRM_PANEL_ILITEK_ILI9881C tristate "Ilitek ILI9881C-based panels" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
drivers/gpu/drm/panel/panel-ilitek-ili9341.c new file +786 -0
786 lines not on this page · raw message
Signature · 1 line
2.7.4
kernel test robot
build botRe: [PATCH v3 3/3] drm/panel: Add ilitek ili9341 panel driver
Thank you for the patch! Yet something to improve:
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on stm32/stm32-next linus/master v5.14-rc2 next-20210723] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/dillon-minfei-gmail-com/Add-ilitek-ili9341-panel-driver/20210723-120751 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: m68k-allmodconfig (attached as .config) compiler: m68k-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ea18bb4522bcabac2dc1fd495c72be0fe2a120f8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review dillon-minfei-gmail-com/Add-ilitek-ili9341-panel-driver/20210723-120751 git checkout ea18bb4522bcabac2dc1fd495c72be0fe2a120f8
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/gpu/drm/panel/panel-ilitek-ili9341: struct of_device_id is 196 bytes. The last of 2 is:0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x61 0x64 0x61 0x66 0x72 0x75 0x69 0x74 0x2c 0x79 0x78 0x32 0x34 0x30 0x71 0x76 0x32 0x39 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
>> FATAL: modpost: drivers/gpu/drm/panel/panel-ilitek-ili9341: struct of_device_id is not terminated with a NULL entry!
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH v3 3/3] drm/panel: Add ilitek ili9341 panel driver
Hi lkp,
Thanks for pointing that out,
I missed "{}" at the end of struct of_device_id ili9341_of_match[].
I'll fix it in v4, with your Reported-by tags.
Thanks
Best Regards
Dillon
Quoted 38 lines · kernel test robot
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on stm32/stm32-next linus/master v5.14-rc2 next-20210723] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]url: https://github.com/0day-ci/linux/commits/dillon-minfei-gmail-com/Add-ilitek-ili9341-panel-driver/20210723-120751 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: m68k-allmodconfig (attached as .config) compiler: m68k-linux-gcc (GCC) 10.3.0reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ea18bb4522bcabac2dc1fd495c72be0fe2a120f8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review dillon-minfei-gmail-com/Add-ilitek-ili9341-panel-driver/20210723-120751 git checkoutea18bb4522bcabac2dc1fd495c72be0fe2a120f8
# save the attached .config to linux build tree
mkdirbuild_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bashIf you fix the issue, kindly add following tag as appropriate
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/gpu/drm/panel/panel-ilitek-ili9341: structof_device_idis 196 bytes. The last of 2 is:0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x610x640x610x660x720x750x690x740x2c0x790x780x320x340x300x710x760x320x390x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00Quoted 1 line
Quoted 1 line
FATAL: modpost:
drivers/gpu/drm/panel/panel-ilitek-ili9341: structof_device_idis not terminated with a NULL entry!---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org