aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGregory Bean <gbean@codeaurora.org>2010-08-28 13:05:48 -0400
committerDaniel Walker <dwalker@codeaurora.org>2010-10-06 12:01:17 -0400
commit10c4580e798838fd63eafec5ed304b7ace6db020 (patch)
treea9a03be9100a0b152a59b833642d8dacbdf6ae47 /arch
parent224f6de46ab05677f1fbfa7e384938639ff3f691 (diff)
msm: gpio: Remove tlmm routines obsoleted by gpiomux.
Now that all supported gpio_tlmm_config-using boards are using gpiomux, remove the deprecated code. Signed-off-by: Gregory Bean <gbean@codeaurora.org> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-msm/Makefile1
-rw-r--r--arch/arm/mach-msm/gpio.c85
-rw-r--r--arch/arm/mach-msm/include/mach/gpio.h123
3 files changed, 0 insertions, 209 deletions
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 78424e3f3802..2263b8ffd6b9 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -3,7 +3,6 @@ obj-y += io.o idle.o timer.o dma.o
3obj-y += vreg.o 3obj-y += vreg.o
4obj-y += acpuclock-arm11.o 4obj-y += acpuclock-arm11.o
5obj-y += clock.o clock-pcom.o 5obj-y += clock.o clock-pcom.o
6obj-y += gpio.o
7 6
8ifdef CONFIG_MSM_VIC 7ifdef CONFIG_MSM_VIC
9obj-y += irq-vic.o 8obj-y += irq-vic.o
diff --git a/arch/arm/mach-msm/gpio.c b/arch/arm/mach-msm/gpio.c
deleted file mode 100644
index bc32c845c7b0..000000000000
--- a/arch/arm/mach-msm/gpio.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/* linux/arch/arm/mach-msm/gpio.c
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#include <linux/module.h>
18#include <mach/gpio.h>
19#include "proc_comm.h"
20
21int gpio_tlmm_config(unsigned config, unsigned disable)
22{
23 return msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, &disable);
24}
25EXPORT_SYMBOL(gpio_tlmm_config);
26
27int msm_gpios_enable(const struct msm_gpio *table, int size)
28{
29 int rc;
30 int i;
31 const struct msm_gpio *g;
32 for (i = 0; i < size; i++) {
33 g = table + i;
34 rc = gpio_tlmm_config(g->gpio_cfg, GPIO_ENABLE);
35 if (rc) {
36 pr_err("gpio_tlmm_config(0x%08x, GPIO_ENABLE)"
37 " <%s> failed: %d\n",
38 g->gpio_cfg, g->label ?: "?", rc);
39 pr_err("pin %d func %d dir %d pull %d drvstr %d\n",
40 GPIO_PIN(g->gpio_cfg), GPIO_FUNC(g->gpio_cfg),
41 GPIO_DIR(g->gpio_cfg), GPIO_PULL(g->gpio_cfg),
42 GPIO_DRVSTR(g->gpio_cfg));
43 goto err;
44 }
45 }
46 return 0;
47err:
48 msm_gpios_disable(table, i);
49 return rc;
50}
51EXPORT_SYMBOL(msm_gpios_enable);
52
53void msm_gpios_disable(const struct msm_gpio *table, int size)
54{
55 int rc;
56 int i;
57 const struct msm_gpio *g;
58 for (i = size-1; i >= 0; i--) {
59 g = table + i;
60 rc = gpio_tlmm_config(g->gpio_cfg, GPIO_DISABLE);
61 if (rc) {
62 pr_err("gpio_tlmm_config(0x%08x, GPIO_DISABLE)"
63 " <%s> failed: %d\n",
64 g->gpio_cfg, g->label ?: "?", rc);
65 pr_err("pin %d func %d dir %d pull %d drvstr %d\n",
66 GPIO_PIN(g->gpio_cfg), GPIO_FUNC(g->gpio_cfg),
67 GPIO_DIR(g->gpio_cfg), GPIO_PULL(g->gpio_cfg),
68 GPIO_DRVSTR(g->gpio_cfg));
69 }
70 }
71}
72EXPORT_SYMBOL(msm_gpios_disable);
73
74int msm_gpios_request_enable(const struct msm_gpio *table, int size)
75{
76 int rc = msm_gpios_enable(table, size);
77 return rc;
78}
79EXPORT_SYMBOL(msm_gpios_request_enable);
80
81void msm_gpios_disable_free(const struct msm_gpio *table, int size)
82{
83 msm_gpios_disable(table, size);
84}
85EXPORT_SYMBOL(msm_gpios_disable_free);
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h
index 83e47c0d5c2e..36ad50d3bfaa 100644
--- a/arch/arm/mach-msm/include/mach/gpio.h
+++ b/arch/arm/mach-msm/include/mach/gpio.h
@@ -23,127 +23,4 @@
23#define gpio_cansleep __gpio_cansleep 23#define gpio_cansleep __gpio_cansleep
24#define gpio_to_irq __gpio_to_irq 24#define gpio_to_irq __gpio_to_irq
25 25
26/**
27 * struct msm_gpio - GPIO pin description
28 * @gpio_cfg - configuration bitmap, as per gpio_tlmm_config()
29 * @label - textual label
30 *
31 * Usually, GPIO's are operated by sets.
32 * This struct accumulate all GPIO information in single source
33 * and facilitete group operations provided by msm_gpios_xxx()
34 */
35struct msm_gpio {
36 u32 gpio_cfg;
37 const char *label;
38};
39
40/**
41 * msm_gpios_request_enable() - request and enable set of GPIOs
42 *
43 * Request and configure set of GPIO's
44 * In case of error, all operations rolled back.
45 * Return error code.
46 *
47 * @table: GPIO table
48 * @size: number of entries in @table
49 */
50int msm_gpios_request_enable(const struct msm_gpio *table, int size);
51
52/**
53 * msm_gpios_disable_free() - disable and free set of GPIOs
54 *
55 * @table: GPIO table
56 * @size: number of entries in @table
57 */
58void msm_gpios_disable_free(const struct msm_gpio *table, int size);
59
60/**
61 * msm_gpios_request() - request set of GPIOs
62 * In case of error, all operations rolled back.
63 * Return error code.
64 *
65 * @table: GPIO table
66 * @size: number of entries in @table
67 */
68int msm_gpios_request(const struct msm_gpio *table, int size);
69
70/**
71 * msm_gpios_free() - free set of GPIOs
72 *
73 * @table: GPIO table
74 * @size: number of entries in @table
75 */
76void msm_gpios_free(const struct msm_gpio *table, int size);
77
78/**
79 * msm_gpios_enable() - enable set of GPIOs
80 * In case of error, all operations rolled back.
81 * Return error code.
82 *
83 * @table: GPIO table
84 * @size: number of entries in @table
85 */
86int msm_gpios_enable(const struct msm_gpio *table, int size);
87
88/**
89 * msm_gpios_disable() - disable set of GPIOs
90 *
91 * @table: GPIO table
92 * @size: number of entries in @table
93 */
94void msm_gpios_disable(const struct msm_gpio *table, int size);
95
96/* GPIO TLMM (Top Level Multiplexing) Definitions */
97
98/* GPIO TLMM: Function -- GPIO specific */
99
100/* GPIO TLMM: Direction */
101enum {
102 GPIO_INPUT,
103 GPIO_OUTPUT,
104};
105
106/* GPIO TLMM: Pullup/Pulldown */
107enum {
108 GPIO_NO_PULL,
109 GPIO_PULL_DOWN,
110 GPIO_KEEPER,
111 GPIO_PULL_UP,
112};
113
114/* GPIO TLMM: Drive Strength */
115enum {
116 GPIO_2MA,
117 GPIO_4MA,
118 GPIO_6MA,
119 GPIO_8MA,
120 GPIO_10MA,
121 GPIO_12MA,
122 GPIO_14MA,
123 GPIO_16MA,
124};
125
126enum {
127 GPIO_ENABLE,
128 GPIO_DISABLE,
129};
130
131#define GPIO_CFG(gpio, func, dir, pull, drvstr) \
132 ((((gpio) & 0x3FF) << 4) | \
133 ((func) & 0xf) | \
134 (((dir) & 0x1) << 14) | \
135 (((pull) & 0x3) << 15) | \
136 (((drvstr) & 0xF) << 17))
137
138/**
139 * extract GPIO pin from bit-field used for gpio_tlmm_config
140 */
141#define GPIO_PIN(gpio_cfg) (((gpio_cfg) >> 4) & 0x3ff)
142#define GPIO_FUNC(gpio_cfg) (((gpio_cfg) >> 0) & 0xf)
143#define GPIO_DIR(gpio_cfg) (((gpio_cfg) >> 14) & 0x1)
144#define GPIO_PULL(gpio_cfg) (((gpio_cfg) >> 15) & 0x3)
145#define GPIO_DRVSTR(gpio_cfg) (((gpio_cfg) >> 17) & 0xf)
146
147int gpio_tlmm_config(unsigned config, unsigned disable);
148
149#endif /* __ASM_ARCH_MSM_GPIO_H */ 26#endif /* __ASM_ARCH_MSM_GPIO_H */