Skip to contentSkip to conversation

drm/panel: novatek-nt36672e: Add SM8450 HDK display card

PATCH In review Vladimir Zapolskiy 3 participants 15 messages Nov 26

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 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 lanes, has a resolution of 1080x2400, and it runs at 144Hz with Display Stream Compression, therefore a new panel configuration sequence is needed.

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.

Changes from v1 to v2:
- updated the dt example instead of adding reset-gpios documentation, and the GPIO polarity is now corrected by added gpiolib-of quirk,
- moved allOf to the end of the binding (Krzysztof),
- reworded the C-PHY link description in the overlay commit (Konrad),
- rebased on next-20261125, and collected the gained tags.

Link to v1:
- https://lore.kernel.org/all/[email protected]/

Vladimir Zapolskiy (10):
dt-bindings: display: panel: novatek,nt36672e: Describe the reset GPIO as active low
dt-bindings: display: panel: novatek,nt36672e: Add bias enable GPIO drm/panel: novatek-nt36672e: Fix the reset GPIO polarity
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: Fix the panel reset GPIO polarity
arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO

 .../display/panel/novatek,nt36672e.yaml       |  40 +-
 arch/arm64/boot/dts/qcom/Makefile             |   4 +
 arch/arm64/boot/dts/qcom/qcm6490-idp.dts      |  19 +-
 .../dts/qcom/sm8450-hdk-display-card.dtso     | 144 +++++
 drivers/gpio/gpiolib-of.c                     |   9 +
 drivers/gpu/drm/panel/Kconfig                 |   8 +-
 .../gpu/drm/panel/panel-novatek-nt36672e.c    | 604 +++++++++++++++++-
 7 files changed, 772 insertions(+), 56 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso
Signature · 1 line
2.51.0
#1 lore raw

PATCH v2 1/10 dt-bindings: display: panel: novatek,nt36672e: Describe the reset GPIO as active low

The RESET_N pin of Novatec NT36672E panels is an active low signal, and panel-common.yaml expects active low reset GPIOs to be described as such, however the example in the binding describes the reset GPIO as active high, which does not match the panel hardware, but matches the inverted reset signal polarity overlooked in the panel device driver.

---
 .../devicetree/bindings/display/panel/novatek,nt36672e.yaml     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +1 -1
index bb10d62ac2e4..dabee16bee22 100644
@@ -47,7 +47,7 @@ examples:
             compatible = "novatek,nt36672e";
             reg = <0>;
 
-            reset-gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
+            reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
 
             vddi-supply = <&vreg_l8c_1p8>;
             avdd-supply = <&disp_avdd>;
Signature · 1 line
2.51.0
#2 lore raw

PATCH v2 2/10 dt-bindings: display: panel: novatek,nt36672e: Add bias enable GPIO

In reply to 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.

---
 .../display/panel/novatek,nt36672e.yaml       | 38 ++++++++++++++-----
 1 file changed, 29 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +29 -9
index dabee16bee22..c4ebc7df3344 100644
@@ -9,9 +9,6 @@ title: Novatek NT36672E LCD DSI Panel
 maintainers:
   - Ritesh Kumar <[email protected]>
 
-allOf:
-  - $ref: panel-common.yaml#
-
 properties:
   compatible:
     const: novatek,nt36672e
@@ -21,8 +18,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: true
   backlight: true
@@ -31,10 +40,22 @@ required:
   - compatible
   - reg
   - vddi-supply
-  - avdd-supply
-  - avee-supply
   - reset-gpios
 
+dependentRequired:
+  avdd-supply: [avee-supply]
+  avee-supply: [avdd-supply]
+
+allOf:
+  - $ref: panel-common.yaml#
+  - if:
+      required:
+        - enable-gpios
+    then:
+      properties:
+        avdd-supply: false
+        avee-supply: false
+
 additionalProperties: false
 
 examples:
@@ -47,11 +68,10 @@ examples:
             compatible = "novatek,nt36672e";
             reg = <0>;
 
