aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2014-03-22 20:34:16 -0400
committerArnd Bergmann <arnd@arndb.de>2014-03-26 18:04:20 -0400
commite1a4018f939e9ff51712183c1fdc6775e5f181a1 (patch)
tree4ab2423ae742ac656bb18e400983e6a434690a19
parent9c9c6c55a887dfe4e68d48d0829e412ed4f14ca9 (diff)
IXP4xx: Fix Goramo Multilink GPIO conversion.
Commit 098e30f6558f8 "ARM: ixp4xx: stop broadcasting the custom GPIO API" changed the internal gpio code of ixp4xx to be accessible only from common.c, but unfortunately that broke the Goramo MultiLink code, which uses this API. arch/arm/mach-ixp4xx/goramo_mlr.c: In function 'set_scl': arch/arm/mach-ixp4xx/goramo_mlr.c:82: error: implicit declaration of function 'gpio_line_set' arch/arm/mach-ixp4xx/goramo_mlr.c: In function 'output_control': arch/arm/mach-ixp4xx/goramo_mlr.c:111: error: implicit declaration of function 'gpio_line_config' arch/arm/mach-ixp4xx/goramo_mlr.c:111: error: 'IXP4XX_GPIO_OUT' undeclared arch/arm/mach-ixp4xx/goramo_mlr.c: In function 'hss_dcd_irq': arch/arm/mach-ixp4xx/goramo_mlr.c:155: error: implicit declaration of function 'gpio_line_get' arch/arm/mach-ixp4xx/goramo_mlr.c: In function 'gmlr_init': arch/arm/mach-ixp4xx/goramo_mlr.c:416: error: 'IXP4XX_GPIO_OUT' undeclared arch/arm/mach-ixp4xx/goramo_mlr.c:421: error: 'IXP4XX_GPIO_IN' undeclared Signed-off-by: Krzysztof HaƂasa <khc@pm.waw.pl> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index e54ff491c105..80bd9d6d04de 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/delay.h> 6#include <linux/delay.h>
7#include <linux/gpio.h>
7#include <linux/hdlc.h> 8#include <linux/hdlc.h>
8#include <linux/i2c-gpio.h> 9#include <linux/i2c-gpio.h>
9#include <linux/io.h> 10#include <linux/io.h>
@@ -79,19 +80,19 @@ static u8 control_value;
79 80
80static void set_scl(u8 value) 81static void set_scl(u8 value)
81{ 82{
82 gpio_line_set(GPIO_SCL, !!value); 83 gpio_set_value(GPIO_SCL, !!value);
83 udelay(3); 84 udelay(3);
84} 85}
85 86
86static void set_sda(u8 value) 87static void set_sda(u8 value)
87{ 88{
88 gpio_line_set(GPIO_SDA, !!value); 89 gpio_set_value(GPIO_SDA, !!value);
89 udelay(3); 90 udelay(3);
90} 91}
91 92
92static void set_str(u8 value) 93static void set_str(u8 value)
93{ 94{
94 gpio_line_set(GPIO_STR, !!value); 95 gpio_set_value(GPIO_STR, !!value);
95 udelay(3); 96 udelay(3);
96} 97}
97 98
@@ -108,8 +109,8 @@ static void output_control(void)
108{ 109{
109 int i; 110 int i;
110 111
111 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 112 gpio_direction_output(GPIO_SCL, 1);
112 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 113 gpio_direction_output(GPIO_SDA, 1);
113 114
114 for (i = 0; i < 8; i++) { 115 for (i = 0; i < 8; i++) {
115 set_scl(0); 116 set_scl(0);
@@ -151,8 +152,8 @@ static int hss_set_clock(int port, unsigned int clock_type)
151 152
152static irqreturn_t hss_dcd_irq(int irq, void *pdev) 153static irqreturn_t hss_dcd_irq(int irq, void *pdev)
153{ 154{
154 int i, port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N)); 155 int port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N));
155 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 156 int i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
156 set_carrier_cb_tab[port](pdev, !i); 157 set_carrier_cb_tab[port](pdev, !i);
157 return IRQ_HANDLED; 158 return IRQ_HANDLED;
158} 159}
@@ -168,7 +169,7 @@ static int hss_open(int port, void *pdev,
168 else 169 else
169 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N); 170 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N);
170 171
171 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 172 i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
172 set_carrier_cb(pdev, !i); 173 set_carrier_cb(pdev, !i);
173 174
174 set_carrier_cb_tab[!!port] = set_carrier_cb; 175 set_carrier_cb_tab[!!port] = set_carrier_cb;
@@ -181,7 +182,7 @@ static int hss_open(int port, void *pdev,
181 182
182 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0); 183 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0);
183 output_control(); 184 output_control();
184 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0); 185 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0);
185 return 0; 186 return 0;
186} 187}
187 188
@@ -193,7 +194,7 @@ static void hss_close(int port, void *pdev)
193 194
194 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1); 195 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1);
195 output_control(); 196 output_control();
196 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1); 197 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1);
197} 198}
198 199
199 200
@@ -413,13 +414,21 @@ static void __init gmlr_init(void)
413 if (hw_bits & CFG_HW_HAS_EEPROM) 414 if (hw_bits & CFG_HW_HAS_EEPROM)
414 device_tab[devices++] = &device_i2c; /* max index 6 */ 415 device_tab[devices++] = &device_i2c; /* max index 6 */
415 416
416 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 417 gpio_request(GPIO_SCL, "SCL/clock");
417 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 418 gpio_request(GPIO_SDA, "SDA/data");
418 gpio_line_config(GPIO_STR, IXP4XX_GPIO_OUT); 419 gpio_request(GPIO_STR, "strobe");
419 gpio_line_config(GPIO_HSS0_RTS_N, IXP4XX_GPIO_OUT); 420 gpio_request(GPIO_HSS0_RTS_N, "HSS0 RTS");
420 gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT); 421 gpio_request(GPIO_HSS1_RTS_N, "HSS1 RTS");
421 gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN); 422 gpio_request(GPIO_HSS0_DCD_N, "HSS0 DCD");
422 gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN); 423 gpio_request(GPIO_HSS1_DCD_N, "HSS1 DCD");
424
425 gpio_direction_output(GPIO_SCL, 1);
426 gpio_direction_output(GPIO_SDA, 1);
427 gpio_direction_output(GPIO_STR, 0);
428 gpio_direction_output(GPIO_HSS0_RTS_N, 1);
429 gpio_direction_output(GPIO_HSS1_RTS_N, 1);
430 gpio_direction_input(GPIO_HSS0_DCD_N);
431 gpio_direction_input(GPIO_HSS1_DCD_N);
423 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH); 432 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH);
424 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH); 433 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH);
425 434