#include <asm/arch/sys_proto.h>
#include <asm/mach-types.h>
+#include "pandora-buttons.h"
+
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_KEYBOARD
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++) {
--- /dev/null
+/*
+ * (C) Copyright 2010
+ * Grazvydas Ignotas <notasas@gmail.com>
+ *
+ * (C) Copyright 2013
+ * Urja Rannikko <urjaman@gmail.com>
+ *
+ * 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