drm/panel: novatek-nt36672e: Add SM8450 HDK display card
Subsystems (6)
cover drm/panel: novatek-nt36672e: Add SM8450 HDK display card
The series extends the NT36672E binding and driver to support the panel module, and adds a device tree overlay for the SM8450 HDK display card.
The display card for the Qualcomm SM8450 HDK board carries an LCD panel module based on the Novatek NT36672E display driver IC. Unlike the panel module, which is supported by the NT36672E panel driver on the QCM6490 IDP board, the display card panel is connected over 3 MIPI C-PHY trios, has a resolution of 1080x2400, and it runs at 144Hz with Display Stream Compression, therefore a new panel configuration sequence is needed.
Since MIPI PHY type of the DSI link is fixed by the panel module design, the driver selects the panel description by the PHY type of the DSI link.
The initialization sequence, the display timings and the DSC parameters of the display card panel are taken from the Qualcomm display device tree source for the panel:
https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-devicetree
tag DISPLAY.LA.6.0.r12-02500-WAIPIO.QSSI17.0 display/dsi-panel-nt36672e-fhd-plus-144hz-video-cphy.dtsi
The integrated touchscreen controller of the display card is not described, since there is no binding or driver support for it yet.
Vladimir Zapolskiy (8):
dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
dt-bindings: display: panel: novatek,nt36672e: Add bias enable GPIO drm/panel: novatek-nt36672e: Make the AVDD and AVEE supplies optional drm/panel: novatek-nt36672e: Support the bias enable GPIO drm/panel: novatek-nt36672e: Verify the number of D-PHY data lanes drm/panel: novatek-nt36672e: Add support of the C-PHY panel module
arm64: dts: qcom: sm8450-hdk: Add display card overlay
arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO
.../display/panel/novatek,nt36672e.yaml | 41 +- arch/arm64/boot/dts/qcom/Makefile | 4 + arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 17 +- .../dts/qcom/sm8450-hdk-display-card.dtso | 144 +++++ drivers/gpu/drm/panel/Kconfig | 8 +- .../gpu/drm/panel/panel-novatek-nt36672e.c | 596 +++++++++++++++++- 6 files changed, 762 insertions(+), 48 deletions(-) create mode 100644 arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso
base-commit: 6b4b543fa18757297ac756a6fe6e64f506b7844a
Signature · 1 line
2.51.0
PATCH 1/8 dt-bindings: display: panel: novatek, nt36672e: Document the reset GPIO polarity
The reset GPIO of NT36672E panels has been described as active high since the binding was added, also see the example and the QCM6490 IDP board device tree, however actually it serves as the active low signal, also panel-common.yaml expects active low reset GPIOs to be described as such.
Document the active high description of the reset GPIO explicitly as the exceptional deviation from the actual signal polarity, any new devices will use it in the same way as the existing ones.
--- .../bindings/display/panel/novatek,nt36672e.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +8 -1
@@ -24,7 +24,14 @@ properties: avdd-supply: true avee-supply: true port: true - reset-gpios: true + reset-gpios: + maxItems: 1 + description: + GPIO connected to the reset pin of the panel. The GPIO must be described + as active high (GPIO_ACTIVE_HIGH), the asserted state releases the panel + from reset. Note that the RESET_N pin is in fact an active low signal, + the inverted description is kept for compatibility with existing device + trees, while it deviates from the convention of panel-common.yaml. backlight: true required:
Signature · 1 line
2.51.0
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 19 lines · Vladimir Zapolskiy
The reset GPIO of NT36672E panels has been described as active high since the binding was added, also see the example and the QCM6490 IDP board device tree, however actually it serves as the active low signal, also
panel-common.yamlexpects active low reset GPIOs to be described as such.Document the active high description of the reset GPIO explicitly as the exceptional deviation from the actual signal polarity, any new devices will use it in the same way as the existing ones.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- .../bindings/display/panel/novatek,nt36672e.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +0
-0
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml properties: · line 31
Quoted 9 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +5
-1@@ -24,7 +24,14 @@ properties: avdd-supply: true avee-supply: true port: true - reset-gpios: true + reset-gpios: + maxItems: 1 + description: + GPIO connected to the reset pin of the panel. The GPIO must be described + as active high (GPIO_ACTIVE_HIGH), the asserted state releases the panel
I disagree that it has to be active high, because, since we do not represent pin inverters in DT, it depends on board layout. Wording would need to be correct if this stays.
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml properties: · line 34
Quoted 3 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +3
-0+ from reset. Note that the RESET_N pin is in fact an active low signal, + the inverted description is kept for compatibility with existing device + trees, while it deviates from the convention of panel-common.yaml.
We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
Best regards,
Krzysztof
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 25 lines · Krzysztof Kozlowski
Quoted 24 lines · Vladimir Zapolskiy
The reset GPIO of NT36672E panels has been described as active high since the binding was added, also see the example and the QCM6490 IDP board device tree, however actually it serves as the active low signal, also
panel-common.yamlexpects active low reset GPIOs to be described as such.Document the active high description of the reset GPIO explicitly as the exceptional deviation from the actual signal polarity, any new devices will use it in the same way as the existing ones.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- .../bindings/display/panel/novatek,nt36672e.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +1
-1@@ -24,7 +24,14 @@ properties: avdd-supply: true avee-supply: true port: true - reset-gpios: true + reset-gpios:
Quoted 9 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml properties: · line 31
Quoted 4 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +4
-0+ maxItems: 1 + description: + GPIO connected to the reset pin of the panel. The GPIO must be described + as active high (GPIO_ACTIVE_HIGH), the asserted state releases the panelI disagree that it has to be active high, because, since we do not represent pin inverters in DT, it depends on board layout. Wording would need to be correct if this stays.
I'm all for a better wording.
The described display panel device operates (here resets) according to the active low signal RESET_N, the device driver is written to interpret the signal as active high. A signal inverter may be present on a board, but then the description of this board feature would belong to the board dts, e.g. in a form of a simple comment around the property.
Quoted 8 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml properties: · line 34
Quoted 3 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +3
-0+ from reset. Note that the RESET_N pin is in fact an active low signal, + the inverted description is kept for compatibility with existing device + trees, while it deviates from the convention of panel-common.yaml.We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
In the upstream there is only one user qcm6490-idp.dts, and changing the polarity will be an ABI breaking change, unfortunately.
Here it's a similar story to another one about OV9282 reset-gpios polarity, it ended up in keeping the polarity of the signal to avoid ABI breakage:
Probably the best way to operate here is to give a clear 'reset-gpios' property description in the OV9282 sensor or this NT36672E panel dt docs.
Signature · 2 lines
Best wishes, Vladimir
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 7 lines · Vladimir Zapolskiy
Quoted 4 lines
We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
In the upstream there is only one user
qcm6490-idp.dts, and changing the polarity will be an ABI breaking change, unfortunately.
And all other projects?
Best regards,
Krzysztof
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Vladimir Zapolskiy
Quoted 4 lines
We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
In the upstream there is only one user
qcm6490-idp.dts, and changing the polarity will be an ABI breaking change, unfortunately.And all other projects?
It might be a challenging task to check usage of "novatek,nt36672e" compatible display panels in all other projects. I've asked about it:
* https://chatgpt.com/uc/6ae25571-2ef0-83ea-81e5-2522e70c4a93
The check gives this info:
1. Linux kernel - invalid GPIO polarity in the driver and qcm6490-idp.dts,
2. Android - invalid GPIO polarity in the copied driver and qcm6490-idp.dts,
3. FreeBSD - invalid GPIO polarity in the copied qcm6490-idp.dts, no driver.
Please let me know, if there are other projects to check. To my understanding the RESET_N polarity cannot be corrected anymore, and the best option is to clearly document a difference between the device and its dt-binding documentation.
Signature · 2 lines
Best wishes, Vladimir
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 20 lines · Vladimir Zapolskiy
Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Vladimir Zapolskiy
Quoted 4 lines
We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
In the upstream there is only one user
qcm6490-idp.dts, and changing the polarity will be an ABI breaking change, unfortunately.And all other projects?
It might be a challenging task to check usage of "novatek,nt36672e" compatible display panels in all other projects. I've asked about it:
* https://chatgpt.com/uc/6ae25571-2ef0-83ea-81e5-2522e70c4a93
The check gives this info:
Quoted 8 lines
1. Linux kernel - invalid GPIO polarity in the driver and
qcm6490-idp.dts,
2. Android - invalid GPIO polarity in the copied driver andqcm6490-idp.dts,
3. FreeBSD - invalid GPIO polarity in the copiedqcm6490-idp.dts, no driver.Please let me know, if there are other projects to check. To my understanding the
RESET_Npolarity cannot be corrected anymore, and the best option is to clearly document a difference between the device and its dt-binding documentation.
It can be correct, just with impact so we choose not to, but nevertheless hardware wants different polarity, so you should not state in the binding the incorrect one.
This property corresponds to the hardware, not chosen SW implementation.
Best regards,
Krzysztof
Re: [PATCH 1/8] dt-bindings: display: panel: novatek,nt36672e: Document the reset GPIO polarity
Quoted 30 lines · Krzysztof Kozlowski
Quoted 20 lines · Vladimir Zapolskiy
Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Vladimir Zapolskiy
Quoted 4 lines
We might fix it at some point, so not sure if it is worth documenting in the binding. And what about usage of this binding in other projects which implement it correctly?
In the upstream there is only one user
qcm6490-idp.dts, and changing the polarity will be an ABI breaking change, unfortunately.And all other projects?
It might be a challenging task to check usage of "novatek,nt36672e" compatible display panels in all other projects. I've asked about it:
* https://chatgpt.com/uc/6ae25571-2ef0-83ea-81e5-2522e70c4a93
The check gives this info:
Quoted 8 lines
1. Linux kernel - invalid GPIO polarity in the driver and
qcm6490-idp.dts,
2. Android - invalid GPIO polarity in the copied driver andqcm6490-idp.dts,
3. FreeBSD - invalid GPIO polarity in the copiedqcm6490-idp.dts, no driver.Please let me know, if there are other projects to check. To my understanding the
RESET_Npolarity cannot be corrected anymore, and the best option is to clearly document a difference between the device and its dt-binding documentation.
Quoted 6 lines
It can be correct, just with impact so we choose not to, but nevertheless hardware wants different polarity, so you should not state in the binding the incorrect one.
This property corresponds to the hardware, not chosen SW implementation.
Here by the hardware do you mean a "novatek,nt36672e" compatible panel hardware, or a board hardware like sm8450-hdk?
Its the panel hardware property to get a reset signal with the proper polarity (in the ideal world it's taken from the panel datasheet), then
1) this description is missing in the panel dt bindings documentation,
2) if added, this description would contradict to the panel datasheet.
It would make sense to document it, and that's the intention of this particular proposed change.
Signature · 2 lines
Best wishes, Vladimir
PATCH 2/8 dt-bindings: display: panel: novatek, nt36672e: Add bias enable GPIO
In reply to Vladimir ZapolskiyThe pair of positive and negative bias supplies of an NT36672E panel, AVDD and AVEE, also known as VSP and VSN, are either provided by the host, or generated on the panel module itself. In the latter case the module exposes only a bias enable signal with no need to describe the supplies.
Make the AVDD and AVEE supplies optional, but require them to be described together as the indivisible pair, and add an optional enable GPIO for the bias enable signal of the panel module, which excludes the bias supplies, if present in the actual device tree node.
--- .../display/panel/novatek,nt36672e.yaml | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +26 -6
@@ -11,6 +11,13 @@ maintainers: allOf: - $ref: panel-common.yaml# + - if: + required: + - enable-gpios + then: + properties: + avdd-supply: false + avee-supply: false properties: compatible:
@@ -21,8 +28,20 @@ properties: description: DSI virtual channel vddi-supply: true - avdd-supply: true - avee-supply: true + + avdd-supply: + description: Positive bias supply of the panel + + avee-supply: + description: Negative bias supply of the panel + + enable-gpios: + maxItems: 1 + description: + GPIO connected to the bias enable signal of the panel module, which + switches on the positive and negative bias supplies generated on the + module. The signal is active high. + port: true reset-gpios: maxItems: 1
@@ -38,11 +57,13 @@ required: - compatible - reg - vddi-supply - - avdd-supply - - avee-supply - reset-gpios - port +dependentRequired: + avdd-supply: [avee-supply] + avee-supply: [avdd-supply] + additionalProperties: false examples:
@@ -55,11 +76,10 @@ examples: compatible = "novatek,nt36672e"; reg = <0>; + enable-gpios = <&pmic_gpios 8 GPIO_ACTIVE_HIGH>; reset-gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>; vddi-supply = <&vreg_l8c_1p8>; - avdd-supply = <&disp_avdd>; - avee-supply = <&disp_avee>; backlight = <&pwm_backlight>;
Signature · 1 line
2.51.0
Re: [PATCH 2/8] dt-bindings: display: panel: novatek,nt36672e: Add bias enable GPIO
Quoted 20 lines · Vladimir Zapolskiy
The pair of positive and negative bias supplies of an NT36672E panel, AVDD and AVEE, also known as VSP and VSN, are either provided by the host, or generated on the panel module itself. In the latter case the module exposes only a bias enable signal with no need to describe the supplies.
Make the AVDD and AVEE supplies optional, but require them to be described together as the indivisible pair, and add an optional enable GPIO for the bias enable signal of the panel module, which excludes the bias supplies, if present in the actual device tree node.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- .../display/panel/novatek,nt36672e.yaml | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-)Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +0
-0
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml maintainers: · line 20
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +7
-0@@ -11,6 +11,13 @@ maintainers: allOf: - $ref: panel-common.yaml# + - if: + required: + - enable-gpios + then: + properties: + avdd-supply: false + avee-supply: false
Move entire allOf to the end, before unevaluated/additionalProperties part.
Best regards,
Krzysztof
PATCH 3/8 drm/panel: novatek-nt36672e: Make the AVDD and AVEE supplies optional
In reply to Vladimir ZapolskiyThe positive and negative bias supplies of an NT36672E panel, AVDD and AVEE, are not exposed by the panel modules, which generate the bias on the module itself.
Split the supplies into the required VDDI supply and the pair of AVDD and AVEE bias supplies, which are either both described or both absent, and get the bias supplies only if they are described.
--- .../gpu/drm/panel/panel-novatek-nt36672e.c | 69 +++++++++++++------ 1 file changed, 49 insertions(+), 20 deletions(-)
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +49 -20
@@ -13,16 +13,13 @@#include <video/mipi_display.h> -static const char *const regulator_names[] = { -"vddi" , -"avdd" , -"avee" , +static const struct regulator_bulk_data nt36672e_supplies[] = { + { .supply ="vddi" , .init_load_uA =62000 }, }; -static const unsigned long regulator_enable_loads[] = { -62000 , -100000 , -100000 , +static const struct regulator_bulk_data nt36672e_bias_supplies[] = { + { .supply ="avdd" , .init_load_uA =100000 }, + { .supply ="avee" , .init_load_uA =100000 }, };struct panel_desc {
@@ -40,7 +37,8 @@ struct nt36672e_panel {struct drm_panel panel;struct mipi_dsi_device *dsi;struct gpio_desc *reset_gpio; -struct regulator_bulk_data supplies[3 ]; +struct regulator_bulk_data *supplies; +struct regulator_bulk_data *bias_supplies;const struct panel_desc *desc; };
@@ -362,12 +360,23 @@ static int nt36672e_power_on(struct nt36672e_panel *ctx)struct mipi_dsi_device *dsi = ctx->dsi;int ret; - ret =regulator_bulk_enable (ARRAY_SIZE (ctx->supplies), ctx->supplies); + ret =regulator_bulk_enable (ARRAY_SIZE (nt36672e_supplies), ctx->supplies);if (ret <0 ) {dev_err (&dsi->dev,"regulator bulk enable failed: %d\n" , ret);return ret; } +if (ctx->bias_supplies) { + ret =regulator_bulk_enable (ARRAY_SIZE (nt36672e_bias_supplies), + ctx->bias_supplies); +if (ret <0 ) { +dev_err (&dsi->dev,"bias regulator enable failed: %d\n" , ret); +regulator_bulk_disable (ARRAY_SIZE (nt36672e_supplies), + ctx->supplies); +return ret; + } + } +/* * Reset sequence of nt36672e panel requires the panel to be out of reset * for 10ms, followed by being held in reset for 10ms and then out again.
@@ -389,7 +398,14 @@ static int nt36672e_power_off(struct nt36672e_panel *ctx)gpiod_set_value (ctx->reset_gpio,0 ); - ret =regulator_bulk_disable (ARRAY_SIZE (ctx->supplies), ctx->supplies); +if (ctx->bias_supplies) { + ret =regulator_bulk_disable (ARRAY_SIZE (nt36672e_bias_supplies), + ctx->bias_supplies); +if (ret) +dev_err (&dsi->dev,"bias regulator disable failed: %d\n" , ret); + } + + ret =regulator_bulk_disable (ARRAY_SIZE (nt36672e_supplies), ctx->supplies);if (ret)dev_err (&dsi->dev,"regulator bulk disable failed: %d\n" , ret);
@@ -520,7 +536,8 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi) {struct device *dev = &dsi->dev;struct nt36672e_panel *ctx; -int i, ret =0 ; +bool avdd, avee; +int ret =0 ; ctx = devm_drm_panel_alloc(dev, struct nt36672e_panel, panel, &nt36672e_drm_funcs,
@@ -534,15 +551,27 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)return -ENODEV ; } -for (i =0 ; i <ARRAY_SIZE (ctx->supplies); i++) { - ctx->supplies[i].supply = regulator_names[i]; - ctx->supplies[i].init_load_uA = regulator_enable_loads[i]; - } - - ret =devm_regulator_bulk_get (dev,ARRAY_SIZE (ctx->supplies), - ctx->supplies); + ret =devm_regulator_bulk_get_const (dev,ARRAY_SIZE (nt36672e_supplies), + nt36672e_supplies, &ctx->supplies);if (ret <0 ) -return ret; +return dev_err_probe (dev, ret,"Failed to get regulators\n" ); + +/* The bias supplies are either both described or generated on the module */ + avdd =of_property_present (dev->of_node,"avdd-supply" ); + avee =of_property_present (dev->of_node,"avee-supply" ); +if (avdd != avee) +return dev_err_probe (dev, -EINVAL , +"avdd and avee supplies must be described together\n" ); + +if (avdd) { + ret =devm_regulator_bulk_get_const (dev, +ARRAY_SIZE (nt36672e_bias_supplies), + nt36672e_bias_supplies, + &ctx->bias_supplies); +if (ret <0 ) +return dev_err_probe (dev, ret, +"Failed to get bias regulators\n" ); + } ctx->reset_gpio =devm_gpiod_get (dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (ctx->reset_gpio))
Signature · 1 line
2.51.0
PATCH 4/8 drm/panel: novatek-nt36672e: Support the bias enable GPIO
In reply to Vladimir ZapolskiySome NT36672E panel modules generate their positive and negative bias supplies on the module, and expose only a bias enable signal instead of the AVDD and AVEE supply inputs, add support of such bias enable GPIO.
--- drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +14 -0
@@ -37,6 +37,7 @@ struct nt36672e_panel {struct drm_panel panel;struct mipi_dsi_device *dsi;struct gpio_desc *reset_gpio; +struct gpio_desc *enable_gpio;struct regulator_bulk_data *supplies;struct regulator_bulk_data *bias_supplies;const struct panel_desc *desc;
@@ -377,6 +378,8 @@ static int nt36672e_power_on(struct nt36672e_panel *ctx) } } +gpiod_set_value_cansleep (ctx->enable_gpio,1 ); +/* * Reset sequence of nt36672e panel requires the panel to be out of reset * for 10ms, followed by being held in reset for 10ms and then out again.
@@ -397,6 +400,7 @@ static int nt36672e_power_off(struct nt36672e_panel *ctx)int ret =0 ;gpiod_set_value (ctx->reset_gpio,0 ); +gpiod_set_value_cansleep (ctx->enable_gpio,0 );if (ctx->bias_supplies) { ret = regulator_bulk_disable(ARRAY_SIZE(nt36672e_bias_supplies),
@@ -577,6 +581,16 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)if (IS_ERR (ctx->reset_gpio))return dev_err_probe (dev,PTR_ERR (ctx->reset_gpio),"Failed to get reset-gpios\n" ); + ctx->enable_gpio =devm_gpiod_get_optional (dev,"enable" ,GPIOD_OUT_LOW ); +if (IS_ERR (ctx->enable_gpio)) +return dev_err_probe (dev,PTR_ERR (ctx->enable_gpio), +"Failed to get enable-gpios\n" ); + +/* The bias is either supplied to or generated on the panel module */ +if (ctx->enable_gpio && ctx->bias_supplies) +return dev_err_probe (dev, -EINVAL , +"enable-gpios and bias supplies are mutually exclusive\n" ); + ctx->dsi = dsi;mipi_dsi_set_drvdata (dsi, ctx);
Signature · 1 line
2.51.0
PATCH 5/8 drm/panel: novatek-nt36672e: Verify the number of D-PHY data lanes
In reply to Vladimir ZapolskiyThe NT36672E panel in the MIPI D-PHY mode is connected over 4 data lanes, a mismatching device tree description results in a panel, which won't work.
Get the PHY type of the DSI link from the PHY of the DSI host, and get the number of data lanes from the DSI host endpoint to check the match.
--- .../gpu/drm/panel/panel-novatek-nt36672e.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +37 -0
@@ -5,14 +5,18 @@#include <linux/gpio/consumer.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/of_graph.h> #include <linux/regulator/consumer.h> #include <drm/drm_mipi_dsi.h> #include <drm/drm_modes.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <video/mipi_display.h> +#include <dt-bindings/phy/phy.h> +static const struct regulator_bulk_data nt36672e_supplies[] = { { .supply ="vddi" , .init_load_uA =62000 }, };
@@ -536,6 +540,30 @@ static const struct drm_panel_funcs nt36672e_drm_funcs = { .get_modes = nt36672e_panel_get_modes, }; +/* +* Get the PHY type of the DSI link from the PHY of the DSI host, MIPI D-PHY +* is the default, if the PHY type is not specified. +*/ +static u32 nt36672e_get_dsi_phy_type (struct device *dev) +{ +struct device_node *host, *phy; +u32 phy_type =PHY_TYPE_DPHY ; + + host =of_graph_get_remote_node (dev->of_node,0 ,0 ); +if (!host) +return phy_type; + + phy =of_parse_phandle (host,"phys" ,0 ); +of_node_put (host); +if (!phy) +return phy_type; + +of_property_read_u32 (phy,"phy-type" , &phy_type); +of_node_put (phy); + +return phy_type; +} +static int nt36672e_panel_probe (struct mipi_dsi_device *dsi) {struct device *dev = &dsi->dev;
@@ -598,6 +626,15 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi) dsi->format = ctx->desc->format; dsi->mode_flags = ctx->desc->mode_flags; +/* A MIPI D-PHY link to the panel shall have exactly 4 data lanes */ +if (nt36672e_get_dsi_phy_type (dev) ==PHY_TYPE_DPHY ) { + ret =drm_of_get_data_lanes_count_remote (dev->of_node,0 ,-1 ,1 ,4 ); +if (ret >0 && ret !=4 ) +return dev_err_probe (dev, -EINVAL , +"%d D-PHY data lanes described, 4 required\n" , + ret); + } + ret =drm_panel_of_backlight (&ctx->panel);if (ret)return dev_err_probe (dev, ret,"Failed to get backlight\n" );
Signature · 1 line
2.51.0
PATCH 6/8 drm/panel: novatek-nt36672e: Add support of the C-PHY panel module
In reply to Vladimir ZapolskiyThe display card for the Qualcomm SM8450 HDK board has an NT36672E panel module with a resolution of 1080x2400, which is connected over 3 MIPI C-PHY trios, and runs at 144Hz with Display Stream Compression.
The MIPI PHY type of the DSI link is fixed by the panel module design, thus select the panel type by the PHY type of the DSI link, MIPI D-PHY selects the existing panel description, MIPI C-PHY selects the new one.
The initialization sequence, the display timings and the DSC parameters of the new supported MIPI C-PHY panel module are taken from the Qualcomm display device tree source of the panel:
https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-devicetree
tag DISPLAY.LA.6.0.r12-02500-WAIPIO.QSSI17.0 display/dsi-panel-nt36672e-fhd-plus-144hz-video-cphy.dtsi
The DSC picture parameter set is sent after the display is switched on, the display decompression is enabled by the initialization sequence.
--- drivers/gpu/drm/panel/Kconfig | 8 +- .../gpu/drm/panel/panel-novatek-nt36672e.c | 496 +++++++++++++++++- 2 files changed, 486 insertions(+), 18 deletions(-)
drivers/gpu/drm/panel/Kconfig +6 -2
@@ -720,10 +720,14 @@ config DRM_PANEL_NOVATEK_NT36672E depends on OF depends on DRM_MIPI_DSI depends on BACKLIGHT_CLASS_DEVICE + select DRM_DISPLAY_DSC_HELPER + select DRM_DISPLAY_HELPER help Say Y here if you want to enable support for Novatek NT36672E DSI Video Mode - LCD panel module. The panel has a resolution of 1080x2408 and uses 24 bit - RGB per pixel. + LCD panel modules. The supported panel modules use 24 bit RGB per pixel, + and have a resolution of 1080x2408 with a 4-lane MIPI D-PHY link, or + a resolution of 1080x2400 with a 3-trio MIPI C-PHY link and Display + Stream Compression. config DRM_PANEL_NOVATEK_NT37700F tristate "Novatek NT37700F DSI panel"
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +480 -16
562 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH 7/8 arm64: dts: qcom: sm8450-hdk: Add display card overlay
In reply to Vladimir ZapolskiyThe SM8450 HDK board can be connected to an external display card, which carries a 1080x2400 LCD panel module powered by the Novatek NT36672E display driver IC with an integrated touchscreen controller.
The panel is connected to DSI0 over a 3-trio MIPI C-PHY link, power is supplied by VREG_L12C_1P8, the bias supplies are on the panel module, and they are enabled by signal PM8350 GPIO8 (LCD_BIAS_EN).
The backlight is controlled by the PM8350 GPIO9 (LCD_WLED_EN) signal and the PM8350C LPG PWM on PM8350C GPIO8 (LCD_PWM).
As documented in the panel binding, the reset GPIO is described as active high, although the panel reset signal is active low.
The DSI0 output is shared with the on-board Lontium LT9611UXC HDMI bridge, thus disable the bridge and its power supplies in the overlay.
The touchscreen controller is not described, since there is no binding or driver support for it yet.
--- arch/arm64/boot/dts/qcom/Makefile | 4 + .../dts/qcom/sm8450-hdk-display-card.dtso | 144 ++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso
arch/arm64/boot/dts/qcom/Makefile +4 -0
@@ -422,6 +422,10 @@ dtb-$(CONFIG_ARCH_QCOM) += sm8350-microsoft-surface-duo2.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8350-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8350-sony-xperia-sagami-pdx214.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8350-sony-xperia-sagami-pdx215.dtb + +sm8450-hdk-display-card-dtbs := sm8450-hdk.dtb sm8450-hdk-display-card.dtbo + +dtb-$(CONFIG_ARCH_QCOM) += sm8450-hdk-display-card.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8450-hdk.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8450-qrd.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8450-samsung-r0q.dtb
arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso new file +144 -0
144 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH 7/8] arm64: dts: qcom: sm8450-hdk: Add display card overlay
Quoted 5 lines · Vladimir Zapolskiy
The SM8450 HDK board can be connected to an external display card, which carries a 1080x2400 LCD panel module powered by the Novatek NT36672E display driver IC with an integrated touchscreen controller.
The panel is connected to DSI0 over a 3-trio MIPI C-PHY link, power is
Either "a trio" or "3 lanes", 3 trios would be *a lot* of bandwidth
Otherwise I think this looks good
Konrad
PATCH 8/8 arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO
In reply to Vladimir ZapolskiyThe positive and negative bias supplies of the NT36672E panel on the QCM6490 IDP board are switched on by the PM7250B GPIO2 bias enable signal, which is described as a single fixed regulator supplying both AVDD and AVEE bias supplies of the panel. The fixed regulator does not describe the hardware, it can not supply a positive and a negative voltage at the same time, and apparently bias supplies are generated right on the display panel module.
Since the panel binding supports the bias enable GPIO, describe the signal as such, and remove the oddly described and used fixed regulator.
--- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
arch/arm64/boot/dts/qcom/qcm6490-idp.dts +4 -13
@@ -51,17 +51,6 @@ chosen { stdout-path = "serial0:115200n8"; }; - lcd_disp_bias: regulator-lcd-disp-bias { - compatible = "regulator-fixed"; - regulator-name = "lcd_disp_bias"; - regulator-min-microvolt = <5500000>; - regulator-max-microvolt = <5500000>; - gpio = <&pm7250b_gpios 2 GPIO_ACTIVE_HIGH>; - enable-active-high; - pinctrl-0 = <&lcd_disp_bias_en>; - pinctrl-names = "default"; - }; - gpio-keys { compatible = "gpio-keys";
@@ -653,14 +642,16 @@ panel@0 { compatible = "novatek,nt36672e"; reg = <0>; + enable-gpios = <&pm7250b_gpios 2 GPIO_ACTIVE_HIGH>; reset-gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>; vddi-supply = <&vreg_l8c_1p62>; - avdd-supply = <&lcd_disp_bias>; - avee-supply = <&lcd_disp_bias>; backlight = <&pm8350c_pwm_backlight>; + pinctrl-0 = <&lcd_disp_bias_en>; + pinctrl-names = "default"; + port { panel0_in: endpoint { remote-endpoint = <&mdss_dsi0_out>;
Signature · 1 line
2.51.0
Re: [PATCH 8/8] arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO
Quoted 8 lines · Vladimir Zapolskiy
The positive and negative bias supplies of the NT36672E panel on the QCM6490 IDP board are switched on by the PM7250B GPIO2 bias enable signal, which is described as a single fixed regulator supplying both AVDD and AVEE bias supplies of the panel. The fixed regulator does not describe the hardware, it can not supply a positive and a negative voltage at the same time, and apparently bias supplies are generated right on the display panel module.
Quoted 5 lines
Since the panel binding supports the bias enable GPIO, describe the signal as such, and remove the oddly described and used fixed regulator.
Signed-off-by Vladimir Zapolskiy <[email protected]>---
Konrad