summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana.c
diff options
context:
space:
mode:
authorVictor Ryabukhin <vryabukhin@nvidia.com>2010-10-27 17:39:47 +0900
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:08 -0800
commite4d6fa318600cb929a1c8dc9f29d0b920ed815d7 (patch)
tree555581084a2726231f1b1801061d5766c4ef3cc1 /arch/arm/mach-tegra/board-ventana.c
parentf06ba73dec4757a6716fd2db42b501033a2854b9 (diff)
Added code to use tegra kbc driver on Ventana board.
This code is off by default. By default Ventana's buttons are GPIO pins. But it is possible to connect it to kbc controller (simple hardware rework needed). This code might be used as a reference code for using kbc driver. Original-Change-Id: Iaad4b8ca4b1bf6da1674e282f3bfb86349927fbd Reviewed-on: http://git-master/r/9801 Tested-by: Victor Ryabukhin <vryabukhin@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rec5eaab861c97d7b363b796db96b8eb181d38782
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-rw-r--r--arch/arm/mach-tegra/board-ventana.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 33eacbd1ba63..05a5eeb5734b 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -145,6 +145,7 @@ static __initdata struct tegra_clk_init_table ventana_clk_init_table[] = {
{ "blink", "clk_32k", 32768, false},
{ "pll_p_out4", "pll_p", 24000000, true },
{ "pwm", "clk_32k", 32768, false},
+ { "kbc", "clk_32k", 32768, true},
{ NULL, NULL, 0, 0},
};
@@ -209,6 +210,8 @@ static void ventana_i2c_init(void)
platform_device_register(&tegra_i2c_device4);
}
+
+#ifdef CONFIG_KEYBOARD_GPIO
#define GPIO_KEY(_id, _gpio, _iswake) \
{ \
.code = _id, \
@@ -242,6 +245,15 @@ static struct platform_device ventana_keys_device = {
},
};
+static void ventana_keys_init(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(ventana_keys); i++)
+ tegra_gpio_enable(ventana_keys[i].gpio);
+}
+#endif
+
static struct platform_device tegra_camera = {
.name = "tegra_camera",
.id = -1,
@@ -257,19 +269,14 @@ static struct platform_device *ventana_devices[] __initdata = {
&tegra_ehci2_device,
&tegra_gart_device,
&tegra_aes_device,
+#ifdef CONFIG_KEYBOARD_GPIO
&ventana_keys_device,
+#endif
&tegra_wdt_device,
&tegra_avp_device,
&tegra_camera,
};
-static void ventana_keys_init(void)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(ventana_keys); i++)
- tegra_gpio_enable(ventana_keys[i].gpio);
-}
static struct panjit_i2c_ts_platform_data panjit_data = {
.gpio_reset = TEGRA_GPIO_PQ7,
@@ -390,7 +397,14 @@ static void __init tegra_ventana_init(void)
ventana_charge_init();
ventana_regulator_init();
ventana_touch_init();
+
+#ifdef CONFIG_KEYBOARD_GPIO
ventana_keys_init();
+#endif
+#ifdef CONFIG_KEYBOARD_TEGRA
+ ventana_kbc_init();
+#endif
+
ventana_usb_init();
ventana_gps_init();
ventana_panel_init();