dt-bindings: display: panel: Add Novatek NT36523 bindings
Subsystems (5)
Jianhua Lu
maintainerPATCH v2 1/2 dt-bindings: display: panel: Add Novatek NT36523 bindings
Novatek NT36523 is a display driver IC used to drive DSI panels.
---
Changes in v2:
- Drop unnecessary description
- dsi0 -> dsi
- Correct indentation
.../display/panel/novatek,nt36523.yaml | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml
Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml new file +95 -0
@@ -0,0 +1,95 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/novatek,nt36523.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Novatek NT36523 based DSI display Panels + +maintainers: + - Jianhua Lu <[email protected]> + +description: | + The Novatek NT36523 is a generic DSI Panel IC used to drive dsi + panels. Support video mode panels from China Star Optoelectronics + Technology (CSOT) and BOE Technology. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - enum: + - xiaomi,elish-boe-nt36523 + - xiaomi,elish-csot-nt36523 + - const: novatek,nt36523 + + reset-gpios: + maxItems: 1 + description: phandle of gpio for reset line - This should be 8mA + + vddio-supply: + description: regulator that supplies the I/O voltage + + vddpos-supply: + description: positive boost supply regulator + + vddneg-supply: + description: negative boost supply regulator + + reg: true + ports: true + backlight: true + +required: + - compatible + - reg + - vddio-supply + - vddpos-supply + - vddneg-supply + - reset-gpios + - ports + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "xiaomi,elish-csot-nt36523", "novatek,nt36523"; + reg = <0>; + vddio-supply = <&vreg_l14a_1p88>; + vddpos-supply = <&lcd_vddpos_5p5>; + vddneg-supply = <&lcd_vddneg_5p5>; + + backlight = <&backlight>; + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + panel_in_0: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + + port@1{ + reg = <1>; + panel_in_1: endpoint { + remote-endpoint = <&dsi1_out>; + }; + }; + }; + }; + }; + +...
Signature · 1 line
2.39.2
Jianhua Lu
maintainerPATCH v2 2/2 drm/panel: Add driver for Novatek NT36523
Add a driver for panels using the Novatek NT36523 display driver IC.
---
Changes in v2:
- Refactor and clean up source code
MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-novatek-nt36523.c | 832 ++++++++++++++++++ 4 files changed, 850 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36523.c
MAINTAINERS +7 -0
@@ -6538,6 +6538,13 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/sony,acx424akp.yaml F: drivers/gpu/drm/panel/panel-novatek-nt35560.c +DRM DRIVER FOR NOVATEK NT36523 PANELS +M: Jianhua Lu <[email protected]> +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml +F: drivers/gpu/drm/panel/panel-novatek-nt36523.c + DRM DRIVER FOR NOVATEK NT36672A PANELS M: Sumit Semwal <[email protected]> S: Maintained
drivers/gpu/drm/panel/Kconfig +10 -0
@@ -377,6 +377,16 @@ config DRM_PANEL_NOVATEK_NT35950 Sharp panels used in Sony Xperia Z5 Premium and XZ Premium mobile phones. +config DRM_PANEL_NOVATEK_NT36523 + tristate "Novatek NT36523 panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the panels built + around the Novatek NT36523 display controller, such as some + Boe panels used in Xiaomi Mi Pad 5 and 5 Pro tablets. + config DRM_PANEL_NOVATEK_NT36672A tristate "Novatek NT36672A DSI panel" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3052C) += panel-newvision-nv3052c.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35560) += panel-novatek-nt35560.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35950) += panel-novatek-nt35950.o +obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36523) += panel-novatek-nt36523.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +832 -0
832 lines not on this page · raw message
Signature · 1 line
2.39.2
Quoted 7 lines · Jianhua Lu
Novatek NT36523 is a display driver IC used to drive DSI panels.
Signed-off-by Jianhua Lu <[email protected]>---
Changes in v2:
- Drop unnecessary description
- dsi0 -> dsi
Best regards,
Krzysztof
Quoted 8 lines · Jianhua Lu
Novatek NT36523 is a display driver IC used to drive DSI panels.
Signed-off-by Jianhua Lu <[email protected]>---
Changes in v2:
- Drop unnecessary description
- dsi0 -> dsi
- Correct indentation
I'd like Konrad and Neil to look at this before we merge it.
Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml line 50
Quoted 6 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml new file +6
-0+required: + - compatible + - reg + - vddio-supply + - vddpos-supply + - vddneg-supply
It appears vddpos and vddneg are not necessary on
all variants, can they be made non-required?
It is also possible to do some - if -construction of course based on the compatible, if we want to be fancy.
Yours,
Linus Walleij
Re: [PATCH v2 2/2] drm/panel: Add driver for Novatek NT36523
In reply to Jianhua LuHi Jianhua,
thanks for your patch!
It appears Konrad is working on a very similar driver, so I suggest merging them into one Novatek NT36523 driver.
Possibly we can fix this up first and then add Konrads Lenovo-panel with a patch on top.
Quoted 3 lines · Jianhua Lu
Add a driver for panels using the Novatek NT36523 display driver IC.
Signed-off-by Jianhua Lu <[email protected]>
(...)
I like how you abstract the panel with init commands in the panel info.
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+enum dsi_cmd_type { +INIT_DCS_CMD , +DELAY_CMD , +}; + +struct panel_init_cmd { +enum dsi_cmd_type type; +size_t len; +const char *data; +};
drivers/gpu/drm/panel/panel-novatek-nt36523.c line 71
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+ +#define _INIT_DCS_CMD (...) { \ + .type = INIT_DCS_CMD, \ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} } + +#define _INIT_DELAY_CMD (...) { \ + .type = DELAY_CMD,\ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} }
I have seen this type of reinvented wheels a few times now. Don't do this.
Look into other recently merged drivers and look how they do it, for example drivers/gpu/drm/panel/panel-himax-hx8394.c
For example:
- Use mipi_dsi_dcs_write_seq()
- If the delay is just used at one point in the sequence, do not invent a command language like above for it, open code the delay instead
- Try to decode as much magic as possible, if you look in Konrads driver you clearly see some standard MIPI commands, I bet you have some too.
- Maybe use callbacks to send sequences instead of tables, like in the himax driver?
Other than that it seems like something that could also handle the Lenovo display, or the other way around, I don't know which driver is the best starting point, but this one has the right Novatek name at least.
Yours,
Linus Walleij
Jianhua Lu
maintainerQuoted 20 lines · Linus Walleij
Quoted 8 lines · Jianhua Lu
Novatek NT36523 is a display driver IC used to drive DSI panels.
Signed-off-by Jianhua Lu <[email protected]>---
Changes in v2:
- Drop unnecessary description
- dsi0 -> dsi
- Correct indentationI'd like Konrad and Neil to look at this before we merge it.
Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml line 50
Quoted 6 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml new file +6
-0+required: + - compatible + - reg + - vddio-supply + - vddpos-supply + - vddneg-supply
Quoted 2 lines
It appears vddpos and vddneg are not necessary on
all variants, can they be made non-required?
It can be non-required, this panel's positive regulator and negative regulator are supplied by backlight IC, the both regulator of Konrad's NT36523W panel are supplied by secure firmware layer.
Quoted 6 lines
It is also possible to do some - if -construction of course based on the compatible, if we want to be fancy.
Yours,
Linus Walleij
Jianhua Lu
maintainerRe: [PATCH v2 2/2] drm/panel: Add driver for Novatek NT36523
In reply to Linus WalleijQuoted 53 lines · Linus Walleij
Hi Jianhua,
thanks for your patch!
It appears Konrad is working on a very similar driver, so I suggest merging them into one Novatek NT36523 driver.
Possibly we can fix this up first and then add Konrads Lenovo-panel with a patch on top.
Quoted 3 lines · Jianhua Lu
Add a driver for panels using the Novatek NT36523 display driver IC.
Signed-off-by Jianhua Lu <[email protected]>(...)
I like how you abstract the panel with init commands in the panel info.
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+enum dsi_cmd_type { +INIT_DCS_CMD , +DELAY_CMD , +}; + +struct panel_init_cmd { +enum dsi_cmd_type type; +size_t len; +const char *data; +};drivers/gpu/drm/panel/panel-novatek-nt36523.c line 71
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+ +#define _INIT_DCS_CMD (...) { \ + .type = INIT_DCS_CMD, \ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} } + +#define _INIT_DELAY_CMD (...) { \ + .type = DELAY_CMD,\ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} }I have seen this type of reinvented wheels a few times now. Don't do this.
Look into other recently merged drivers and look how they do it, for example
drivers/gpu/drm/panel/panel-himax-hx8394.cFor example:
- Use
mipi_dsi_dcs_write_seq()- If the delay is just used at one point in the sequence, do not invent a command language like above for it, open code the delay instead
Quoted 6 lines
- Try to decode as much magic as possible, if you look in Konrads driver you clearly see some standard MIPI commands, I bet you have some too.
- Maybe use callbacks to send sequences instead of tables, like in the himax driver?
I use init cmd tables in order to send init sequences to dsi0 and dsi1 at the same time (sync dual dsi mode). I don't found a convenient way to use mipi_dsi_dcs_write_seq() for sync dual dsi mode.
Quoted 7 lines
Other than that it seems like something that could also handle the Lenovo display, or the other way around, I don't know which driver is the best starting point, but this one has the right Novatek name at least.
Yours,
Linus Walleij
Jianhua Lu
maintainerRe: [PATCH v2 2/2] drm/panel: Add driver for Novatek NT36523
In reply to Linus WalleijQuoted 53 lines · Linus Walleij
Hi Jianhua,
thanks for your patch!
It appears Konrad is working on a very similar driver, so I suggest merging them into one Novatek NT36523 driver.
Possibly we can fix this up first and then add Konrads Lenovo-panel with a patch on top.
Quoted 3 lines · Jianhua Lu
Add a driver for panels using the Novatek NT36523 display driver IC.
Signed-off-by Jianhua Lu <[email protected]>(...)
I like how you abstract the panel with init commands in the panel info.
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+enum dsi_cmd_type { +INIT_DCS_CMD , +DELAY_CMD , +}; + +struct panel_init_cmd { +enum dsi_cmd_type type; +size_t len; +const char *data; +};drivers/gpu/drm/panel/panel-novatek-nt36523.c line 71
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+ +#define _INIT_DCS_CMD (...) { \ + .type = INIT_DCS_CMD, \ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} } + +#define _INIT_DELAY_CMD (...) { \ + .type = DELAY_CMD,\ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} }I have seen this type of reinvented wheels a few times now. Don't do this.
Look into other recently merged drivers and look how they do it, for example
drivers/gpu/drm/panel/panel-himax-hx8394.cFor example:
- Use
mipi_dsi_dcs_write_seq()- If the delay is just used at one point in the sequence, do not invent a command language like above for it, open code the delay instead
Quoted 6 lines
- Try to decode as much magic as possible, if you look in Konrads driver you clearly see some standard MIPI commands, I bet you have some too.
- Maybe use callbacks to send sequences instead of tables, like in the himax driver?
Maybe I should create a wrapper of mipi_dsi_dcs_write_seq() for sync dual dsi mode.
Quoted 7 lines
Other than that it seems like something that could also handle the Lenovo display, or the other way around, I don't know which driver is the best starting point, but this one has the right Novatek name at least.
Yours,
Linus Walleij
Re: [PATCH v2 2/2] drm/panel: Add driver for Novatek NT36523
Quoted 54 lines · Jianhua Lu
Quoted 53 lines · Linus Walleij
Hi Jianhua,
thanks for your patch!
It appears Konrad is working on a very similar driver, so I suggest merging them into one Novatek NT36523 driver.
Possibly we can fix this up first and then add Konrads Lenovo-panel with a patch on top.
Quoted 3 lines · Jianhua Lu
Add a driver for panels using the Novatek NT36523 display driver IC.
Signed-off-by Jianhua Lu <[email protected]>(...)
I like how you abstract the panel with init commands in the panel info.
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+enum dsi_cmd_type { +INIT_DCS_CMD , +DELAY_CMD , +}; + +struct panel_init_cmd { +enum dsi_cmd_type type; +size_t len; +const char *data; +};drivers/gpu/drm/panel/panel-novatek-nt36523.c line 71
Quoted 10 lines
drivers/gpu/drm/panel/panel-novatek-nt36523.c new file +10
-0+ +#define _INIT_DCS_CMD (...) { \ + .type = INIT_DCS_CMD, \ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} } + +#define _INIT_DELAY_CMD (...) { \ + .type = DELAY_CMD,\ + .len = sizeof((char[]){__VA_ARGS__}), \ + .data = (char[]){__VA_ARGS__} }I have seen this type of reinvented wheels a few times now. Don't do this.
Look into other recently merged drivers and look how they do it, for example
drivers/gpu/drm/panel/panel-himax-hx8394.cFor example:
- Use
mipi_dsi_dcs_write_seq()- If the delay is just used at one point in the sequence, do not invent a command language like above for it, open code the delay instead
Quoted 7 lines
Quoted 6 lines
- Try to decode as much magic as possible, if you look in Konrads driver you clearly see some standard MIPI commands, I bet you have some too.
- Maybe use callbacks to send sequences instead of tables, like in the himax driver?
Maybe I should create a wrapper of
mipi_dsi_dcs_write_seq()for sync dual dsi mode.
Yes please, it'll come in useful.
Konrad
Quoted 7 lines
Quoted 7 lines
Other than that it seems like something that could also handle the Lenovo display, or the other way around, I don't know which driver is the best starting point, but this one has the right Novatek name at least.
Yours,
Linus Walleij