From: Kevin Hilman Date: Fri, 31 May 2013 16:27:05 +0000 (-0700) Subject: ARM: dts: OMAP3: beagle: enable user button via gpio_keys, enable wakeup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d641c3d5870db37709f9536054122255f007058c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ARM: dts: OMAP3: beagle: enable user button via gpio_keys, enable wakeup Using the gpio-keys bindings, configure the user button on Beagle boards. Since the user button is enabled as a wakeup source, also ensure the GPIO pin is mux'd correctly and has IO ring wakeups enabled, so it can also wakeup from off mode. Special thanks to Florian Vaussard for suggesting the preprocessor feature. Cc: Florian Vaussard Signed-off-by: Kevin Hilman Signed-off-by: Benoit Cousson --- diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 7fb806dafbc7..ad17b6bdc87a 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -57,6 +57,26 @@ ti,mcbsp = <&mcbsp2>; ti,codec = <&twl_audio>; }; + + gpio_keys { + compatible = "gpio-keys"; + + user { + label = "user"; + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + linux,code = <0x114>; + gpio-key,wakeup; + }; + + }; +}; + +&omap3_pmx_wkup { + gpio1_pins: pinmux_gpio1_pins { + pinctrl-single,pins = < + 0x0e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot2.gpio_4 */ + >; + }; }; &i2c1 { @@ -140,3 +160,8 @@ pinctrl-names = "default"; pinctrl-0 = <&uart3_pins>; }; + +&gpio1 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio1_pins>; +}; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 0b6dbfa62c95..eb7e02a01a0b 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -71,6 +71,26 @@ reset-supply = <&hsusb2_reset>; vcc-supply = <&hsusb2_power>; }; + + gpio_keys { + compatible = "gpio-keys"; + + user { + label = "user"; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + linux,code = <0x114>; + gpio-key,wakeup; + }; + + }; +}; + +&omap3_pmx_wkup { + gpio1_pins: pinmux_gpio1_pins { + pinctrl-single,pins = < + 0x14 (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot5.gpio_7 */ + >; + }; }; &omap3_pmx_core { @@ -154,3 +174,8 @@ pinctrl-names = "default"; pinctrl-0 = <&uart3_pins>; }; + +&gpio1 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio1_pins>; +};