+            enable-gpios = <&pmic_gpios 8 GPIO_ACTIVE_HIGH>;
             reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
 
             vddi-supply = <&vreg_l8c_1p8>;
-            avdd-supply = <&disp_avdd>;
-            avee-supply = <&disp_avee>;
 
             backlight = <&pwm_backlight>;
 
Signature · 1 line
2.51.0
#3 lore raw

PATCH v2 3/10 drm/panel: novatek-nt36672e: Fix the reset GPIO polarity

In reply to Vladimir Zapolskiy

The RESET_N pin of NT36672E panels is an active low signal, however the driver drives the reset GPIO with inverted logical values, thus the reset GPIO has to be described as active high in device trees, which contradicts the panel hardware as well as the panel-common.yaml convention.

Fix the driver to assert the reset GPIO to put the panel into reset, and to deassert it to release the panel from reset along with adding a gpiolib-of quirk, which enforces the active low polarity of the NT36672E panel reset GPIO. With the quirk the reset signal levels remain unchanged for dtbs, which describe the reset GPIO as active high, and device trees, which describe it as active low, start to work.

To: Linus Walleij <[email protected]>
To: Bartosz Golaszewski <[email protected]>

---
 drivers/gpio/gpiolib-of.c                      | 9 +++++++++
 drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 8 ++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/gpio/gpiolib-of.c +9 -0
index 8bc4562608e1..2e14173196e9 100644
@@ -248,6 +248,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
 		 * compatible.
 		 */
 		{ "sdw10217201000",	"powerdown-gpios", false },
+#endif
+#if IS_ENABLED(CONFIG_DRM_PANEL_NOVATEK_NT36672E)
+		/*
+		 * The RESET_N pin of Novatek NT36672E panels is an active low
+		 * signal, however the panel driver and the device trees used
+		 * the inverted polarity and described the reset GPIO as
+		 * active high.
+		 */
+		{ "novatek,nt36672e",	"reset-gpios",	false },
 #endif
 	};
 	unsigned int i;
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +4 -4
index 85902338f10d..364e0855280f 100644
@@ -372,12 +372,12 @@ static int nt36672e_power_on(struct nt36672e_panel *ctx)
 	 * 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.
 	 */
-	gpiod_set_value(ctx->reset_gpio, 1);
-	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->reset_gpio, 0);
 	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->reset_gpio, 1);
 	usleep_range(10000, 20000);
+	gpiod_set_value(ctx->reset_gpio, 0);
+	usleep_range(10000, 20000);
 
 	return 0;
 }
@@ -387,7 +387,7 @@ static int nt36672e_power_off(struct nt36672e_panel *ctx)
 	struct mipi_dsi_device *dsi = ctx->dsi;
 	int ret = 0;
 
-	gpiod_set_value(ctx->reset_gpio, 0);
+	gpiod_set_value(ctx->reset_gpio, 1);
 
 	ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
 	if (ret)
@@ -544,7 +544,7 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)
 	if (ret < 0)
 		return ret;
 
-	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(ctx->reset_gpio))
 		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset-gpios\n");
 
Signature · 1 line
2.51.0
#6 lore raw

PATCH v2 4/10 drm/panel: novatek-nt36672e: Make the AVDD and AVEE supplies optional

In reply to Vladimir Zapolskiy

The positive and negative bias supplies of NT36672E panel may generate the bias on the module itself, and be not exposed by the panel modules.

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
index 364e0855280f..de070637c208 100644
@@ -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, 1);
 
-	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_HIGH);
 	if (IS_ERR(ctx->reset_gpio))
Signature · 1 line
2.51.0
#7 lore raw

PATCH v2 5/10 drm/panel: novatek-nt36672e: Support the bias enable GPIO

In reply to Vladimir Zapolskiy

Some 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
index de070637c208..4836751b7d5d 100644
@@ -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, 1);
+	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
#8 lore raw

PATCH v2 6/10 drm/panel: novatek-nt36672e: Verify the number of D-PHY data lanes

In reply to Vladimir Zapolskiy

