diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-03-24 21:36:19 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-03-25 04:23:29 -0700 |
commit | 9c387643e40fcfb6cf6eb426d75c81873fa7c098 (patch) | |
tree | 3f9facb04b2a531553809e196f9780fb738038fe | |
parent | 8687d2a6fd67d709ed193a26b7dbca4eab2c3fa2 (diff) |
ARM: tegra: move keys to DT for Norrin
Move keys registration to DT for Norrin.
Change-Id: I4e67ffa7d46082c2a38e7acdb1c24b634f3f8d34
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/385727
Reviewed-by: Venkata Jagadish <vjagadish@nvidia.com>
-rw-r--r-- | arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi | 21 | ||||
-rw-r--r-- | arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi | 33 | ||||
-rw-r--r-- | arch/arm/mach-tegra/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-norrin-kbc.c | 92 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-norrin-power.c | 15 | ||||
-rw-r--r-- | arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi | 18 | ||||
-rw-r--r-- | arch/arm64/mach-tegra/Makefile | 2 | ||||
-rw-r--r-- | arch/arm64/mach-tegra/board-norrin-kbc.c | 2 | ||||
-rw-r--r-- | arch/arm64/mach-tegra/board-t132ref-norrin-kbc.c | 2 |
11 files changed, 73 insertions, 118 deletions
diff --git a/arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi b/arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi index 8831683944b3..eb0ce4b8803b 100644 --- a/arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi +++ b/arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi @@ -1,6 +1,7 @@ #include "tegra124.dtsi" #include "tegra124-platforms/tegra124-pm374-gpio-default.dtsi" #include "tegra124-platforms/tegra124-pm374-pinmux.dtsi" +#include "tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi" / { model = "NVIDIA Tegra124 Norrin"; @@ -15,6 +16,10 @@ linux,initrd-end = <0x851bc400>; }; + aliases { + gpio264 = &tca6416; + }; + serial@70006000 { compatible = "nvidia,tegra114-hsuart"; status = "okay"; @@ -30,6 +35,22 @@ status = "okay"; }; + i2c@7000c000 { + + tca6416: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + interrupt-parent = <&gpio>; + interrupts = <TEGRA_GPIO(Q, 5) 0x0>; + + #gpio-cells = <2>; + gpio-controller; + + #interrupt-cells = <2>; + interrupt-controller; + }; + }; + i2c@7000d000 { nvidia,bit-banging-xfer-after-shutdown; }; diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi new file mode 100644 index 000000000000..30106acf0bf4 --- /dev/null +++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi @@ -0,0 +1,33 @@ +#include <dt-bindings/gpio/tegra-gpio.h> +#include <dt-bindings/input/input.h> + +/ { + gpio-keys { + compatible = "gpio-keys"; + + power { + label = "Power"; + gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>; + linux,code = <KEY_POWER>; + gpio-key,wakeup; + }; + + home { + label = "Home"; + gpios = <&tca6416 1 GPIO_ACTIVE_LOW>; + linux,code = <KEY_HOME>; + }; + + volume_down { + label = "Volume Down"; + gpios = <&tca6416 5 GPIO_ACTIVE_LOW>; + linux,code = <KEY_VOLUMEDOWN>; + }; + + volume_up { + label = "Volume Up"; + gpios = <&tca6416 4 GPIO_ACTIVE_LOW>; + linux,code = <KEY_VOLUMEUP>; + }; + }; +}; diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 1184da9c8d65..258848773c78 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -232,7 +232,6 @@ obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-memory.o obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-power.o obj-${CONFIG_MACH_ARDBEG} += board-tn8-power.o obj-${CONFIG_MACH_ARDBEG} += board-norrin-power.o -obj-${CONFIG_MACH_ARDBEG} += board-norrin-kbc.o obj-${CONFIG_MACH_ARDBEG} += board-norrin-memory.o obj-${CONFIG_MACH_ARDBEG} += panel-a-1080p-11-6.o obj-${CONFIG_MACH_ARDBEG} += panel-a-1200-800-8-0.o diff --git a/arch/arm/mach-tegra/board-ardbeg.c b/arch/arm/mach-tegra/board-ardbeg.c index 6d7131a0b80f..273858290b0e 100644 --- a/arch/arm/mach-tegra/board-ardbeg.c +++ b/arch/arm/mach-tegra/board-ardbeg.c @@ -1325,9 +1325,7 @@ static void __init tegra_ardbeg_late_init(void) tegra_io_dpd_enable(&pexclk1_io); tegra_io_dpd_enable(&pexclk2_io); - if (board_info.board_id == BOARD_PM374) - norrin_kbc_init(); - else if (board_info.board_id == BOARD_E2548 || + if (board_info.board_id == BOARD_E2548 || board_info.board_id == BOARD_P2530) loki_kbc_init(); diff --git a/arch/arm/mach-tegra/board-ardbeg.h b/arch/arm/mach-tegra/board-ardbeg.h index 784280dd06b2..61dcee976fac 100644 --- a/arch/arm/mach-tegra/board-ardbeg.h +++ b/arch/arm/mach-tegra/board-ardbeg.h @@ -155,7 +155,6 @@ int laguna_edp_init(void); /* Norrin specific */ int norrin_regulator_init(void); -int norrin_kbc_init(void); int norrin_soctherm_init(void); int norrin_emc_init(void); diff --git a/arch/arm/mach-tegra/board-norrin-kbc.c b/arch/arm/mach-tegra/board-norrin-kbc.c deleted file mode 100644 index 61fd964045cc..000000000000 --- a/arch/arm/mach-tegra/board-norrin-kbc.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * arch/arm/mach-tegra/board-norrin-kbc.c - * Keys configuration for NVIDIA T124 Norrin platform. - * - * Copyright (c) 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 "tegra-board-id.h" -#include "board.h" -#include "board-ardbeg.h" -#include "devices.h" -#include "iomap.h" -#include "wakeups-t12x.h" - -#define GPIO_KEY(_id, _gpio, _iswake) \ - { \ - .code = _id, \ - .gpio = _gpio, \ - .active_low = 1, \ - .desc = #_id, \ - .type = EV_KEY, \ - .wakeup = _iswake, \ - .debounce_interval = 10, \ - } - -#define PMC_WAKE_STATUS 0x14 -#define TEGRA_WAKE_PWR_INT (1UL << 18) -#define PMC_WAKE2_STATUS 0x168 - -static struct gpio_keys_button norrin_keys[] = { - [0] = GPIO_KEY(KEY_POWER, TEGRA_GPIO_PQ0, 1), - [1] = GPIO_KEY(KEY_HOME, PMU_TCA6416_GPIO(1), 0), - [2] = GPIO_KEY(KEY_VOLUMEUP, PMU_TCA6416_GPIO(4), 0), - [3] = GPIO_KEY(KEY_VOLUMEDOWN, PMU_TCA6416_GPIO(5), 0), -}; - -static int norrin_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 & ((u64)1 << TEGRA_WAKE_GPIO_PQ0)) - wakeup_key = KEY_POWER; - else - wakeup_key = -1; - - return wakeup_key; -} - -static struct gpio_keys_platform_data norrin_keys_pdata = { - .buttons = norrin_keys, - .nbuttons = ARRAY_SIZE(norrin_keys), - .wakeup_key = norrin_wakeup_key, -}; - -static struct platform_device norrin_keys_device = { - .name = "gpio-keys", - .id = 0, - .dev = { - .platform_data = &norrin_keys_pdata, - }, -}; - -int __init norrin_kbc_init(void) -{ - return platform_device_register(&norrin_keys_device); -} diff --git a/arch/arm/mach-tegra/board-norrin-power.c b/arch/arm/mach-tegra/board-norrin-power.c index ac8c0d56dd18..60216a3c3627 100644 --- a/arch/arm/mach-tegra/board-norrin-power.c +++ b/arch/arm/mach-tegra/board-norrin-power.c @@ -264,18 +264,6 @@ static struct as3722_platform_data as3722_pdata = { .minor_rev = 1, }; -static struct pca953x_platform_data tca6416_pdata = { - .gpio_base = PMU_TCA6416_GPIO_BASE, - .irq_base = PMU_TCA6416_IRQ_BASE, -}; - -static struct i2c_board_info tca6416_expander[] = { - { - I2C_BOARD_INFO("tca6416", 0x20), - .platform_data = &tca6416_pdata, - }, -}; - static struct i2c_board_info __initdata as3722_regulators[] = { { I2C_BOARD_INFO("as3722", 0x40), @@ -322,9 +310,6 @@ int __init norrin_as3722_regulator_init(void) pr_info("%s: i2c_register_board_info\n", __func__); i2c_register_board_info(4, as3722_regulators, ARRAY_SIZE(as3722_regulators)); - tca6416_expander[0].irq = gpio_to_irq(TEGRA_GPIO_PQ5); - i2c_register_board_info(0, tca6416_expander, - ARRAY_SIZE(tca6416_expander)); return 0; } diff --git a/arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi b/arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi index fcc710e57c27..f4c07e7a1087 100644 --- a/arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi +++ b/arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi @@ -1,6 +1,7 @@ #include "tegra132.dtsi" #include "tegra124-platforms/tegra124-pm374-gpio-default.dtsi" #include "tegra124-platforms/tegra124-pm374-pinmux.dtsi" +#include "tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi" / { model = "norrin"; @@ -14,6 +15,10 @@ linux,initrd-end = <0x824B5300>; }; + aliases { + gpio264 = &tca6416; + }; + serial@70006000 { compatible = "nvidia,tegra114-hsuart"; status = "okay"; @@ -32,6 +37,19 @@ i2c@7000c000 { clock-frequency = <100000>; + tca6416: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + interrupt-parent = <&gpio>; + interrupts = <TEGRA_GPIO(Q, 5) 0x0>; + + #gpio-cells = <2>; + gpio-controller; + + #interrupt-cells = <2>; + interrupt-controller; + }; + cm32181@48 { compatible = "capella,cm32181"; reg = <0x48>; diff --git a/arch/arm64/mach-tegra/Makefile b/arch/arm64/mach-tegra/Makefile index d4cda4e93432..e9af4921b119 100644 --- a/arch/arm64/mach-tegra/Makefile +++ b/arch/arm64/mach-tegra/Makefile @@ -22,7 +22,6 @@ obj-${CONFIG_MACH_EXUMA} += board-ardbeg64-sysedp.o obj-${CONFIG_MACH_EXUMA} += board-ardbeg64-sata.o obj-${CONFIG_MACH_EXUMA} += board-norrin-power.o obj-${CONFIG_MACH_EXUMA} += board-norrin64-memory.o -obj-${CONFIG_MACH_EXUMA} += board-norrin-kbc.o obj-${CONFIG_MACH_EXUMA} += board-tn8-power.o obj-${CONFIG_MACH_LOKI} += board-loki-power.o @@ -42,7 +41,6 @@ obj-${CONFIG_MACH_T132REF} += board-t132ref.o obj-${CONFIG_MACH_T132REF} += board-t132ref-laguna-power.o obj-${CONFIG_MACH_T132REF} += board-t132ref-memory.o obj-${CONFIG_MACH_T132REF} += board-t132ref-sensors.o -obj-${CONFIG_MACH_T132REF} += board-t132ref-norrin-kbc.o obj-${CONFIG_MACH_T132REF} += board-t132ref-norrin-power.o obj-${CONFIG_MACH_T132REF} += board-t132ref-norrin-memory.o obj-${CONFIG_MACH_T132REF} += board-t132ref-panel.o diff --git a/arch/arm64/mach-tegra/board-norrin-kbc.c b/arch/arm64/mach-tegra/board-norrin-kbc.c deleted file mode 100644 index 430d88dde1c2..000000000000 --- a/arch/arm64/mach-tegra/board-norrin-kbc.c +++ /dev/null @@ -1,2 +0,0 @@ -/* FIXME: temporary */ -#include "../../arm/mach-tegra/board-norrin-kbc.c" diff --git a/arch/arm64/mach-tegra/board-t132ref-norrin-kbc.c b/arch/arm64/mach-tegra/board-t132ref-norrin-kbc.c deleted file mode 100644 index 430d88dde1c2..000000000000 --- a/arch/arm64/mach-tegra/board-t132ref-norrin-kbc.c +++ /dev/null @@ -1,2 +0,0 @@ -/* FIXME: temporary */ -#include "../../arm/mach-tegra/board-norrin-kbc.c" |