]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: dt: move gpio-keys to DT
authorVinayak Pane <vpane@nvidia.com>
Tue, 11 Feb 2014 23:41:42 +0000 (15:41 -0800)
committerMrutyunjay Sawant <msawant@nvidia.com>
Wed, 26 Mar 2014 14:17:53 +0000 (07:17 -0700)
Moving gpio-keys mapping to DTS files. Removing
board specific kbc file.

Bug 1449481

Change-Id: I89360ce51616d26ff0622dc83b5506b872edfcfc
Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-on: http://git-master/r/384087
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
arch/arm/boot/dts/tegra124-foster.dts
arch/arm/boot/dts/tegra124-loki.dts
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-loki-kbc.c [deleted file]
arch/arm/mach-tegra/board-loki.c
arch/arm64/boot/dts/tegra132-loki.dts
arch/arm64/mach-tegra/Makefile
arch/arm64/mach-tegra/board-loki-kbc.c [deleted file]

index 4f087dcf36e47f97303ab57ec62d0667e18ad437..50edda4db0fa1f46a490ec48124fbf7d7b7e07aa 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "tegra124.dtsi"
 #include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/input/input.h>
 #include <tegra124-platforms/tegra124-loki-gpio-default.dtsi>
 #include <tegra124-platforms/tegra124-loki-pinmux.dtsi>
 
                nvidia,supply_s1p05v = "avddio_usb";
                status = "okay";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               input-name = "gpio-keys";
+               power {
+                       label = "Power";
+                       gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       gpio-key,wakeup;
+                       debounce-interval = <10>;
+               };
+       };
 };
index 66707bd86f952fc79d61abaa018c999f33133e13..2c888d8bb86f2be901e6bc275803f2e44df4fa7c 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "tegra124.dtsi"
 #include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/input/input.h>
 #include <tegra124-platforms/tegra124-loki-gpio-default.dtsi>
 #include <tegra124-platforms/tegra124-loki-pinmux.dtsi>
 
                nvidia,ulpicap = <0>; /* No ulpi support. can we remove */
                status = "okay";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               input-name = "gpio-keys";
+
+               power {
+                       label = "Power";
+                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       linux,input-type = <EV_KEY>;
+                       gpio-key,wakeup;
+                       debounce-interval = <10>;
+               };
+
+               hall_effect {
+                       label = "Hall Effect Sensor";
+                       gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <0>;
+                       linux,input-type = <EV_SW>;
+                       gpio-key,wakeup;
+                       debounce-interval = <0>;
+               };
+
+               gamepad {
+                       label = "Gamepad";
+                       gpios = <&gpio TEGRA_GPIO(S, 6) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WAKEUP>;
+                       linux,input-type = <EV_KEY>;
+                       gpio-key,wakeup;
+                       debounce-interval = <0>;
+               };
+       };
 };
index 1184da9c8d6583cbfb1ed839be699ea7fc1aafd6..f6580f581fd6554101edd2ebbca81695ee79feb7 100644 (file)
@@ -250,7 +250,6 @@ obj-${CONFIG_SYSEDP_FRAMEWORK}          += board-ardbeg-sysedp.o
 endif
 
 obj-${CONFIG_MACH_LOKI}                += board-loki.o
-obj-${CONFIG_MACH_LOKI}                += board-loki-kbc.o
 obj-${CONFIG_MACH_LOKI}                += board-loki-sensors.o
 obj-${CONFIG_MACH_LOKI}                += board-loki-panel.o
 obj-${CONFIG_MACH_LOKI}                += board-loki-pinmux.o
index fb71c20f4a80289856a28af255d0090e1fa680c7..02e140e3805d304b82b7ccda4148d8f02e54c9e2 100644 (file)
@@ -1284,9 +1284,6 @@ static void __init tegra_ardbeg_late_init(void)
 
        if (board_info.board_id == BOARD_PM374)
                norrin_kbc_init();