The 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
index 4836751b7d5d..cc3f4d251f55 100644
@@ -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
#9 lore raw

PATCH v2 7/10 drm/panel: novatek-nt36672e: Add support of the C-PHY panel module

In reply to Vladimir Zapolskiy

The 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
index 26ffa2378f55..7404a34fcec0 100644
@@ -747,10 +747,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_NT36850
 	tristate "Novatek NT36850 panel driver"
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +480 -16

562 lines not on this page · raw message

Signature · 1 line
2.51.0
#10 lore raw

PATCH v2 8/10 arm64: dts: qcom: sm8450-hdk: Add display card overlay

In reply to 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 MIPI C-PHY links, 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).

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
index 19310879349d..96f1b98a06b8 100644
@@ -467,6 +467,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
#12 lore raw

PATCH v2 9/10 arm64: dts: qcom: qcm6490-idp: Fix the panel reset GPIO polarity

In reply to Vladimir Zapolskiy

The RESET_N pin of the NT36672E panel is an active low signal, however the panel reset GPIO is described as active high to match the inverted reset signal polarity, which was assumed by the panel driver.

Now the polarity of the panel reset GPIO is enforced by the gpiolib-of quirk, so describe the panel reset GPIO as active low to match hardware.

---
 arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/qcm6490-idp.dts +1 -1
index cb90a83351c3..ca5c868be495 100644
@@ -652,7 +652,7 @@ panel@0 {
 		compatible = "novatek,nt36672e";
 		reg = <0>;
 
-		reset-gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
 
 		vddi-supply = <&vreg_l8c_1p62>;
 		avdd-supply = <&lcd_disp_bias>;
Signature · 1 line
2.51.0
#14 lore raw

PATCH v2 10/10 arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO

In reply to 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.

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
index ca5c868be495..644fa8f68342 100644
@@ -50,17 +50,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";
 
@@ -652,14 +641,16 @@ panel@0 {
 		compatible = "novatek,nt36672e";
 		reg = <0>;
 
+		enable-gpios = <&pm7250b_gpios 2 GPIO_ACTIVE_HIGH>;
 		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
 
 		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
#4 lore raw

Re: [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity

In reply to Vladimir Zapolskiy
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] drm/panel: novatek-nt36672e: missing Fixes trailer for reset GPIO polarity fix --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] drm/panel: novatek-nt36672e: missing Fixes trailer for reset GPIO polarity fix
--

commit 9b3b20020b17a5e54e69c4e88df2960f428e2e60
Author: Vladimir Zapolskiy <[email protected]>

Quoted 15 lines

drm/panel: novatek-nt36672e: Fix the reset GPIO polarity

The RESET_N pin of NT36672E panels is an active low signal, however the driver drives the reset GPIO with inverted logical values, thus the reset GPIO has to be described as active high in device trees, which contradicts the panel hardware as well as the panel-common.yaml convention.

Fix the driver to assert the reset GPIO to put the panel into reset, and to deassert it to release the panel from reset along with adding a gpiolib-of quirk, which enforces the active low polarity of the NT36672E panel reset GPIO. With the quirk the reset signal levels remain unchanged for dtbs, which describe the reset GPIO as active high, and device trees, which describe it as active low, start to work.

Quoted 4 lines

To: Linus Walleij <[email protected]>
To: Bartosz Golaszewski <[email protected]>

[Severity: Low]
This fixes the inverted reset GPIO logical polarity from the initial driver commit. Should this include:

Fixes ea4f9975625a ("drm/panel: Add support for Novatek NT36672E panel driver")
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#11 lore raw

Re: [PATCH v2 08/10] arm64: dts: qcom: sm8450-hdk: Add display card overlay

In reply to Vladimir Zapolskiy
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] arm64: dts: qcom: sm8450-hdk sound probe fails due to enabled HDMI DAI link --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [High] arm64: dts: qcom: sm8450-hdk sound probe fails due to enabled HDMI DAI link
--

