All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: c630: keep both touchpad devices enabled
@ 2021-01-01  2:24 Shawn Guo
  2021-01-01 14:32 ` Konrad Dybcio
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2021-01-01  2:24 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross
  Cc: Rob Herring, devicetree, linux-arm-msm, Shawn Guo

Indicated by AML code in ACPI table, the touchpad in-use could be found
on two possible slave addresses on &i2c3, i.e. hid@15 and hid@2c.  And
which one is in-use can be determined by reading another address on the
I2C bus.  Unfortunately, for DT boot, there is currently no support in
firmware to make this check and patch DT accordingly.  This results in
a non-functional touchpad on those C630 devices with hid@2c.

As i2c-hid driver will stop probing the device if there is nothing on
the slave address, we can actually keep both devices enabled in DT, and
i2c-hid driver will only probe the existing one.  The only problem is
that we cannot set up pinctrl in both device nodes, as two devices with
the same pinctrl will cause pin conflict that makes the second device
fail to probe.  Let's move the pinctrl state up to parent node to solve
this problem.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index dcfe66f169f9..802966e11152 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -353,6 +353,8 @@
 &i2c3 {
 	status = "okay";
 	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c3_hid_active>;
 
 	tsel: hid@15 {
 		compatible = "hid-over-i2c";
@@ -360,9 +362,6 @@
 		hid-descr-addr = <0x1>;
 
 		interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
-
-		pinctrl-names = "default";
-		pinctrl-0 = <&i2c3_hid_active>;
 	};
 
 	tsc2: hid@2c {
@@ -371,11 +370,6 @@
 		hid-descr-addr = <0x20>;
 
 		interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
-
-		pinctrl-names = "default";
-		pinctrl-0 = <&i2c3_hid_active>;
-
-		status = "disabled";
 	};
 };
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: qcom: c630: keep both touchpad devices enabled
  2021-01-01  2:24 [PATCH] arm64: dts: qcom: c630: keep both touchpad devices enabled Shawn Guo
@ 2021-01-01 14:32 ` Konrad Dybcio
  2021-01-01 15:01   ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Dybcio @ 2021-01-01 14:32 UTC (permalink / raw)
  To: Shawn Guo, Bjorn Andersson, Andy Gross
  Cc: Rob Herring, devicetree, linux-arm-msm

Hi Shawn,


it seems like by doing so you're overwriting the I2C host pinctrl, so (unless that's intentional) the more correct fix would be:


pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>;


Konrad


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: qcom: c630: keep both touchpad devices enabled
  2021-01-01 14:32 ` Konrad Dybcio
@ 2021-01-01 15:01   ` Shawn Guo
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2021-01-01 15:01 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Andy Gross, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-arm-msm

On Fri, Jan 1, 2021 at 10:32 PM Konrad Dybcio
<konrad.dybcio@somainline.org> wrote:
>
> Hi Shawn,
>
> it seems like by doing so you're overwriting the I2C host pinctrl, so (unless that's intentional) the more correct fix would be:
>
> pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>;

Ha, yes, I missed that there is already some default pinctrl state set
up in sdm845.dtsi.  I will fix it with v2.

Thanks for spotting it, Konrad!

Shawn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-01 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01  2:24 [PATCH] arm64: dts: qcom: c630: keep both touchpad devices enabled Shawn Guo
2021-01-01 14:32 ` Konrad Dybcio
2021-01-01 15:01   ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.