-       else if (board_info.board_id == BOARD_E2548 ||
-                       board_info.board_id == BOARD_P2530)
-               loki_kbc_init();
 
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
diff --git a/arch/arm/mach-tegra/board-loki-kbc.c b/arch/arm/mach-tegra/board-loki-kbc.c
deleted file mode 100644 (file)
index a27a20e..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * arch/arm/mach-tegra/board-loki-kbc.c
- * Keys configuration for Nvidia tegra4 loki platform.
- *
- * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
- *
- * 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 <linux/io.h>
-#include <linux/input/tegra_kbc.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/mfd/palmas.h>
-
-#include "tegra-board-id.h"
-#include "board.h"
-#include "board-loki.h"
-#include "devices.h"
-#include "iomap.h"
-#include "wakeups-t12x.h"
-
-
-#define GPIO_KEY(_id, _gpio, _iswake)           \
-       {                                       \
-               .code = _id,                    \
-               .gpio = TEGRA_GPIO_##_gpio,     \
-               .active_low = 1,                \
-               .desc = #_id,                   \
-               .type = EV_KEY,                 \
-               .wakeup = _iswake,              \
-               .debounce_interval = 10,        \
-       }
-
-#define GPIO_IKEY(_id, _irq, _iswake, _deb)    \
-       {                                       \
-               .code = _id,                    \
-               .gpio = -1,                     \
-               .irq = _irq,                    \
-               .desc = #_id,                   \
-               .type = EV_KEY,                 \
-               .wakeup = _iswake,              \
-               .debounce_interval = _deb,      \
-       }
-
-#define PMC_WAKE_STATUS         0x14
-#define TEGRA_WAKE_PWR_INT      (1UL << 18)
-#define PMC_WAKE2_STATUS        0x168
-
-static int loki_wakeup_key(void);
-
-static struct gpio_keys_button loki_int_keys[] = {
-       [0] = GPIO_KEY(KEY_POWER, PQ0, 1),
-       [1] = {
-               .code = SW_LID,
-               .gpio = TEGRA_GPIO_HALL,
-               .irq = -1,
-               .type = EV_SW,
-               .desc = "Hall Effect Sensor",
-               .active_low = 1,
-               .wakeup = 1,
-               .debounce_interval = 0,
-       },
-       [2] = {
-               .code = KEY_WAKEUP,
-               .gpio = TEGRA_GPIO_PS6,
-               .irq = -1,
-               .type = EV_KEY,
-               .desc = "Gamepad",
-               .active_low = 1,
-               .wakeup = 1,
-               .debounce_interval = 0,
-       },
-};
-
-static struct gpio_keys_platform_data loki_int_keys_pdata = {
-       .buttons        = loki_int_keys,
-       .nbuttons       = ARRAY_SIZE(loki_int_keys),
-       .wakeup_key     = loki_wakeup_key,
-};
-
-static struct platform_device loki_int_keys_device = {
-       .name   = "gpio-keys",
-       .id     = 0,
-       .dev    = {
-               .platform_data  = &loki_int_keys_pdata,
-       },
-};
-
-static int loki_wakeup_key(void)
-{
-       int wakeup_key;
-       u32 status;
-       status = readl(IO_ADDRESS(TEGRA_PMC_BASE) + PMC_WAKE_STATUS)
-               | (u64)readl(IO_ADDRESS(TEGRA_PMC_BASE)
-               + PMC_WAKE2_STATUS) << 32;
-
-       if (status & TEGRA_WAKE_GPIO_PQ0)
-               wakeup_key = KEY_POWER;
-       else if (status & (1UL << TEGRA_WAKE_GPIO_PS0))
-               wakeup_key = SW_LID;
-       else if (status & (1UL << TEGRA_WAKE_GPIO_PS6))
-               wakeup_key = KEY_WAKEUP;
-       else
-               wakeup_key = -1;
-
-       return wakeup_key;
-}
-
-int __init loki_kbc_init(void)
-{
-       struct board_info board_info;
-       int ret;
-
-       tegra_get_board_info(&board_info);
-       pr_info("Boardid:SKU = 0x%04x:0x%04x\n",
-                       board_info.board_id, board_info.sku);
-
-       ret = platform_device_register(&loki_int_keys_device);
-       return ret;
-}
index e9518d570746a4429efeaa121242377058149326..71236d41cee4845977f9169abba475cc42203b29 100644 (file)
@@ -841,7 +841,6 @@ static void __init tegra_loki_late_init(void)
        isomgr_init();
        loki_touch_init();
        loki_panel_init();
-       loki_kbc_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
 #endif
index a8813e3ad81c8f64814c10d8c047ea59dba7233b..7db8c5680f1b04b15344ee5109d70bd08baf588b 100644 (file)
                nvidia,ulpicap = <0>; /* No ulpi support. can we remove */
                status = "okay";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               input-name = "gpio-keys";
+               power {
+                       label = "Power";
+                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       linux,input-type = <EV_KEY>;
+                       gpio-key,wakeup;
+                       debounce-interval = <10>;
+               };
+
+               hall_effect {
+                       label = "Hall Effect Sensor";
+                       gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <0>;
+                       linux,input-type = <EV_SW>;
+                       gpio-key,wakeup;
+                       debounce-interval = <0>;
+               };
+
+               gamepad {
+                       label = "Gamepad";
+                       gpios = <&gpio TEGRA_GPIO(S, 6) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WAKEUP>;
+                       linux,input-type = <EV_KEY>;
+                       gpio-key,wakeup;
+                       debounce-interval = <0>;
+               };
+       };
 };
index d4cda4e9343246a7ba6581b76ac983ce57950715..2b9d231ccdc02ab6a3fb325dcbe4092962bcb639 100644 (file)
@@ -30,7 +30,6 @@ obj-${CONFIG_MACH_LOKI}               += board-loki-pinmux.o
 obj-${CONFIG_MACH_LOKI}               += board-loki-memory.o
 obj-${CONFIG_MACH_LOKI}               += board-loki-sdhci.o
 obj-${CONFIG_MACH_LOKI}               += board-loki-sensors.o
-obj-${CONFIG_MACH_LOKI}               += board-loki-kbc.o
 obj-${CONFIG_MACH_LOKI}               += board-loki-fan.o
 obj-${CONFIG_MACH_LOKI}               += board-loki-panel.o
 obj-${CONFIG_MACH_LOKI}               += panel-l-720p-5-loki.o
diff --git a/arch/arm64/mach-tegra/board-loki-kbc.c b/arch/arm64/mach-tegra/board-loki-kbc.c
deleted file mode 100644 (file)
index 24412b2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* FIXME: temporary */
-#include "../../arm/mach-tegra/board-loki-kbc.c"