drm/panel: add fannal c3004 panel
Subsystems (4)
v2 cover drm/panel: add fannal c3004 panel
Fannal C3004 is a 2 lane MIPI DSI 480x800 panel which requires initialization with DSI DCS commands. After few initialization commands delay is required.
Paulo Pavacic (3):
dt-bindings: add fannal vendor prefix
dt-bindings: display: panel: add fannal,c3004 drm/panel-fannal-c3003: Add fannal c3004 DSI panel
.../bindings/display/panel/fannal,c3004.yaml | 78 +++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-fannal-c3004.c | 319 ++++++++++++++++++ 6 files changed, 418 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml create mode 100644 drivers/gpu/drm/panel/panel-fannal-c3004.c
Signature · 1 line
2.40.1
PATCH v2 1/3 dt-bindings: add fannal vendor prefix
Fannal is a one-stop-solution provider for touch displays in industrial application, committed to delivering a variety of professional high-quality products and technical services globally.
Website: www.fannal.com
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -462,6 +462,8 @@ patternProperties: description: Facebook "^fairphone,.*": description: Fairphone B.V. + "^fannal,.*": + description: Fannal Electronics Co., Ltd "^faraday,.*": description: Faraday Technology Corporation "^fastrax,.*":
Signature · 1 line
2.40.1
Re: [PATCH v2 1/3] dt-bindings: add fannal vendor prefix
Quoted 7 lines · Paulo Pavacic
Fannal is a one-stop-solution provider for touch displays in industrial application, committed to delivering a variety of professional high-quality products and technical services globally.
Website: www.fannal.com
Signed-off-by Paulo Pavacic <[email protected]>
Best regards,
Krzysztof
PATCH v2 2/3 dt-bindings: display: panel: add fannal,c3004
In reply to Paulo PavacicAdded fannal to vendor-prefixes and dt bindings for Fannal C3004. Fannal C3004 is a 480x800 MIPI DSI Panel which requires DCS initialization sequences with certain delays between certain commands.
---
v4 changelog:
- add spaces between properties
v3 changelog:
- renamed yml file
- refactored yml file to describe fannal,c3004
- added matrix URI to MAINTAINERS
v2 changelog:
- revised driver title, now describes purpose
- revised description, now describes hw
- revised maintainers, now has only 1 mail
- removed diacritics from commit/commit author
- properties/compatible is now enum
- compatible using only lowercase
- revised dts example
- modified MAINTAINERS in this commit (instead of driver commit)
- dt_bindings_check checked yml
- checkpatch warning fixed
--- .../bindings/display/panel/fannal,c3004.yaml | 78 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 84 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml
Documentation/devicetree/bindings/display/panel/fannal,c3004.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/fannal,c3004.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Fannal C3004 MIPI-DSI + +maintainers: + - Paulo Pavacic <[email protected]> + +description: | + Fannal C3004 is a 480x800 panel which requires DSI DCS + initialization sequences. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - const: fannal,c3004 + + reg: true + + reset-gpios: true + + vdd-supply: + description: power supply voltage + + vddio-supply: + description: power supply voltage for IO + + width-mm: + description: physical panel width [mm] + + height-mm: + description: physical panel height [mm] + + panel-timing: true + +required: + - compatible + - reg + - reset-gpios + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "fannal,c3004"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_rst>; + pinctrl-names = "default"; + reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + vdd-supply = <®1>; + vddio-supply = <®2>; + width-mm = <93>; + height-mm = <56>; + panel-timing { + clock-frequency = <27000000>; + hactive = <480>; + vactive = <800>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <8>; + vback-porch = <30>; + vfront-porch = <30>; + vsync-len = <8>; + }; + }; + }; +...
MAINTAINERS +6 -0
@@ -6427,6 +6427,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/ebbg,ft8719.yaml F: drivers/gpu/drm/panel/panel-ebbg-ft8719.c +DRM DRIVER FOR FANNAL C3004373132019A +M: Paulo Pavacic <[email protected]> +S: Maintained +C: matrix:r/mipi-dsi-bringup:matrix.org +F: Documentation/devicetree/bindings/display/panel/panel-fannal,c3004.yaml + DRM DRIVER FOR FARADAY TVE200 TV ENCODER M: Linus Walleij <[email protected]> S: Maintained
Signature · 1 line
2.40.1
Re: [PATCH v2 2/3] dt-bindings: display: panel: add fannal,c3004
Quoted 23 lines · Paulo Pavacic
Added fannal to vendor-prefixes and dt bindings for Fannal C3004. Fannal C3004 is a 480x800 MIPI DSI Panel which requires DCS initialization sequences with certain delays between certain commands.
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml new file +17
-0+ #include <dt-bindings/gpio/gpio.h> + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "fannal,c3004"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_rst>; + pinctrl-names = "default"; + reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + vdd-supply = <®1>; + vddio-supply = <®2>; + width-mm = <93>; + height-mm = <56>; + panel-timing { + clock-frequency = <27000000>; + hactive = <480>;
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml line 77
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml new file +10
-0+ vactive = <800>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <8>; + vback-porch = <30>; + vfront-porch = <30>; + vsync-len = <8>; + }; + }; + };
MAINTAINERS T: git git://anongit.freedesktop.org/drm/drm-misc · line 6433
Quoted 13 lines
+...
MAINTAINERS +4
-0@@ -6427,6 +6427,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/ebbg,ft8719.yaml F: drivers/gpu/drm/panel/panel-ebbg-ft8719.c +DRM DRIVER FOR FANNAL C3004373132019A +M: Paulo Pavacic <[email protected]> +S: Maintained +C: matrix:r/mipi-dsi-bringup:matrix.org
I don't think we have chat channels for individual, small drivers. Add a channel for entire subsystem.
Best regards,
Krzysztof
Re: [PATCH v2 2/3] dt-bindings: display: panel: add fannal,c3004
Hello Krzysztof,
uto, 6. lip 2023. u 09:10 Krzysztof Kozlowski
<[email protected]> napisao je:
Quoted 48 lines · Paulo Pavacic
Quoted 23 lines
Added fannal to vendor-prefixes and dt bindings for Fannal C3004. Fannal C3004 is a 480x800 MIPI DSI Panel which requires DCS initialization sequences with certain delays between certain commands.
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml new file +17
-0+ #include <dt-bindings/gpio/gpio.h> + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "fannal,c3004"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_rst>; + pinctrl-names = "default"; + reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + vdd-supply = <®1>; + vddio-supply = <®2>; + width-mm = <93>; + height-mm = <56>; + panel-timing { + clock-frequency = <27000000>; + hactive = <480>;Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml line 77
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml new file +10
-0+ vactive = <800>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <8>; + vback-porch = <30>; + vfront-porch = <30>; + vsync-len = <8>; + }; + }; + };Reviewed-by Krzysztof Kozlowski <[email protected]>Quoted 9 lines
+...
MAINTAINERS +0
-0@@ -6427,6 +6427,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/ebbg,ft8719.yaml F: drivers/gpu/drm/panel/panel-ebbg-ft8719.c
Quoted 7 lines
MAINTAINERS T: git git://anongit.freedesktop.org/drm/drm-misc · line 6433
Quoted 4 lines
MAINTAINERS +4
-0+DRM DRIVER FOR FANNAL C3004373132019A +M: Paulo Pavacic <[email protected]> +S: Maintained +C: matrix:r/mipi-dsi-bringup:matrix.orgI don't think we have chat channels for individual, small drivers. Add a channel for entire subsystem.
Okay I will add matrix:r/linux-drm:matrix.org
Quoted 4 lines
Best regards,
Krzysztof
Best regards,
Paulo
Re: [PATCH v2 2/3] dt-bindings: display: panel: add fannal,c3004
Quoted 29 lines · Paulo Pavacic
Quoted 29 lines
Quoted 27 lines
Documentation/devicetree/bindings/display/panel/fannal,c3004.yaml new file +27
-0+ #include <dt-bindings/gpio/gpio.h> + dsi { + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "fannal,c3004"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_rst>; + pinctrl-names = "default"; + reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + vdd-supply = <®1>; + vddio-supply = <®2>; + width-mm = <93>; + height-mm = <56>; + panel-timing { + clock-frequency = <27000000>; + hactive = <480>; + vactive = <800>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <8>; + vback-porch = <30>; + vfront-porch = <30>; + vsync-len = <8>; + }; + }; + };
Quoted 1 line
Quoted 1 line
Reviewed-by Krzysztof Kozlowski <[email protected]>
So this you decided to ignore?
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
+...
MAINTAINERS +0
-0@@ -6427,6 +6427,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/ebbg,ft8719.yaml F: drivers/gpu/drm/panel/panel-ebbg-ft8719.c
Quoted 8 lines
Quoted 7 lines
MAINTAINERS T: git git://anongit.freedesktop.org/drm/drm-misc · line 6433
Quoted 4 lines
MAINTAINERS +4
-0+DRM DRIVER FOR FANNAL C3004373132019A +M: Paulo Pavacic <[email protected]> +S: Maintained +C: matrix:r/mipi-dsi-bringup:matrix.orgI don't think we have chat channels for individual, small drivers. Add a channel for entire subsystem.
Okay I will add matrix:r/linux-drm:matrix.org
I meant, we do not have entries for individual drivers in MAINTAINERS with mailing lists or with chats. The entries covering entire subsystems have such links. We are not going to sign up for 100 different channels, each one per driver.
Best regards,
Krzysztof
PATCH v2 3/3 drm/panel-fannal-c3003: Add fannal c3004 DSI panel
In reply to Paulo PavacicFannal C3004 is a 480x800 display made by fannal that requires DCS initialization sequences.
---
v3 changelog:
- using generic mipi_dsi_dcs_write_seq
- removed success prints
- removed some comments
- simplified code/removed support for different panels
- changed namespace from fann to fannal
v2 changelog:
- renamed from panel-mipi-dsi-bringup
- only one MAINTAINER e-mail
--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-fannal-c3004.c | 319 +++++++++++++++++++++ 4 files changed, 332 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-fannal-c3004.c
MAINTAINERS +1 -0
@@ -6432,6 +6432,7 @@ M: Paulo Pavacic <[email protected]> S: Maintained C: matrix:r/mipi-dsi-bringup:matrix.org F: Documentation/devicetree/bindings/display/panel/panel-fannal,c3004.yaml +F: drivers/gpu/drm/panel/panel-fannal-c3004.c DRM DRIVER FOR FARADAY TVE200 TV ENCODER M: Linus Walleij <[email protected]>
drivers/gpu/drm/panel/Kconfig +11 -0
@@ -144,6 +144,17 @@ config DRM_PANEL_ELIDA_KD35T133 KD35T133 controller for 320x480 LCD panels with MIPI-DSI system interfaces. +config DRM_PANEL_FANNAL_C3004 + tristate "Fannal C3004 panel" + depends on OF + depends on DRM_MIPI_DSI + help + Say Y here if you want to enable support for the Fannal C3004 + 2-lane 480x800 MIPI DSI panel which requires initialization + sequence. + + If M is selected the module will be called panel-fannal-c3004. + config DRM_PANEL_FEIXIN_K101_IM2BA02 tristate "Feixin K101 IM2BA02 panel" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_EDP) += panel-edp.o obj-$(CONFIG_DRM_PANEL_EBBG_FT8719) += panel-ebbg-ft8719.o obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o +obj-$(CONFIG_DRM_PANEL_FANNAL_C3004) += panel-fannal-c3004.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_HIMAX_HX8394) += panel-himax-hx8394.o
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +319 -0
319 lines not on this page · raw message
Signature · 1 line
2.40.1
Re: [PATCH v2 3/3] drm/panel-fannal-c3003: Add fannal c3004 DSI panel
Quoted 8 lines · Paulo Pavacic
Fannal C3004 is a 480x800 display made by fannal that requires DCS initialization sequences.
Signed-off-by Paulo Pavacic <[email protected]>---
v3 changelog:
- using genericmipi_dsi_dcs_write_seq
This is marked as v2?
Quoted 14 lines
- removed success prints
- removed some comments
- simplified code/removed support for different panels
- changed namespace from fann to fannal
v2 changelog:
- renamed from panel-mipi-dsi-bringup
- only one MAINTAINER e-mail
---
MAINTAINERSdrivers/gpu/drm/panel/panel-fannal-c3004.c new file +3
-0+static int fannal_panel_probe (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev;
drivers/gpu/drm/panel/panel-fannal-c3004.c line 268
Quoted 10 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +10
-0+struct fannal_panel_data *panel_data; +int ret; + + panel_data =devm_kzalloc (&dsi->dev,sizeof (*panel_data),GFP_KERNEL ); + +if (!panel_data) +return -ENOMEM ; + + panel_data->reset =devm_gpiod_get_optional ( + dev,"reset" ,GPIOD_OUT_LOW |GPIOD_FLAGS_BIT_NONEXCLUSIVE );
dev should be in previous line
Why this is nonexclusive? How many instances of same driver are expecting to get this on one system?
drivers/gpu/drm/panel/panel-fannal-c3004.c line 274
Quoted 6 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +6
-0+ +if (IS_ERR (panel_data->reset)) { + ret =PTR_ERR (panel_data->reset); +dev_err (dev, +"error: probe: get reset GPIO: (%d) Check the fdt\n" , + ret);
return dev_err_probe
drivers/gpu/drm/panel/panel-fannal-c3004.c line 287
Quoted 13 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +13
-0+return ret; + } + +mipi_dsi_set_drvdata (dsi, panel_data); + + dsi->format =MIPI_DSI_FMT_RGB888 ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VSYNC_FLUSH |MIPI_DSI_MODE_VIDEO_HSE | +MIPI_DSI_MODE_NO_EOT_PACKET | +MIPI_DSI_MODE_VIDEO_SYNC_PULSE |MIPI_DSI_MODE_VIDEO ; + dsi->lanes =2 ; + +gpiod_set_value_cansleep (panel_data->reset,1 );
So you leave the panel in reset state?
drivers/gpu/drm/panel/panel-fannal-c3004.c line 298
Quoted 11 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +11
-0+ +drm_panel_init (&panel_data->panel, dev, &fannal_panel_funcs, +DRM_MODE_CONNECTOR_DSI ); +dev_set_drvdata (dev, panel_data); + +drm_panel_add (&panel_data->panel); + + ret =mipi_dsi_attach (dsi); +if (ret) { +drm_panel_remove (&panel_data->panel); +dev_err (dev,"error: probe fail: can't attach mipi_dsi!\n" );
No need to shout, skip exclamation mark.
Best regards,
Krzysztof
Re: [PATCH v2 3/3] drm/panel-fannal-c3003: Add fannal c3004 DSI panel
Hello Krzysztof,
uto, 6. lip 2023. u 09:14 Krzysztof Kozlowski
<[email protected]> napisao je:
Quoted 12 lines · Paulo Pavacic
Quoted 8 lines
Fannal C3004 is a 480x800 display made by fannal that requires DCS initialization sequences.
Signed-off-by Paulo Pavacic <[email protected]>---
v3 changelog:
- using genericmipi_dsi_dcs_write_seqThis is marked as v2?
I have ruined numbering. At first this driver was named panel-mipi-dsi-bringup and parts of it weren't handled under patchset.
Quoted 40 lines
Quoted 15 lines
- removed success prints
- removed some comments
- simplified code/removed support for different panels
- changed namespace from fann to fannal
v2 changelog:
- renamed from panel-mipi-dsi-bringup
- only one MAINTAINER e-mail
---
MAINTAINERSdrivers/gpu/drm/panel/panel-fannal-c3004.c new file +3
-0+static int fannal_panel_probe (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev;drivers/gpu/drm/panel/panel-fannal-c3004.c line 268
Quoted 10 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +10
-0+struct fannal_panel_data *panel_data; +int ret; + + panel_data =devm_kzalloc (&dsi->dev,sizeof (*panel_data),GFP_KERNEL ); + +if (!panel_data) +return -ENOMEM ; + + panel_data->reset =devm_gpiod_get_optional ( + dev,"reset" ,GPIOD_OUT_LOW |GPIOD_FLAGS_BIT_NONEXCLUSIVE );dev should be in previous line
Why this is nonexclusive? How many instances of same driver are expecting to get this on one system?
drivers/gpu/drm/panel/panel-fannal-c3004.c line 274
Quoted 6 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +6
-0+ +if (IS_ERR (panel_data->reset)) { + ret =PTR_ERR (panel_data->reset); +dev_err (dev, +"error: probe: get reset GPIO: (%d) Check the fdt\n" , + ret);return
dev_err_probe
Quoted 15 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c line 287
Quoted 13 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +13
-0+return ret; + } + +mipi_dsi_set_drvdata (dsi, panel_data); + + dsi->format =MIPI_DSI_FMT_RGB888 ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VSYNC_FLUSH |MIPI_DSI_MODE_VIDEO_HSE | +MIPI_DSI_MODE_NO_EOT_PACKET | +MIPI_DSI_MODE_VIDEO_SYNC_PULSE |MIPI_DSI_MODE_VIDEO ; + dsi->lanes =2 ; + +gpiod_set_value_cansleep (panel_data->reset,1 );So you leave the panel in reset state?
yes
Quoted 15 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c line 298
Quoted 11 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +11
-0+ +drm_panel_init (&panel_data->panel, dev, &fannal_panel_funcs, +DRM_MODE_CONNECTOR_DSI ); +dev_set_drvdata (dev, panel_data); + +drm_panel_add (&panel_data->panel); + + ret =mipi_dsi_attach (dsi); +if (ret) { +drm_panel_remove (&panel_data->panel); +dev_err (dev,"error: probe fail: can't attach mipi_dsi!\n" );No need to shout, skip exclamation mark.
Quoted 3 lines
Best regards,
Krzysztof
Thanks,
Paulo
Re: [PATCH v2 3/3] drm/panel-fannal-c3003: Add fannal c3004 DSI panel
Quoted 24 lines · Paulo Pavacic
Quoted 9 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c line 274
Quoted 6 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +6
-0+ +if (IS_ERR (panel_data->reset)) { + ret =PTR_ERR (panel_data->reset); +dev_err (dev, +"error: probe: get reset GPIO: (%d) Check the fdt\n" , + ret);return
dev_err_probeQuoted 15 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c line 287
Quoted 13 lines
drivers/gpu/drm/panel/panel-fannal-c3004.c new file +13
-0+return ret; + } + +mipi_dsi_set_drvdata (dsi, panel_data); + + dsi->format =MIPI_DSI_FMT_RGB888 ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VSYNC_FLUSH |MIPI_DSI_MODE_VIDEO_HSE | +MIPI_DSI_MODE_NO_EOT_PACKET | +MIPI_DSI_MODE_VIDEO_SYNC_PULSE |MIPI_DSI_MODE_VIDEO ; + dsi->lanes =2 ; + +gpiod_set_value_cansleep (panel_data->reset,1 );So you leave the panel in reset state?
Quoted 1 line
yes
Then why do you initialize GPIO to bring it out of reset and them immediately put into reset back? Just keep it in reset.
Best regards,
Krzysztof