Skip to contentSkip to conversation

dt-bindings: input: novatek,nvt-ts: Add nt36672a-e7t-ts compatible

PATCH In review Gianluca Boiano 4 participants 10 messages Jan 20 – Jan 22

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

PATCH v2 1/2 dt-bindings: input: novatek,nvt-ts: Add nt36672a-e7t-ts compatible

Add compatible string for the Novatek NT36672A e7t touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip).

This variant uses different chip parameters compared to the standard NT36672A, specifically a different wake_type value.

---
 .../devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml    | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml +1 -0
index bd6a60486d1f..aaa9976bd65e 100644
@@ -17,6 +17,7 @@ properties:
     enum:
       - novatek,nt11205-ts
       - novatek,nt36672a-ts
+      - novatek,nt36672a-e7t-ts
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
#1 lore raw

PATCH v2 2/2 input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant

Add support for the Novatek NT36672A touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip) which uses a different wake_type value (0x02 instead of 0x01).

The touchscreen was failing to initialize with error -5 due to the wake_type parameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correct wake_type value.

---
 drivers/input/touchscreen/novatek-nvt-ts.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/touchscreen/novatek-nvt-ts.c +7 -0
index 44b58e0dc1ad..b1c379d87de0 100644
@@ -323,9 +323,15 @@ static const struct nvt_ts_i2c_chip_data nvt_nt36672a_ts_data = {
 	.chip_id = 0x08,
 };
 
+static const struct nvt_ts_i2c_chip_data nvt_nt36672a_e7t_ts_data = {
+	.wake_type = 0x02,
+	.chip_id = 0x08,
+};
+
 static const struct of_device_id nvt_ts_of_match[] = {
 	{ .compatible = "novatek,nt11205-ts", .data = &nvt_nt11205_ts_data },
 	{ .compatible = "novatek,nt36672a-ts", .data = &nvt_nt36672a_ts_data },
+	{ .compatible = "novatek,nt36672a-e7t-ts", .data = &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
@@ -333,6 +339,7 @@ MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
 static const struct i2c_device_id nvt_ts_i2c_id[] = {
 	{ "nt11205-ts", (unsigned long) &nvt_nt11205_ts_data },
 	{ "nt36672a-ts", (unsigned long) &nvt_nt36672a_ts_data },
+	{ "nt36672a-e7t-ts", (unsigned long) &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nvt_ts_i2c_id);
Signature · 1 line
2.52.0
#2 lore raw

Re: [PATCH 2/2] input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant

Quoted 9 lines · Gianluca Boiano

Add support for the Novatek NT36672A touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip) which uses a different wake_type value (0x02 instead of 0x01).

The touchscreen was failing to initialize with error -5 due to the wake_type parameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correct wake_type value.

I don't think this is useful, because it's downstream/fork/distro with at least 100 patches on top of v6.18 (so not even current mainline!). Calling a repo "mainline" does not make it mainline and we do not track distro bugs.

Also, lack of a feature is not a bug which needs to be closed.

Drop the tag.

Best regards,
Krzysztof

maintainer
#3 lore raw

Re: [PATCH 2/2] input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant

In reply to Gianluca Boiano

Hi Gianluca,

Quoted 10 lines · Gianluca Boiano

Add support for the Novatek NT36672A touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip) which uses a different wake_type value (0x02 instead of 0x01).

The touchscreen was failing to initialize with error -5 due to the wake_type parameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correct wake_type value.

Thank you for your patch.

I don't think that adding a new compatible + a new nvt_ts_i2c_chip_data struct is the right approach here.

I guess the wake-type byte simply encodes some IRQ config settings, which may indeed be different in different applications using the some touchscreen controller.

Instead of adding a new compatible my suggestion to fix this would be to simply drop the wake_type check as well as drop the wake_type member from struct nvt_ts_i2c_chip_data.

This way you can fix the driver not working on the Xiaomi Redmi Note 6 Pro by removing code instead of adding code :)

And supporting other models also becomes easier.

Regards,

Hans

Quoted 32 lines
---
 drivers/input/touchscreen/novatek-nvt-ts.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/touchscreen/novatek-nvt-ts.c +7 -0
index 44b58e0dc1ad..b1c379d87de0 100644
@@ -323,9 +323,15 @@ static const struct nvt_ts_i2c_chip_data nvt_nt36672a_ts_data = {
 	.chip_id = 0x08,
 };
 
