summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-pluto-kbc.c
diff options
context:
space:
mode:
authoraghuge <aghuge@nvidia.com>2012-08-29 18:12:32 +0530
committerVarun Colbert <vcolbert@nvidia.com>2012-08-30 17:49:58 -0700
commitb186528ee483ebfb11ac99fef6847369ed849691 (patch)
tree9e6ee2d6170d4a3b51eb9bc1cd6e7ce29ef77fc5 /arch/arm/mach-tegra/board-pluto-kbc.c
parent022f346baeca443dd4f61b540f2b49e7f0012e8a (diff)
ARM: tegra: pluto: added board KBC file
Bug 1017712 Change-Id: I7c152d5946f5432874f6fc9c4be0794973038575 Signed-off-by: aghuge <aghuge@nvidia.com> Reviewed-on: http://git-master/r/128201 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-pluto-kbc.c')
-rw-r--r--arch/arm/mach-tegra/board-pluto-kbc.c97
1 files changed, 97 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-pluto-kbc.c b/arch/arm/mach-tegra/board-pluto-kbc.c
new file mode 100644
index 000000000000..7fa5633fd86a
--- /dev/null
+++ b/arch/arm/mach-tegra/board-pluto-kbc.c
@@ -0,0 +1,97 @@
+/*
+ * arch/arm/mach-tegra/board-pluto-kbc.c
+ * Keys configuration for Nvidia tegra3 pluto platform.
+ *
+ * Copyright (C) 2012 NVIDIA, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <mach/io.h>
+#include <mach/iomap.h>
+#include <mach/kbc.h>
+
+#include "board.h"
+#include "board-pluto.h"
+#include "devices.h"
+
+#define PLUTO_ROW_COUNT 3
+#define PLUTO_COL_COUNT 3
+
+static const u32 kbd_keymap[] = {
+ KEY(0, 0, KEY_POWER),
+ KEY(0, 1, KEY_VOLUMEUP),
+ KEY(0, 2, KEY_VOLUMEDOWN),
+
+ KEY(1, 0, KEY_SEARCH),
+ KEY(1, 1, KEY_CAMERA),
+ KEY(1, 2, KEY_CAMERA_FOCUS),
+
+ KEY(2, 0, KEY_HOME),
+ KEY(2, 1, KEY_BACK),
+ KEY(2, 2, KEY_MENU),
+};
+
+static const struct matrix_keymap_data keymap_data = {
+ .keymap = kbd_keymap,
+ .keymap_size = ARRAY_SIZE(kbd_keymap),
+};
+
+static struct tegra_kbc_wake_key pluto_wake_cfg[] = {
+ [0] = {
+ .row = 0,
+ .col = 0,
+ },
+};
+
+static struct tegra_kbc_platform_data pluto_kbc_platform_data = {
+ .debounce_cnt = 20 * 32, /* 20 ms debaunce time */
+ .repeat_cnt = 1,
+ .scan_count = 30,
+ .wakeup = true,
+ .keymap_data = &keymap_data,
+ .wake_cnt = 2,
+ .wake_cfg = &pluto_wake_cfg[0],
+ .wakeup_key = KEY_POWER,
+#ifdef CONFIG_ANDROID
+ .disable_ev_rep = true,
+#endif
+};
+
+int __init pluto_kbc_init(void)
+{
+ struct tegra_kbc_platform_data *data = &pluto_kbc_platform_data;
+ int i;
+ tegra_kbc_device.dev.platform_data = &pluto_kbc_platform_data;
+ pr_info("Registering tegra-kbc\n");
+
+ BUG_ON((KBC_MAX_ROW + KBC_MAX_COL) > KBC_MAX_GPIO);
+ for (i = 0; i < PLUTO_ROW_COUNT; i++) {
+ data->pin_cfg[i].num = i;
+ data->pin_cfg[i].type = PIN_CFG_ROW;
+ }
+ for (i = 0; i < PLUTO_COL_COUNT; i++) {
+ data->pin_cfg[i + KBC_PIN_GPIO_16].num = i;
+ data->pin_cfg[i + KBC_PIN_GPIO_16].type = PIN_CFG_COL;
+ }
+
+ platform_device_register(&tegra_kbc_device);
+ pr_info("Registering successful tegra-kbc\n");
+ return 0;
+}
+