dt-bindings: input: novatek,nvt-ts: Add nt36672a-e7t-ts compatible
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
@@ -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
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
@@ -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
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_typevalue (0x02instead of0x01).The touchscreen was failing to initialize with error -5 due to the
wake_typeparameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correctwake_typevalue.
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
Hans de Goede
maintainerRe: [PATCH 2/2] input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant
In reply to Gianluca BoianoHi 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_typevalue (0x02instead of0x01).The touchscreen was failing to initialize with error -5 due to the
wake_typeparameter mismatch during probe. This adds a new chip data structure for the e7t variant with the correctwake_typevalue.
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@@ -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);
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
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_typevalue.Signed-off-by Gianluca Boiano <[email protected]>--- .../devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml | 1 + 1 file changed, 1 insertion(+)
Best regards,
Krzysztof
v2 cover input: touchscreen: novatek-nvt-ts: Add NT36672A e7t variant
In reply to Gianluca BoianoThis 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
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
@@ -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
Rob Herring
maintainerQuoted 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_typevalue.Signed-off-by Gianluca Boiano <[email protected]>
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@@ -17,6 +17,7 @@ properties: enum: - novatek,nt11205-ts - novatek,nt36672a-ts + - novatek,nt36672a-e7t-ts reg: maxItems: 1Signature · 1 line
2.52.0
PATCH v2 2/2 input: touchscreen: novatek-nvt-ts: Add support for NT36672A e7t variant
In reply to Gianluca BoianoAdd 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
@@ -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