Message ID | 1386899355-17379-7-git-send-email-troy.kisky@boundarydevices.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Friday, December 13, 2013 at 02:49:10 AM, Troy Kisky wrote: > Add power, menu, home, back, volume up, and volume down > buttons. > > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Are these really present on the board or are they on some expansion board? I am not sure how to handle this case when the GPIO buttons are on optional expansion board, maybe someone else (Shawn?) will help here. Best regards, Marek Vasut
On 12/13/2013 4:51 AM, Marek Vasut wrote: > On Friday, December 13, 2013 at 02:49:10 AM, Troy Kisky wrote: >> Add power, menu, home, back, volume up, and volume down >> buttons. >> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> > Are these really present on the board or are they on some expansion board? I am > not sure how to handle this case when the GPIO buttons are on optional expansion > board, maybe someone else (Shawn?) will help here. > > Best regards, > Marek Vasut > You are right, it is an expansion board. But the signals do not conflict with any other expansion board that I know of. Troy
On Friday, December 13, 2013 at 07:45:10 PM, Troy Kisky wrote: > On 12/13/2013 4:51 AM, Marek Vasut wrote: > > On Friday, December 13, 2013 at 02:49:10 AM, Troy Kisky wrote: > >> Add power, menu, home, back, volume up, and volume down > >> buttons. > >> > >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> > > > > Are these really present on the board or are they on some expansion > > board? I am not sure how to handle this case when the GPIO buttons are > > on optional expansion board, maybe someone else (Shawn?) will help here. > > > > Best regards, > > Marek Vasut > > You are right, it is an expansion board. But the signals do not conflict > with any other > expansion board that I know of. ... yet ;-) Best regards, Marek Vasut
Hi Marek, On 12/13/2013 02:50 PM, Marek Vasut wrote: > On Friday, December 13, 2013 at 07:45:10 PM, Troy Kisky wrote: >> On 12/13/2013 4:51 AM, Marek Vasut wrote: >>> On Friday, December 13, 2013 at 02:49:10 AM, Troy Kisky wrote: >>>> Add power, menu, home, back, volume up, and volume down >>>> buttons. >>>> >>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> >>> >>> Are these really present on the board or are they on some expansion >>> board? I am not sure how to handle this case when the GPIO buttons are >>> on optional expansion board, maybe someone else (Shawn?) will help here. >>> >>> Best regards, >>> Marek Vasut >> >> You are right, it is an expansion board. But the signals do not conflict >> with any other >> expansion board that I know of. > > ... yet ;-) > I know of a dozen or so folks who are re-purposing these pins (that's the thing about GPIOs!), but in many cases, they're doing so by catching the input events matched as this patch defines them . And since this is how the schematics and hardware manuals label the pins, this is the proper way to handle them in the default kernel. Regards, Eric
On Friday, December 13, 2013 at 10:55:55 PM, Eric Nelson wrote: > Hi Marek, > > On 12/13/2013 02:50 PM, Marek Vasut wrote: > > On Friday, December 13, 2013 at 07:45:10 PM, Troy Kisky wrote: > >> On 12/13/2013 4:51 AM, Marek Vasut wrote: > >>> On Friday, December 13, 2013 at 02:49:10 AM, Troy Kisky wrote: > >>>> Add power, menu, home, back, volume up, and volume down > >>>> buttons. > >>>> > >>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> > >>> > >>> Are these really present on the board or are they on some expansion > >>> board? I am not sure how to handle this case when the GPIO buttons are > >>> on optional expansion board, maybe someone else (Shawn?) will help > >>> here. > >>> > >>> Best regards, > >>> Marek Vasut > >> > >> You are right, it is an expansion board. But the signals do not conflict > >> with any other > >> expansion board that I know of. > > > > ... yet ;-) > > I know of a dozen or so folks who are re-purposing these pins > (that's the thing about GPIOs!), but in many cases, they're > doing so by catching the input events matched as this patch > defines them . > > And since this is how the schematics and hardware manuals label > the pins, this is the proper way to handle them in the default > kernel. OK, I won't pester you about this. Best regards, Marek Vasut
On Thu, Dec 12, 2013 at 06:49:10PM -0700, Troy Kisky wrote: > Add power, menu, home, back, volume up, and volume down > buttons. > > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> > --- > arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 47 ++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) > > diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi > index b548647..fa10ded 100644 > --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi > +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi > @@ -9,6 +9,7 @@ > * http://www.opensource.org/licenses/gpl-license.html > * http://www.gnu.org/copyleft/gpl.html > */ > +#include <dt-bindings/gpio/gpio.h> > > / { > memory { > @@ -49,6 +50,46 @@ > }; > }; > > + gpio-keys { > + compatible = "gpio-keys"; Nit: add a blank line here. > + power { > + label = "Power Button"; > + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; > + linux,code = <116>; /* KEY_POWER, or search */ Please use the macros defined in include/dt-bindings/input/input.h, so that you can save the comment for that number. Shawn > + gpio-key,wakeup; > + }; > + > + menu { > + label = "Menu"; > + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; > + linux,code = <139>; /* KEY_MENU */ > + }; > + > + home { > + label = "Home"; > + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + linux,code = <102>; /* KEY_HOME */ > + }; > + > + back { > + label = "Back"; > + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; > + linux,code = <158>; /* KEY_BACK */ > + }; > + > + volume-up { > + label = "Volume Up"; > + gpios = <&gpio7 13 GPIO_ACTIVE_LOW>; > + linux,code = <115>; /* KEY_VOLUMEUP */ > + }; > + > + volume-down { > + label = "Volume Down"; > + gpios = <&gpio4 5 GPIO_ACTIVE_LOW>; > + linux,code = <114>; /* KEY_VOLUMEDOWN */ > + }; > + }; > + > sound { > compatible = "fsl,imx6q-sabrelite-sgtl5000", > "fsl,imx-audio-sgtl5000"; > @@ -121,6 +162,12 @@ > /* USDHC3 CD */ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 > /* USDHC3 WP */ MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0 > /* SGTL5000 sys_mclk */ MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000b0 > +/* Power Button */ MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0 > +/* Menu Button */ MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0 > +/* Home Button */ MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x1b0b0 > +/* Back Button */ MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0 > +/* Volume Up Button */ MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x1b0b0 > +/* Volume Down Button */ MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0 > >; > }; > > -- > 1.8.1.2 >
diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index b548647..fa10ded 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -9,6 +9,7 @@ * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ +#include <dt-bindings/gpio/gpio.h> / { memory { @@ -49,6 +50,46 @@ }; }; + gpio-keys { + compatible = "gpio-keys"; + power { + label = "Power Button"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + linux,code = <116>; /* KEY_POWER, or search */ + gpio-key,wakeup; + }; + + menu { + label = "Menu"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + linux,code = <139>; /* KEY_MENU */ + }; + + home { + label = "Home"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + linux,code = <102>; /* KEY_HOME */ + }; + + back { + label = "Back"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + linux,code = <158>; /* KEY_BACK */ + }; + + volume-up { + label = "Volume Up"; + gpios = <&gpio7 13 GPIO_ACTIVE_LOW>; + linux,code = <115>; /* KEY_VOLUMEUP */ + }; + + volume-down { + label = "Volume Down"; + gpios = <&gpio4 5 GPIO_ACTIVE_LOW>; + linux,code = <114>; /* KEY_VOLUMEDOWN */ + }; + }; + sound { compatible = "fsl,imx6q-sabrelite-sgtl5000", "fsl,imx-audio-sgtl5000"; @@ -121,6 +162,12 @@ /* USDHC3 CD */ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 /* USDHC3 WP */ MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0 /* SGTL5000 sys_mclk */ MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000b0 +/* Power Button */ MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0 +/* Menu Button */ MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0 +/* Home Button */ MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x1b0b0 +/* Back Button */ MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0 +/* Volume Up Button */ MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x1b0b0 +/* Volume Down Button */ MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0 >; };
Add power, menu, home, back, volume up, and volume down buttons. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> --- arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)