Using i2c-hid-of-elan driver instead of i2c-hid-of driver
Subsystems (2)
v2 cover Using i2c-hid-of-elan driver instead of i2c-hid-of driver
After commit 2be404486c05 ("HID: i2c-hid-of: Add reset GPIO support to i2c-hid-of"), i2c-hid-of driver resets the touchscreen without having proper post-reset delay on OF platform. From the commit message of that commit, not to decribe poset-reset delay in device tree is intended. Instead, describing the delay in platform data and changing to use specialized driver is more preferable solution.
Also workaround the race condition of pinctrl used by touchscreen and trackpad in this series to avoid merge conflict.
Adding other second source touchscreen used by some mt8183 devices in this series since this should be based on the workaround of pinctrl issue.
---
Changes in v2:
- Add second source touchscreen patches since they should based on the first patch of this series.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Hsin-Te Yuan (4):
arm64: dts: mediatek: mt8183: Fix race condition of pinctrl
arm64: dts: mediatek: mt8183: Switch to Elan touchscreen driver
arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
arm64: dts: mediatek: mt8183: willow: Support second source touchscreen
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts | 2 -- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-cozmo.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 12 +++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts | 11 ++--------- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi | 3 --- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico6.dts | 3 --- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 10 +++------- 12 files changed, 12 insertions(+), 63 deletions(-)
---
base-commit: eca631b8fe808748d7585059c4307005ca5c5820
change-id: 20241018-post-reset-ac66b0351613
Best regards,
Signature · 1 line
Hsin-Te Yuan <[email protected]>
PATCH RESEND v2 1/4 arm64: dts: mediatek: mt8183: Fix race condition of pinctrl
Some mt8183 devices use second source touchscreen/trackpad and share the same pinctrl property with the original touchscreen/trackpad. Currently, multiple touchscreen/trackpad drivers might probe simultaneously, causing a race condition of getting the same pin.
Move the pinctrl property to the i2c node to workaround this issue.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts | 2 -- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-cozmo.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 2 -- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts | 2 -- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts | 2 -- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts | 2 -- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico6.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 10 +++------- 12 files changed, 3 insertions(+), 35 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts +0 -2
@@ -21,8 +21,6 @@ &i2c0 { touchscreen@2c { compatible = "hid-over-i2c"; reg = <0x2c>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; post-power-on-delay-ms = <200>;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-cozmo.dts +0 -3
@@ -23,9 +23,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts +0 -2
@@ -19,8 +19,6 @@ &touchscreen { compatible = "hid-over-i2c"; reg = <0x10>; interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; post-power-on-delay-ms = <10>; hid-descr-addr = <0x0001>;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts +0 -2
@@ -32,8 +32,6 @@ &touchscreen { compatible = "hid-over-i2c"; reg = <0x10>; interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; post-power-on-delay-ms = <10>; hid-descr-addr = <0x0001>;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts +0 -2
@@ -19,8 +19,6 @@ &touchscreen { compatible = "hid-over-i2c"; reg = <0x10>; interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; post-power-on-delay-ms = <10>; hid-descr-addr = <0x0001>;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts +0 -2
@@ -19,8 +19,6 @@ &touchscreen { compatible = "hid-over-i2c"; reg = <0x10>; interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; post-power-on-delay-ms = <10>; hid-descr-addr = <0x0001>;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi +0 -3
@@ -16,9 +16,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper.dtsi +0 -3
@@ -12,9 +12,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico.dts +0 -3
@@ -25,9 +25,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico6.dts +0 -3
@@ -38,9 +38,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi +0 -3
@@ -12,9 +12,6 @@ trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x20>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi +3 -7
@@ -100,14 +100,13 @@ &dsi_out { &i2c0 { status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&touchscreen_pins>; touchscreen: touchscreen@10 { compatible = "elan,ekth3500"; reg = <0x10>; - pinctrl-names = "default"; - pinctrl-0 = <&touchscreen_pins>; - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; reset-gpios = <&pio 156 GPIO_ACTIVE_LOW>;
@@ -116,7 +115,7 @@ touchscreen: touchscreen@10 { &i2c2 { pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins>; + pinctrl-0 = <&i2c2_pins>, <&trackpad_pins>; status = "okay"; clock-frequency = <400000>;
@@ -124,9 +123,6 @@ trackpad@15 { compatible = "elan,ekth3000"; reg = <0x15>; - pinctrl-names = "default"; - pinctrl-0 = <&trackpad_pins>; - interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>; wakeup-source;
Signature · 1 line
2.47.0.199.ga7371fff76-goog
PATCH RESEND v2 2/4 arm64: dts: mediatek: mt8183: Switch to Elan touchscreen driver
In reply to Hsin-Te YuanAfter commit 2be404486c05 ("HID: i2c-hid-of: Add reset GPIO support to i2c-hid-of"), the i2c-hid-of driver used by some mt8183 devices resets the touchscreen without having enough post-reset delay. This makes those touchscreen fail to get probed.
Switch to Elan touchscreen driver, which has enough post-reset delay.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 10 +++------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts | 9 ++------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts | 9 ++------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts | 9 ++------- 4 files changed, 9 insertions(+), 28 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts +3 -7
@@ -14,14 +14,10 @@ / { }; &touchscreen { - status = "okay"; + compatible = "elan,ekth6a12nay"; - compatible = "hid-over-i2c"; - reg = <0x10>; - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - - post-power-on-delay-ms = <10>; - hid-descr-addr = <0x0001>; + vcc33-supply = <&pp3300_alw>; + vccio-supply = <&pp1800_alw>; }; &qca_wifi {
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts +2 -7
@@ -27,14 +27,9 @@ &cros_ec_pwm { }; &touchscreen { - status = "okay"; - - compatible = "hid-over-i2c"; - reg = <0x10>; - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; + compatible = "elan,ekth6a12nay"; - post-power-on-delay-ms = <10>; - hid-descr-addr = <0x0001>; + vcc33-supply = <&pp3300_alw>; }; &qca_wifi {
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts +2 -7
@@ -14,14 +14,9 @@ / { }; &touchscreen { - status = "okay"; + compatible = "elan,ekth6a12nay"; - compatible = "hid-over-i2c"; - reg = <0x10>; - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - - post-power-on-delay-ms = <10>; - hid-descr-addr = <0x0001>; + vcc33-supply = <&pp3300_alw>; };
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts +2 -7
@@ -14,14 +14,9 @@ / { }; &touchscreen { - status = "okay"; + compatible = "elan,ekth6a12nay"; - compatible = "hid-over-i2c"; - reg = <0x10>; - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - - post-power-on-delay-ms = <10>; - hid-descr-addr = <0x0001>; + vcc33-supply = <&pp3300_alw>; };
Signature · 1 line
2.47.0.199.ga7371fff76-goog
PATCH RESEND v2 3/4 arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
In reply to Hsin-Te YuanSome kenzo devices use second source touchscreen.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts +12 -0
@@ -12,3 +12,15 @@ / { chassis-type = "laptop"; compatible = "google,juniper-sku17", "google,juniper", "mediatek,mt8183"; }; + +&i2c0 { + touchscreen@40 { + compatible = "hid-over-i2c"; + reg = <0x40>; + + interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; + + post-power-on-delay-ms = <70>; + hid-descr-addr = <0x0001>; + }; +};
Signature · 1 line
2.47.0.199.ga7371fff76-goog
PATCH RESEND v2 4/4 arm64: dts: mediatek: mt8183: willow: Support second source touchscreen
In reply to Hsin-Te YuanSome willow devices use second source touchscreen.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts | 12 ------------ 1 file changed, 12 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts +0 -12
@@ -12,15 +12,3 @@ / { chassis-type = "laptop"; compatible = "google,juniper-sku17", "google,juniper", "mediatek,mt8183"; }; - -&i2c0 { - touchscreen@40 { - compatible = "hid-over-i2c"; - reg = <0x40>; - - interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>; - - post-power-on-delay-ms = <70>; - hid-descr-addr = <0x0001>; - }; -};
Signature · 1 line
2.47.0.199.ga7371fff76-goog
Rob Herring (Arm)
maintainerQuoted 41 lines · Hsin-Te Yuan
After commit
2be404486c05("HID: i2c-hid-of: Add reset GPIO support to i2c-hid-of"), i2c-hid-of driver resets the touchscreen without having proper post-reset delay on OF platform. From the commit message of that commit, not to decribe poset-reset delay in device tree is intended. Instead, describing the delay in platform data and changing to use specialized driver is more preferable solution.Also workaround the race condition of pinctrl used by touchscreen and trackpad in this series to avoid merge conflict.
Adding other second source touchscreen used by some mt8183 devices in this series since this should be based on the workaround of pinctrl issue.
Signed-off-by Hsin-Te Yuan <[email protected]>---
Changes in v2:
- Add second source touchscreen patches since they should based on the first patch of this series.
- Link to v1: https://lore.kernel.org/r/[email protected]---
Hsin-Te Yuan (4):
arm64: dts: mediatek: mt8183: Fix race condition of pinctrl
arm64: dts: mediatek: mt8183: Switch to Elan touchscreen driver
arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
arm64: dts: mediatek: mt8183: willow: Support second source touchscreenarch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts | 2 -- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-cozmo.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 12 +++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts | 11 ++--------- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi | 3 --- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico6.dts | 3 --- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 10 +++------- 12 files changed, 12 insertions(+), 63 deletions(-)
Quoted 10 lines
---
base-commit:eca631b8fe808748d7585059c4307005ca5c5820
change-id: 20241018-post-reset-ac66b0351613Best regards,
--
Hsin-Te Yuan <[email protected]>
My bot found new DTB warnings on the .dts files added or changed in this series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:
pip3 install dtschema --upgrade
New warnings running 'make CHECK_DTBS=y mediatek/mt8183-kukui-jacuzzi-burnet.dtb mediatek/mt8183-kukui-jacuzzi-cozmo.dtb mediatek/mt8183-kukui-jacuzzi-damu.dtb mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dtb mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dtb mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dtb mediatek/mt8183-kukui-jacuzzi-kenzo.dtb mediatek/mt8183-kukui-jacuzzi-pico.dtb mediatek/mt8183-kukui-jacuzzi-pico6.dtb' for [email protected]:
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dtb: dsi@14014000: Unevaluated properties are not allowed ('ports' was unexpected)
from schema $id: http://devicetree.org/schemas/display/mediatek/mediatek,dsi.yaml#
AngeloGioacchino Del Regno
maintainerIl 05/11/24 04:08, Hsin-Te Yuan ha scritto:
Quoted 7 lines
After commit
2be404486c05("HID: i2c-hid-of: Add reset GPIO support to i2c-hid-of"), i2c-hid-of driver resets the touchscreen without having proper post-reset delay on OF platform. From the commit message of that commit, not to decribe poset-reset delay in device tree is intended. Instead, describing the delay in platform data and changing to use specialized driver is more preferable solution.
Quoted 8 lines
Also workaround the race condition of pinctrl used by touchscreen and trackpad in this series to avoid merge conflict.
Adding other second source touchscreen used by some mt8183 devices in this series since this should be based on the workaround of pinctrl issue.
Signed-off-by Hsin-Te Yuan <[email protected]>
The switch to i2c-hid-of-elan is okay, but the pinctrl hack is not necessary anymore, as it does get resolved with the hwprober from Chen-Yu
https://lore.kernel.org/all/[email protected]/
Please redo the second source TS addition based on that series instead.
Thanks,
Angelo
Quoted 31 lines
---
Changes in v2:
- Add second source touchscreen patches since they should based on the first patch of this series.
- Link to v1: https://lore.kernel.org/r/[email protected]---
Hsin-Te Yuan (4):
arm64: dts: mediatek: mt8183: Fix race condition of pinctrl
arm64: dts: mediatek: mt8183: Switch to Elan touchscreen driver
arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
arm64: dts: mediatek: mt8183: willow: Support second source touchscreenarch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts | 2 -- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-cozmo.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 12 +++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku1.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku6.dts | 11 ++--------- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel-sku7.dts | 11 ++--------- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi | 3 --- .../boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico.dts | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-pico6.dts | 3 --- .../arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi | 3 --- arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 10 +++------- 12 files changed, 12 insertions(+), 63 deletions(-)---
base-commit:eca631b8fe808748d7585059c4307005ca5c5820
change-id: 20241018-post-reset-ac66b0351613Best regards,