aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ks8695/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ks8695/gpio.c')
-rw-r--r--arch/arm/mach-ks8695/gpio.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/arm/mach-ks8695/gpio.c b/arch/arm/mach-ks8695/gpio.c
index 3624e65cd89b..9aecf0c4b8b1 100644
--- a/arch/arm/mach-ks8695/gpio.c
+++ b/arch/arm/mach-ks8695/gpio.c
@@ -23,8 +23,8 @@
23#include <linux/debugfs.h> 23#include <linux/debugfs.h>
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/io.h>
26 27
27#include <asm/io.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30 30
@@ -72,7 +72,7 @@ int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type)
72 72
73 /* set pin as input */ 73 /* set pin as input */
74 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM); 74 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
75 x &= ~IOPM_(pin); 75 x &= ~IOPM(pin);
76 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM); 76 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
77 77
78 local_irq_restore(flags); 78 local_irq_restore(flags);
@@ -108,7 +108,7 @@ int __init_or_module gpio_direction_input(unsigned int pin)
108 108
109 /* set pin as input */ 109 /* set pin as input */
110 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM); 110 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
111 x &= ~IOPM_(pin); 111 x &= ~IOPM(pin);
112 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM); 112 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
113 113
114 local_irq_restore(flags); 114 local_irq_restore(flags);
@@ -136,14 +136,14 @@ int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state)
136 /* set line state */ 136 /* set line state */
137 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD); 137 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
138 if (state) 138 if (state)
139 x |= (1 << pin); 139 x |= IOPD(pin);
140 else 140 else
141 x &= ~(1 << pin); 141 x &= ~IOPD(pin);
142 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD); 142 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
143 143
144 /* set pin as output */ 144 /* set pin as output */
145 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM); 145 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
146 x |= IOPM_(pin); 146 x |= IOPM(pin);
147 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM); 147 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
148 148
149 local_irq_restore(flags); 149 local_irq_restore(flags);
@@ -168,9 +168,9 @@ void gpio_set_value(unsigned int pin, unsigned int state)
168 /* set output line state */ 168 /* set output line state */
169 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD); 169 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
170 if (state) 170 if (state)
171 x |= (1 << pin); 171 x |= IOPD(pin);
172 else 172 else
173 x &= ~(1 << pin); 173 x &= ~IOPD(pin);
174 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD); 174 __raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
175 175
176 local_irq_restore(flags); 176 local_irq_restore(flags);
@@ -189,7 +189,7 @@ int gpio_get_value(unsigned int pin)
189 return -EINVAL; 189 return -EINVAL;
190 190
191 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD); 191 x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
192 return (x & (1 << pin)) != 0; 192 return (x & IOPD(pin)) != 0;
193} 193}
194EXPORT_SYMBOL(gpio_get_value); 194EXPORT_SYMBOL(gpio_get_value);
195 195
@@ -240,7 +240,7 @@ static int ks8695_gpio_show(struct seq_file *s, void *unused)
240 for (i = KS8695_GPIO_0; i <= KS8695_GPIO_15 ; i++) { 240 for (i = KS8695_GPIO_0; i <= KS8695_GPIO_15 ; i++) {
241 seq_printf(s, "%i:\t", i); 241 seq_printf(s, "%i:\t", i);
242 242
243 seq_printf(s, "%s\t", (mode & IOPM_(i)) ? "Output" : "Input"); 243 seq_printf(s, "%s\t", (mode & IOPM(i)) ? "Output" : "Input");
244 244
245 if (i <= KS8695_GPIO_3) { 245 if (i <= KS8695_GPIO_3) {
246 if (ctrl & enable[i]) { 246 if (ctrl & enable[i]) {
@@ -273,7 +273,7 @@ static int ks8695_gpio_show(struct seq_file *s, void *unused)
273 273
274 seq_printf(s, "\t"); 274 seq_printf(s, "\t");
275 275
276 seq_printf(s, "%i\n", (data & IOPD_(i)) ? 1 : 0); 276 seq_printf(s, "%i\n", (data & IOPD(i)) ? 1 : 0);
277 } 277 }
278 return 0; 278 return 0;
279} 279}