aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Vaswani <rvaswani@codeaurora.org>2013-06-10 18:50:19 -0400
committerDavid Brown <davidb@codeaurora.org>2013-06-12 16:52:51 -0400
commiteda9dcfa56f4864e0e4340f5af3f3e39f514b726 (patch)
treee7e48f1169aa36fc3eff75135cc8d24b362d3302
parent1a56e4b23d2b4445397419202ff40e0b34ba3d7e (diff)
ARM: msm: Remove gpiomux-v2 and re-organize MSM_GPIOMUX configs
Remove gpiomux-v2 as it's not being used and make way for future improvements. Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org>
-rw-r--r--arch/arm/mach-msm/Kconfig13
-rw-r--r--arch/arm/mach-msm/Makefile6
-rw-r--r--arch/arm/mach-msm/gpiomux-8x60.c19
-rw-r--r--arch/arm/mach-msm/gpiomux-v2.c25
-rw-r--r--arch/arm/mach-msm/gpiomux-v2.h61
-rw-r--r--arch/arm/mach-msm/gpiomux.c15
-rw-r--r--arch/arm/mach-msm/gpiomux.h5
-rw-r--r--drivers/gpio/gpio-msm-v2.c5
8 files changed, 24 insertions, 125 deletions
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index fceb093b9494..614e41e7881b 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -48,9 +48,7 @@ config ARCH_MSM8X60
48 select CPU_V7 48 select CPU_V7
49 select GPIO_MSM_V2 49 select GPIO_MSM_V2
50 select HAVE_SMP 50 select HAVE_SMP
51 select MSM_GPIOMUX
52 select MSM_SCM if SMP 51 select MSM_SCM if SMP
53 select MSM_V2_TLMM
54 select USE_OF 52 select USE_OF
55 53
56config ARCH_MSM8960 54config ARCH_MSM8960
@@ -58,9 +56,8 @@ config ARCH_MSM8960
58 select ARM_GIC 56 select ARM_GIC
59 select CPU_V7 57 select CPU_V7
60 select HAVE_SMP 58 select HAVE_SMP
61 select MSM_GPIOMUX 59 select GPIO_MSM_V2
62 select MSM_SCM if SMP 60 select MSM_SCM if SMP
63 select MSM_V2_TLMM
64 select USE_OF 61 select USE_OF
65 62
66config MSM_HAS_DEBUG_UART_HS 63config MSM_HAS_DEBUG_UART_HS
@@ -124,10 +121,10 @@ config MSM_SMD
124 bool 121 bool
125 122
126config MSM_GPIOMUX 123config MSM_GPIOMUX
127 bool 124 depends on !(ARCH_MSM8X60 || ARCH_MSM8960)
128 125 bool "MSM V1 TLMM GPIOMUX architecture"
129config MSM_V2_TLMM 126 help
130 bool 127 Support for MSM V1 TLMM GPIOMUX architecture.
131 128
132config MSM_SCM 129config MSM_SCM
133 bool 130 bool
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 17519faf082f..1a26d04c9400 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -27,7 +27,5 @@ obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
27obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o 27obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
28obj-$(CONFIG_ARCH_MSM8X60) += board-dt-8660.o 28obj-$(CONFIG_ARCH_MSM8X60) += board-dt-8660.o
29obj-$(CONFIG_ARCH_MSM8960) += board-dt-8960.o 29obj-$(CONFIG_ARCH_MSM8960) += board-dt-8960.o
30 30obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o
31obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o 31obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o
32obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o
33obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o
diff --git a/arch/arm/mach-msm/gpiomux-8x60.c b/arch/arm/mach-msm/gpiomux-8x60.c
deleted file mode 100644
index 7b380b31bd0e..000000000000
--- a/arch/arm/mach-msm/gpiomux-8x60.c
+++ /dev/null
@@ -1,19 +0,0 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17#include "gpiomux.h"
18
19struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {};
diff --git a/arch/arm/mach-msm/gpiomux-v2.c b/arch/arm/mach-msm/gpiomux-v2.c
deleted file mode 100644
index 273396d2b127..000000000000
--- a/arch/arm/mach-msm/gpiomux-v2.c
+++ /dev/null
@@ -1,25 +0,0 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17#include <linux/io.h>
18#include <mach/msm_iomap.h>
19#include "gpiomux.h"
20
21void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val)
22{
23 writel(val & ~GPIOMUX_CTL_MASK,
24 MSM_TLMM_BASE + 0x1000 + (0x10 * gpio));
25}
diff --git a/arch/arm/mach-msm/gpiomux-v2.h b/arch/arm/mach-msm/gpiomux-v2.h
deleted file mode 100644
index 3bf10e7f0381..000000000000
--- a/arch/arm/mach-msm/gpiomux-v2.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17#ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_V2_H
18#define __ARCH_ARM_MACH_MSM_GPIOMUX_V2_H
19
20#define GPIOMUX_NGPIOS 173
21
22typedef u16 gpiomux_config_t;
23
24enum {
25 GPIOMUX_DRV_2MA = 0UL << 6,
26 GPIOMUX_DRV_4MA = 1UL << 6,
27 GPIOMUX_DRV_6MA = 2UL << 6,
28 GPIOMUX_DRV_8MA = 3UL << 6,
29 GPIOMUX_DRV_10MA = 4UL << 6,
30 GPIOMUX_DRV_12MA = 5UL << 6,
31 GPIOMUX_DRV_14MA = 6UL << 6,
32 GPIOMUX_DRV_16MA = 7UL << 6,
33};
34
35enum {
36 GPIOMUX_FUNC_GPIO = 0UL << 2,
37 GPIOMUX_FUNC_1 = 1UL << 2,
38 GPIOMUX_FUNC_2 = 2UL << 2,
39 GPIOMUX_FUNC_3 = 3UL << 2,
40 GPIOMUX_FUNC_4 = 4UL << 2,
41 GPIOMUX_FUNC_5 = 5UL << 2,
42 GPIOMUX_FUNC_6 = 6UL << 2,
43 GPIOMUX_FUNC_7 = 7UL << 2,
44 GPIOMUX_FUNC_8 = 8UL << 2,
45 GPIOMUX_FUNC_9 = 9UL << 2,
46 GPIOMUX_FUNC_A = 10UL << 2,
47 GPIOMUX_FUNC_B = 11UL << 2,
48 GPIOMUX_FUNC_C = 12UL << 2,
49 GPIOMUX_FUNC_D = 13UL << 2,
50 GPIOMUX_FUNC_E = 14UL << 2,
51 GPIOMUX_FUNC_F = 15UL << 2,
52};
53
54enum {
55 GPIOMUX_PULL_NONE = 0UL,
56 GPIOMUX_PULL_DOWN = 1UL,
57 GPIOMUX_PULL_KEEPER = 2UL,
58 GPIOMUX_PULL_UP = 3UL,
59};
60
61#endif
diff --git a/arch/arm/mach-msm/gpiomux.c b/arch/arm/mach-msm/gpiomux.c
index 53af21abd155..2b8e2d217082 100644
--- a/arch/arm/mach-msm/gpiomux.c
+++ b/arch/arm/mach-msm/gpiomux.c
@@ -17,9 +17,24 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include "gpiomux.h" 19#include "gpiomux.h"
20#include "proc_comm.h"
20 21
21static DEFINE_SPINLOCK(gpiomux_lock); 22static DEFINE_SPINLOCK(gpiomux_lock);
22 23
24static void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val)
25{
26 unsigned tlmm_config = (val & ~GPIOMUX_CTL_MASK) |
27 ((gpio & 0x3ff) << 4);
28 unsigned tlmm_disable = 0;
29 int rc;
30
31 rc = msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX,
32 &tlmm_config, &tlmm_disable);
33 if (rc)
34 pr_err("%s: unexpected proc_comm failure %d: %08x %08x\n",
35 __func__, rc, tlmm_config, tlmm_disable);
36}
37
23int msm_gpiomux_write(unsigned gpio, 38int msm_gpiomux_write(unsigned gpio,
24 gpiomux_config_t active, 39 gpiomux_config_t active,
25 gpiomux_config_t suspended) 40 gpiomux_config_t suspended)
diff --git a/arch/arm/mach-msm/gpiomux.h b/arch/arm/mach-msm/gpiomux.h
index 00459f6ee13c..8e82f41a8923 100644
--- a/arch/arm/mach-msm/gpiomux.h
+++ b/arch/arm/mach-msm/gpiomux.h
@@ -20,12 +20,7 @@
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <mach/msm_gpiomux.h> 22#include <mach/msm_gpiomux.h>
23
24#if defined(CONFIG_MSM_V2_TLMM)
25#include "gpiomux-v2.h"
26#else
27#include "gpiomux-v1.h" 23#include "gpiomux-v1.h"
28#endif
29 24
30/** 25/**
31 * struct msm_gpiomux_config: gpiomux settings for one gpio line. 26 * struct msm_gpiomux_config: gpiomux settings for one gpio line.
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index dd2eddeb1e0c..75cc8215f15b 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -29,7 +29,6 @@
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31 31
32#include <mach/msm_gpiomux.h>
33#include <mach/msm_iomap.h> 32#include <mach/msm_iomap.h>
34 33
35/* Bits of interest in the GPIO_IN_OUT register. 34/* Bits of interest in the GPIO_IN_OUT register.
@@ -159,12 +158,12 @@ static int msm_gpio_direction_output(struct gpio_chip *chip,
159 158
160static int msm_gpio_request(struct gpio_chip *chip, unsigned offset) 159static int msm_gpio_request(struct gpio_chip *chip, unsigned offset)
161{ 160{
162 return msm_gpiomux_get(chip->base + offset); 161 return 0;
163} 162}
164 163
165static void msm_gpio_free(struct gpio_chip *chip, unsigned offset) 164static void msm_gpio_free(struct gpio_chip *chip, unsigned offset)
166{ 165{
167 msm_gpiomux_put(chip->base + offset); 166 return;
168} 167}
169 168
170static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 169static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset)