Skip to contentSkip to conversation

arm64: dts: qcom: sc7180-trogdor: Split out keyboard node and describe detachables

PATCH Applied Stephen Boyd 3 participants 3 messages Jun 27, 2022 – Jul 3, 2022

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

PATCH v2 1/1 arm64: dts: qcom: sc7180-trogdor: Split out keyboard node and describe detachables

Trogdor devices that have a detachable keyboard still have a non-detachable keyboard input device present because we include the cros-ec-keyboard.dtsi snippet in the top-level sc7180-trogdor.dtsi file that every variant board includes. We do this because the keyboard-controller node also provides some buttons like the power button and volume buttons. Unfortunately, this means we register a keyboard input device that doesn't do anything on boards with a detachable keyboard.

Change the node's compatible on detachables to the newly introduced "google,cros-ec-keyb-switches" compatible to indicate that there are only switches and no keyboard to register. Similarly, move the keyboard include that defines the keyboard-controller node out of sc7180-trogdor.dtsi to boards that actually have a keyboard so that the matrix properties are not defined on boards with the switches compatible. Future boards can either use the include approach or the node definition approach to describe a keyboard with possible switches or just some switches.

Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Hsin-Yi Wang <[email protected]>
Cc "Joseph S. Barrera III" <[email protected]>

---