commit 2845e74d5b67d8963c4614b68345c54b82ab8dfb
Author: Vladimir Zapolskiy <[email protected]>

arm64: dts: qcom: sm8450-hdk: Add display card overlay

This commit adds a devicetree overlay for the SM8450 HDK external display card with a Novatek NT36672E DSI panel and disables the mutually exclusive on-board Lontium LT9611UXC HDMI bridge.

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso new file +0 -0
new file mode 100644
index 0000000000000..3fcaae7f2abc0
@@ -0,0 +1,144 @@

[ ... ]

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso new file +7 -0
+/* Disable HDMI bridge related nodes (mutually exclusive with the display card) */
+
+&i2c9 {
+	status = "disabled";
+};
+
+&lt9611_1v2 {

arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso line 47

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-hdk-display-card.dtso new file +10 -0
+	status = "disabled";
+};
+
+&lt9611_3v3 {
+	status = "disabled";
+};
+
+&lt9611_codec {
+	status = "disabled";
+};

[Severity: High]
Does disabling lt9611_codec without disabling the HDMI MI2S DAI link under &sound break the sound card probe?

In arch/arm64/boot/dts/qcom/sm8450-hdk.dts, the prim-mi2s-dai-link child node of &sound remains enabled and references <&lt9611_codec 0>:

arch/arm64/boot/dts/qcom/sm8450-hdk.dts:

	prim-mi2s-dai-link {
		link-name = "HDMI Playback";
		...
		codec {
			sound-dai = <&lt9611_codec 0>;
		};

When qcom_snd_parse_of() iterates the available child nodes of &sound, snd_soc_of_get_dai_link_codecs() fails with -EPROBE_DEFER because lt9611_codec is disabled and never registers a codec component, preventing the entire sound card from registering. Like sm8550-hdk-display-card.dtso, prim-mi2s-dai-link can be given a label in sm8450-hdk.dts and disabled in this overlay.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
Reviewed-by on v2 9/10
#13 lore raw

Re: [PATCH v2 09/10] arm64: dts: qcom: qcm6490-idp: Fix the panel reset GPIO polarity

In reply to Vladimir Zapolskiy
Quoted 9 lines · Vladimir Zapolskiy

The RESET_N pin of the NT36672E panel is an active low signal, however the panel reset GPIO is described as active high to match the inverted reset signal polarity, which was assumed by the panel driver.

Now the polarity of the panel reset GPIO is enforced by the gpiolib-of quirk, so describe the panel reset GPIO as active low to match hardware.

---

Konrad

#5 lore raw

Re: [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity

In reply to [email protected]
Quoted 29 lines · On 11/26/26 15:52, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] drm/panel: novatek-nt36672e: missing Fixes trailer for reset GPIO polarity fix
--

commit 9b3b20020b17a5e54e69c4e88df2960f428e2e60
Author: Vladimir Zapolskiy <[email protected]>

Quoted 15 lines

drm/panel: novatek-nt36672e: Fix the reset GPIO polarity

The RESET_N pin of NT36672E panels is an active low signal, however the driver drives the reset GPIO with inverted logical values, thus the reset GPIO has to be described as active high in device trees, which contradicts the panel hardware as well as the panel-common.yaml convention.

Fix the driver to assert the reset GPIO to put the panel into reset, and to deassert it to release the panel from reset along with adding a gpiolib-of quirk, which enforces the active low polarity of the NT36672E panel reset GPIO. With the quirk the reset signal levels remain unchanged for dtbs, which describe the reset GPIO as active high, and device trees, which describe it as active low, start to work.

Quoted 4 lines

To: Linus Walleij <[email protected]>
To: Bartosz Golaszewski <[email protected]>

Quoted 6 lines

[Severity: Low]
This fixes the inverted reset GPIO logical polarity from the initial driver commit. Should this include:

Fixes ea4f9975625a ("drm/panel: Add support for Novatek NT36672E panel driver")

It is a false positive report by the Sashiko bot, there is no runtime problem to be fixed, and backport is not needed.

Signature · 2 lines
Best wishes,
Vladimir