ARM: tegra: move key driver to DT for ardbeg, TN8 and Laguna
Laxman Dewangan [Thu, 14 Nov 2013 09:34:33 +0000 (14:34 +0530)]
Change-Id: I3a8380f3789aa272335fc373f3cff3d80ba81f08
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/331048

17 files changed:
arch/arm/boot/dts/tegra124-ardbeg-a03-00.dts
arch/arm/boot/dts/tegra124-ardbeg.dts
arch/arm/boot/dts/tegra124-e1782_sku1100.dts
arch/arm/boot/dts/tegra124-e1791.dts
arch/arm/boot/dts/tegra124-laguna.dts
arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-keys.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra124-tn8-a03-00.dts
arch/arm/boot/dts/tegra124-tn8-battery.dts
arch/arm/boot/dts/tegra124-tn8-e1769.dts
arch/arm/boot/dts/tegra124-tn8-fury.dts
arch/arm/boot/dts/tegra124-tn8-generic.dtsi
arch/arm/boot/dts/tegra124-tn8.dts
arch/arm/boot/dts/tegra124-tn8b-generic.dtsi
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-ardbeg-kbc.c [deleted file]
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-ardbeg.h

index 2d37c74..c620461 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-ardbeg-a03.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Ardbeg";
index fcfc01f..c1efd38 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Ardbeg";
index 7975424..a8bb353 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Ardbeg";
index 2899273..2071bc1 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 
 / {
index 68a0c6b..5562485 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Laguna";
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-keys.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-keys.dtsi
new file mode 100644 (file)
index 0000000..3e8d9df
--- /dev/null
@@ -0,0 +1,39 @@
+#include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               camera_focus {
+                       label = "Camera Focus";
+                       gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_CAMERA_FOCUS>;
+               };
+
+               home {
+                       label = "Home";
+                       gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_HOME>;
+               };
+
+               power {
+                       label = "Power";
+                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       gpio-key,wakeup;
+               };
+
+               volume_down {
+                       label = "Volume Down";
+                       gpios = <&gpio TEGRA_GPIO(Q, 7) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+               };
+
+               volume_up {
+                       label = "Volume Up";
+                       gpios = <&gpio TEGRA_GPIO(Q, 6) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+               };
+       };
+};
index 2360795..f2b6c79 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-tn8-generic.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 TN8";
index f8d2d4c..5399e10 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-tn8-generic.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 TN8";
index bc01730..0a90cde 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-tn8b-generic.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 TN8";
index 2baae19..ff20b67 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-tn8-generic.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 tn8 fury";
index 871f090..17fe31c 100644 (file)
                spi-max-frequency = <25000000>;
        };
 
-       gpio-keys {
-               compatible = "gpio-keys";
-
-               camera_focus {
-                       label = "Camera Focus";
-                       gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_CAMERA_FOCUS>;
-               };
-
-               home {
-                       label = "Home";
-                       gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_HOME>;
-               };
-
-               power {
-                       label = "Power";
-                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_POWER>;
-                       gpio-key,wakeup;
-               };
-
-               volume_down {
-                       label = "Volume Down";
-                       gpios = <&gpio TEGRA_GPIO(Q, 7) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_VOLUMEDOWN>;
-               };
-
-               volume_up {
-                       label = "Volume Up";
-                       gpios = <&gpio TEGRA_GPIO(Q, 6) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_VOLUMEUP>;
-               };
-       };
-
        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
index 08db25d..4727ea6 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-tn8-generic.dtsi"
+#include "tegra124-platforms/tegra124-e1780-keys.dtsi"
 
 / {
        model = "NVIDIA Tegra124 TN8";
index 5908eea..0a8b315 100644 (file)
                spi-max-frequency = <25000000>;
        };
 
-       gpio-keys {
-               compatible = "gpio-keys";
-
-               camera_focus {
-                       label = "Camera Focus";
-                       gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_CAMERA_FOCUS>;
-               };
-
-               home {
-                       label = "Home";
-                       gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_HOME>;
-               };
-
-               power {
-                       label = "Power";
-                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_POWER>;
-                       gpio-key,wakeup;
-               };
-
-               volume_down {
-                       label = "Volume Down";
-                       gpios = <&gpio TEGRA_GPIO(Q, 7) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_VOLUMEDOWN>;
-               };
-
-               volume_up {
-                       label = "Volume Up";
-                       gpios = <&gpio TEGRA_GPIO(Q, 6) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_VOLUMEUP>;
-               };
-       };
-
        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
