]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: dts: rockchip: Split GPIO keys for veyron into multiple devices
authorMatthias Kaehlcke <mka@chromium.org>
Wed, 5 Jun 2019 20:43:19 +0000 (13:43 -0700)
committerHeiko Stuebner <heiko@sntech.de>
Thu, 6 Jun 2019 10:41:04 +0000 (12:41 +0200)
With a single device DT overrides can become messy, especially when
keys are added or removed. Multiple devices also allow to
enable/disable wakeup per key/group.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
[used actual switch+event constants in new lid-switch entry]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
arch/arm/boot/dts/rk3288-veyron-minnie.dts
arch/arm/boot/dts/rk3288-veyron-pinky.dts
arch/arm/boot/dts/rk3288-veyron.dtsi

index fbef34578100f443b2cfbedcf564c8d799c7116d..5727017f34b204a270ff6b76d25b014539412a6b 100644 (file)
@@ -70,6 +70,21 @@ gpio-charger {
                pinctrl-0 = <&ac_present_ap>;
        };
 
+       lid_switch: lid-switch {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&ap_lid_int_l>;
+
+               lid {
+                       label = "Lid";
+                       gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
+                       linux,code = <SW_LID>;
+                       linux,input-type = <EV_SW>;
+                       debounce-interval = <1>;
+               };
+       };
+
        panel: panel {
                compatible ="innolux,n116bge", "simple-panel";
                status = "okay";
@@ -149,18 +164,6 @@ &edp_phy {
        status = "okay";
 };
 
-&gpio_keys {
-       pinctrl-0 = <&pwr_key_l &ap_lid_int_l>;
-       lid {
-               label = "Lid";
-               gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
-               wakeup-source;
-               linux,code = <0>; /* SW_LID */
-               linux,input-type = <5>; /* EV_SW */
-               debounce-interval = <1>;
-       };
-};
-
 &pwm0 {
        status = "okay";
 };
index a65099b4aef1c5fe1efeb11b6e2a7ee169c36204..b2cc70a085541e1a823677fadf6a21b91cd9d5bb 100644 (file)
@@ -48,6 +48,26 @@ vcc18_lcd: vcc18-lcd {
                regulator-boot-on;
                vin-supply = <&vcc18_wl>;
        };
+
+       volume_buttons: volume-buttons {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&volum_down_l &volum_up_l>;
+
+               volum_down {
+                       label = "Volum_down";
+                       gpios = <&gpio5 RK_PB3 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       debounce-interval = <100>;
+               };
+
+               volum_up {
+                       label = "Volum_up";
+                       gpios = <&gpio5 RK_PB2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       debounce-interval = <100>;
+               };
+       };
 };
 
 &backlight {
@@ -90,24 +110,6 @@ &backlight {
        pwm-off-delay-ms = <200>;
 };
 
-&gpio_keys {
-       pinctrl-0 = <&pwr_key_l &ap_lid_int_l &volum_down_l &volum_up_l>;
-
-       volum_down {
-               label = "Volum_down";
-               gpios = <&gpio5 RK_PB3 GPIO_ACTIVE_LOW>;
-               linux,code = <KEY_VOLUMEDOWN>;
-               debounce-interval = <100>;
-       };
-
-       volum_up {
-               label = "Volum_up";
-               gpios = <&gpio5 RK_PB2 GPIO_ACTIVE_LOW>;
-               linux,code = <KEY_VOLUMEUP>;
-               debounce-interval = <100>;
-       };
-};
-
 &i2c_tunnel {
        battery: bq27500@55 {
                compatible = "ti,bq27500";
index 9645be7b3d8ce94a57de997a7b1b3e6c0c2c4897..9b6f4d9b03b64d4c5ea01e68fc9343bfe19ae94b 100644 (file)
@@ -35,7 +35,7 @@ &edp {
        force-hpd;
 };
 
-&gpio_keys {
+&lid_switch {
        pinctrl-0 = <&pwr_key_h &ap_lid_int_l>;
 
        power {
index c574844a6bb24fa20b7ee4b754a175cf7d61d422..3257ca90f0e89545b7e36d4f5dc8b21670a1dc57 100644 (file)
@@ -23,11 +23,11 @@ memory {
                reg = <0x0 0x0 0x0 0x80000000>;
        };
 
-       gpio_keys: gpio-keys {
+       power_button: power-button {
                compatible = "gpio-keys";
-
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key_l>;
+
                power {
                        label = "Power";
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;