+static const struct nvt_ts_i2c_chip_data nvt_nt36672a_e7t_ts_data = {
+	.wake_type = 0x02,
+	.chip_id = 0x08,
+};
+
 static const struct of_device_id nvt_ts_of_match[] = {
 	{ .compatible = "novatek,nt11205-ts", .data = &nvt_nt11205_ts_data },
 	{ .compatible = "novatek,nt36672a-ts", .data = &nvt_nt36672a_ts_data },
+	{ .compatible = "novatek,nt36672a-e7t-ts", .data = &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
@@ -333,6 +339,7 @@ MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
 static const struct i2c_device_id nvt_ts_i2c_id[] = {
 	{ "nt11205-ts", (unsigned long) &nvt_nt11205_ts_data },
 	{ "nt36672a-ts", (unsigned long) &nvt_nt36672a_ts_data },
+	{ "nt36672a-e7t-ts", (unsigned long) &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nvt_ts_i2c_id);
#4 lore raw

Re: [PATCH 2/2] input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant

Hi Hans,

Thanks for the suggestion. You're right that removing code is better than adding more variants.

I've sent v3 which drops the wake_type check entirely, as you suggested.

Gianluca

Acked-by on v2 1/2
#5 lore raw
In reply to Gianluca Boiano
Quoted 10 lines · Gianluca Boiano

Add compatible string for the Novatek NT36672A e7t touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip).

This variant uses different chip parameters compared to the standard NT36672A, specifically a different wake_type value.

---
 .../devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml    | 1 +
 1 file changed, 1 insertion(+)

Best regards,
Krzysztof

#6 lore raw

v2 cover input: touchscreen: novatek-nvt-ts: Add NT36672A e7t variant

In reply to Gianluca Boiano

This series adds support for the Novatek NT36672A touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip).

The e7t variant uses a different wake_type value (0x02 instead of 0x01), which was causing probe failures with error -5.

Changes in v2:
- Removed Closes: tag referencing downstream repository (Krzysztof)

Gianluca Boiano (2):
dt-bindings: input: novatek,nvt-ts: Add nt36672a-e7t-ts compatible
input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t
variant

 .../bindings/input/touchscreen/novatek,nvt-ts.yaml         | 1 +
 drivers/input/touchscreen/novatek-nvt-ts.c                 | 7 +++++++
 2 files changed, 8 insertions(+)

--
2.52.0

#7 lore raw

PATCH v2 1/2 dt-bindings: input: novatek,nvt-ts: Add nt36672a-e7t-ts compatible

Add compatible string for the Novatek NT36672A e7t touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip).

This variant uses different chip parameters compared to the standard NT36672A, specifically a different wake_type value.

---
 .../devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml    | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml +1 -0
index bd6a60486d1f..aaa9976bd65e 100644
@@ -17,6 +17,7 @@ properties:
     enum:
       - novatek,nt11205-ts
       - novatek,nt36672a-ts
+      - novatek,nt36672a-e7t-ts
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
maintainer
#8 lore raw
Quoted 7 lines · Gianluca Boiano

Add compatible string for the Novatek NT36672A e7t touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip).

This variant uses different chip parameters compared to the standard NT36672A, specifically a different wake_type value.

Missing Krzysztof's Ack.

Quoted 19 lines
---
 .../devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml    | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml +1 -0
index bd6a60486d1f..aaa9976bd65e 100644
@@ -17,6 +17,7 @@ properties:
     enum:
       - novatek,nt11205-ts
       - novatek,nt36672a-ts
+      - novatek,nt36672a-e7t-ts
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
#9 lore raw

PATCH v2 2/2 input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant

In reply to Gianluca Boiano

Add support for the Novatek NT36672A touchscreen variant found on the Xiaomi Redmi Note 6 Pro (tulip) which uses a different wake_type value (0x02 instead of 0x01).

The touchscreen was failing to initialize with error -5 due to the wake_type parameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correct wake_type value.

---
 drivers/input/touchscreen/novatek-nvt-ts.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/touchscreen/novatek-nvt-ts.c +7 -0
index 44b58e0dc1ad..b1c379d87de0 100644
@@ -323,9 +323,15 @@ static const struct nvt_ts_i2c_chip_data nvt_nt36672a_ts_data = {
 	.chip_id = 0x08,
 };
 
+static const struct nvt_ts_i2c_chip_data nvt_nt36672a_e7t_ts_data = {
+	.wake_type = 0x02,
+	.chip_id = 0x08,
+};
+
 static const struct of_device_id nvt_ts_of_match[] = {
 	{ .compatible = "novatek,nt11205-ts", .data = &nvt_nt11205_ts_data },
 	{ .compatible = "novatek,nt36672a-ts", .data = &nvt_nt36672a_ts_data },
+	{ .compatible = "novatek,nt36672a-e7t-ts", .data = &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
@@ -333,6 +339,7 @@ MODULE_DEVICE_TABLE(of, nvt_ts_of_match);
 static const struct i2c_device_id nvt_ts_i2c_id[] = {
 	{ "nt11205-ts", (unsigned long) &nvt_nt11205_ts_data },
 	{ "nt36672a-ts", (unsigned long) &nvt_nt36672a_ts_data },
+	{ "nt36672a-e7t-ts", (unsigned long) &nvt_nt36672a_e7t_ts_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nvt_ts_i2c_id);
Signature · 1 line
2.52.0