From: Urja Rannikko Date: Tue, 25 Jun 2013 04:15:30 +0000 (+0100) Subject: pandora: Re-organize the GPIO button definitions. X-Git-Tag: sz_175~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c5b4d8a7d6c089a372b28cbb49909063dcbfd7;p=pandora-u-boot.git pandora: Re-organize the GPIO button definitions. Should have no difference in code. Signed-off-by: Urja Rannikko --- diff --git a/board/pandora/kbd.c b/board/pandora/kbd.c index 5bfef4f0b7b..f35f2d1172c 100644 --- a/board/pandora/kbd.c +++ b/board/pandora/kbd.c @@ -48,6 +48,8 @@ #include #include +#include "pandora-buttons.h" + DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_KEYBOARD @@ -179,13 +181,14 @@ int twl4030_kbd_tstc(void) if (keys[7]&0x08) mods |= 4; /* Shift */ /* Add L from GPIOs as shift also */ - if (!(readl(&gpio4_base->datain) & GPIO6)) /* R */ + if (!(readl(&gpio4_base->datain) & BTN_L)) /* L */ mods |= 4; /* Add ctrl state from the GPIOs (R or select) */ - if (!(readl(&gpio4_base->datain) & GPIO9)) /* R */ + if (!(readl(&gpio4_base->datain) & BTN_R)) /* R */ mods |= 1; - if (!(readl(&gpio4_base->datain) & GPIO8)) /* Select */ + + if (!(readl(&gpio4_base->datain) & BTN_SELECT)) /* Select */ mods |= 1; for (c = 0; c < 8; c++) { diff --git a/board/pandora/menu.c b/board/pandora/menu.c index eba459576ba..d14527ba529 100644 --- a/board/pandora/menu.c +++ b/board/pandora/menu.c @@ -6,12 +6,7 @@ #include #include -/* game buttons as in GPIO bank 4 */ -#define BTN_R GPIO9 -#define BTN_UP GPIO14 -#define BTN_DOWN GPIO7 -#define BTN_G2 GPIO15 -#define BTN_G3 GPIO10 +#include "pandora-buttons.h" struct menu_item { const char *name; diff --git a/board/pandora/pandora-buttons.h b/board/pandora/pandora-buttons.h new file mode 100644 index 00000000000..869d828b7d2 --- /dev/null +++ b/board/pandora/pandora-buttons.h @@ -0,0 +1,40 @@ +/* + * (C) Copyright 2010 + * Grazvydas Ignotas + * + * (C) Copyright 2013 + * Urja Rannikko + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#ifndef _PANDORA_BUTTONS_H_ +#define _PANDORA_BUTTONS_H_ + +/* game buttons as in GPIO bank 4 */ +#define BTN_LEFT GPIO0 +#define BTN_RIGHT GPIO2 +#define BTN_L GPIO6 +#define BTN_DOWN GPIO7 +#define BTN_SELECT GPIO8 +#define BTN_R GPIO9 +#define BTN_G3 GPIO10 +#define BTN_UP GPIO14 +#define BTN_G2 GPIO15 + +#endif