index 521bde3..22b3b69 100644 (file)
@@ -258,7 +258,6 @@ obj-${CONFIG_MACH_TEGRA_PLUTO}          += panel-j-720p-4-7.o
 obj-${CONFIG_MACH_TEGRA_PLUTO}          += panel-s-1080p-5.o
 
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg.o
-obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-kbc.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-sdhci.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-sata.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-sensors.o
@@ -299,7 +298,6 @@ obj-${CONFIG_MACH_LOKI}                     += panel-l-720p-5-loki.o
 obj-${CONFIG_MACH_LOKI}                += panel-j-1440-810-5-8.o
 
 obj-${CONFIG_MACH_LAGUNA}               += board-ardbeg.o
-obj-${CONFIG_MACH_LAGUNA}               += board-ardbeg-kbc.o
 obj-${CONFIG_MACH_LAGUNA}               += board-ardbeg-sdhci.o
 obj-${CONFIG_MACH_LAGUNA}               += board-ardbeg-sata.o
 obj-${CONFIG_MACH_LAGUNA}               += board-ardbeg-sensors.o
diff --git a/arch/arm/mach-tegra/board-ardbeg-kbc.c b/arch/arm/mach-tegra/board-ardbeg-kbc.c
deleted file mode 100644 (file)
index 3ce8ed6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * arch/arm/mach-tegra/board-ardbeg-kbc.c
- * Keys configuration for Nvidia tegra4 ardbeg 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/gpio.h>
-#include <linux/gpio_keys.h>
-
-#include "iomap.h"
-#include "wakeups-t12x.h"
-#include "gpio-names.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 PMC_WAKE2_STATUS         0x168
-#define TEGRA_WAKE_PWR_INT      (1UL << 19)
-
-static int ardbeg_wakeup_key(void)
-{
-       u32 status;
-       int is_power_key;
-
-       status = __raw_readl(IO_ADDRESS(TEGRA_PMC_BASE) + PMC_WAKE2_STATUS);
-
-       is_power_key = !!(status & TEGRA_WAKE_PWR_INT);
-       if (is_power_key) {
-               pr_info("%s: Power key pressed\n", __func__);
-               return KEY_POWER;
-       }
-       return KEY_RESERVED;
-}
-
-static struct gpio_keys_button ardbeg_int_keys[] = {
-       [0] = GPIO_KEY(KEY_POWER, PQ0, 1),
-       [1] = GPIO_KEY(KEY_VOLUMEUP, PQ6, 0),
-       [2] = GPIO_KEY(KEY_VOLUMEDOWN, PQ7, 0),
-       [3] = GPIO_KEY(KEY_HOME, PI5, 0),
-       [4] = GPIO_KEY(KEY_CAMERA_FOCUS, PQ2, 0),
-};
-
-static struct gpio_keys_platform_data ardbeg_int_keys_pdata = {
-       .buttons        = ardbeg_int_keys,
-       .nbuttons       = ARRAY_SIZE(ardbeg_int_keys),
-       .wakeup_key     = ardbeg_wakeup_key,
-};
-
-static struct platform_device ardbeg_int_keys_device = {
-       .name   = "gpio-keys",
-       .id     = 0,
-       .dev    = {
-               .platform_data  = &ardbeg_int_keys_pdata,
-       },
-};
-
-int __init ardbeg_kbc_init(void)
-{
-       /* GPIO-Keys from DT for TN8 */
-       if (of_machine_is_compatible("nvidia,tn8"))
-               return 0;
-
-       return platform_device_register(&ardbeg_int_keys_device);
-}
index f7a19dd..87796b9 100644 (file)
@@ -1143,7 +1143,6 @@ static void __init tegra_ardbeg_late_init(void)
        isomgr_init();
        ardbeg_touch_init();
        ardbeg_panel_init();
-       ardbeg_kbc_init();
        if (board_info.board_id == BOARD_PM358)
                laguna_pm358_pmon_init();
        else
index c2f3758..0ae9f27 100644 (file)
@@ -28,7 +28,6 @@
 int ardbeg_pinmux_init(void);
 int ardbeg_emc_init(void);
 int ardbeg_panel_init(void);
-int ardbeg_kbc_init(void);
 int ardbeg_sdhci_init(void);
 int ardbeg_sata_init(void);
 int ardbeg_sensors_init(void);