Changes from v1 (https://lore.kernel.org/r/[email protected]):
* Rebased onto Joe's series applied on top of qcom's arm64-fixes-for-4.19
* Updated more dtsi files

 arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi        | 4 ++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi      | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi    | 2 +-
 arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi         | 1 +
 arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi       | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi       | 1 +
 arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi        | 2 ++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dts             | 2 ++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi   | 4 ++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi               | 1 -
 11 files changed, 33 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +4 -0
index 8ac1f1e61006..7ee407f7b6bb 100644
@@ -81,6 +81,10 @@ &camcc {
 };
 
 &cros_ec {
+	keyboard-controller {
+		compatible = "google,cros-ec-keyb-switches";
+	};
+
 	cros_ec_proximity: proximity {
 		compatible = "google,cros-ec-mkbp-proximity";
 		label = "proximity-wifi";
arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi +6 -0
index d1e2df5164ea..1bd6c7dcd9e9 100644
@@ -114,6 +114,12 @@ &camcc {
 	status = "okay";
 };
 
+&cros_ec {
+	keyboard-controller {
+		compatible = "google,cros-ec-keyb-switches";
+	};
+};
+
 &panel {
 	compatible = "samsung,atna33xc20";
 	enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi +1 -1
index a19406cd29a5..74f0e07ea5cf 100644
@@ -6,7 +6,7 @@
  */
 
 /* This file must be included after sc7180-trogdor.dtsi */
-
+#include <arm/cros-ec-keyboard.dtsi>
 #include "sc7180-trogdor-lte-sku.dtsi"
 
 &alc5682 {
arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi +1 -0
index 88f6a7d4d020..2cf7d5212c61 100644
@@ -6,6 +6,7 @@
  */
 
 /* This file must be included after sc7180-trogdor.dtsi */
+#include <arm/cros-ec-keyboard.dtsi>
 
 &ap_sar_sensor {
 	semtech,cs0-ground;
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi +6 -0
index 33d1d8a29038..97cba7f8064f 100644
@@ -58,6 +58,12 @@ &camcc {
 	status = "okay";
 };
 
+&cros_ec {
+	keyboard-controller {
+		compatible = "google,cros-ec-keyb-switches";
+	};
+};
+
 &dsi0 {
 
 	panel: panel@0 {
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi +1 -0
index 2d13b94e9313..56d787785fd5 100644
@@ -6,6 +6,7 @@
  */
 
 /* This file must be included after sc7180-trogdor.dtsi */
+#include <arm/cros-ec-keyboard.dtsi>
 
 &ap_sar_sensor {
 	compatible = "semtech,sx9324";
arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi +2 -0
index 3df4920295ad..a7582fb547ee 100644
@@ -6,6 +6,8 @@
  */
 
 #include "sc7180-trogdor.dtsi"
+/* Must come after sc7180-trogdor.dtsi to modify cros_ec */
+#include <arm/cros-ec-keyboard.dtsi>
 #include "sc7180-trogdor-ti-sn65dsi86.dtsi"
 
 / {
arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi +6 -0
index 574b78eb4f28..695b04fe7221 100644
@@ -46,6 +46,12 @@ &camcc {
 	status = "okay";
 };
 
+&cros_ec {
+	keyboard-controller {
+		compatible = "google,cros-ec-keyb-switches";
+	};
+};
+
 &dsi0 {
 	panel: panel@0 {
 		/* Compatible will be filled in per-board */
arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dts +2 -0
index 352827e5740a..59a23d0e9651 100644
@@ -8,6 +8,8 @@
 /dts-v1/;
 
 #include "sc7180-trogdor.dtsi"
+/* Must come after sc7180-trogdor.dtsi to modify cros_ec */
+#include <arm/cros-ec-keyboard.dtsi>
 #include "sc7180-trogdor-ti-sn65dsi86.dtsi"
 
 / {
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi +4 -0
index 701dd11a12cf..6312108e8b3e 100644
@@ -104,6 +104,10 @@ &cros_ec {
 	base_detection: cbas {
 		compatible = "google,cros-cbas";
 	};
+
+	keyboard-controller {
+		compatible = "google,cros-ec-keyb-switches";
+	};
 };
 
 &dsi0 {
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +0 -1
index e55dbaa6dc12..1a4f2e8cc3dc 100644
@@ -903,7 +903,6 @@ cros_ec_fp: ec@0 {
 	};
 };
 
-#include <arm/cros-ec-keyboard.dtsi>
 #include <arm/cros-ec-sbs.dtsi>
 
 &uart3 {

base-commit: d640974d1c4ee510fcc8f05f0ddaaf9d17b47643
prerequisite-patch-id: e4e5e59ecf0e67976cbf6e54a85e5ba2018dc0ff
prerequisite-patch-id: dc0ebbff0f2ed6c8674bdebef127d7f10b7dacbf
prerequisite-patch-id: 41a558fdc22515e78b2caeb3630ecd075072eb74
prerequisite-patch-id: 90167e33f0cd4d8aa92cb6221964779de53d8cf4
prerequisite-patch-id: b7cfa974f20a01ba2121cbe61dc1c9ac70ec8442

Signature · 1 line
https://chromeos.dev
Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 32 lines · Stephen Boyd

Trogdor devices that have a detachable keyboard still have a non-detachable keyboard input device present because we include the cros-ec-keyboard.dtsi snippet in the top-level sc7180-trogdor.dtsi file that every variant board includes. We do this because the keyboard-controller node also provides some buttons like the power button and volume buttons. Unfortunately, this means we register a keyboard input device that doesn't do anything on boards with a detachable keyboard.

Change the node's compatible on detachables to the newly introduced "google,cros-ec-keyb-switches" compatible to indicate that there are only switches and no keyboard to register. Similarly, move the keyboard include that defines the keyboard-controller node out of sc7180-trogdor.dtsi to boards that actually have a keyboard so that the matrix properties are not defined on boards with the switches compatible. Future boards can either use the include approach or the node definition approach to describe a keyboard with possible switches or just some switches.

Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Hsin-Yi Wang <[email protected]>
Cc "Joseph S. Barrera III" <[email protected]>

---

Changes from v1 (https://lore.kernel.org/r/[email protected]):
* Rebased onto Joe's series applied on top of qcom's arm64-fixes-for-4.19
* Updated more dtsi files

Quoted 12 lines
 arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi        | 4 ++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi      | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi    | 2 +-
 arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi         | 1 +
 arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi       | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi       | 1 +
 arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi        | 2 ++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi | 6 ++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dts             | 2 ++
 arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi   | 4 ++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi               | 1 -
 11 files changed, 33 insertions(+), 2 deletions(-)
#2 lore raw

Re: (subset) [PATCH v2] arm64: dts: qcom: sc7180-trogdor: Split out keyboard node and describe detachables

In reply to Stephen Boyd
Quoted 10 lines · Stephen Boyd

Trogdor devices that have a detachable keyboard still have a non-detachable keyboard input device present because we include the cros-ec-keyboard.dtsi snippet in the top-level sc7180-trogdor.dtsi file that every variant board includes. We do this because the keyboard-controller node also provides some buttons like the power button and volume buttons. Unfortunately, this means we register a keyboard input device that doesn't do anything on boards with a detachable keyboard.

[...]

Applied, thanks!

[1/1] arm64: dts: qcom: sc7180-trogdor: Split out keyboard node and describe detachables

      commit: a10b760b7402563661fa305882b181a75a1d4894

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>