aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-02-20 14:13:30 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-02-20 14:13:30 -0500
commit5a84d159061d914c8dd4aa372ac6e9529c2be453 (patch)
tree9b08af78085334af44414adafe0096276f8fe0ff /include/asm-arm
parente80a0e6e7ccdf64575d4384cb4172860422f5b81 (diff)
parent7d477a04a619e90ee08724e8f2d8803c6bdfcef8 (diff)
Merge ARM fixes
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/apm.h64
-rw-r--r--include/asm-arm/arch-at91/gpio.h48
-rw-r--r--include/asm-arm/arch-imx/spi_imx.h72
-rw-r--r--include/asm-arm/arch-ixp23xx/ixdp2351.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h3
-rw-r--r--include/asm-arm/arch-omap/gpio.h66
-rw-r--r--include/asm-arm/arch-pxa/gpio.h72
-rw-r--r--include/asm-arm/arch-s3c2410/audio.h6
-rw-r--r--include/asm-arm/arch-s3c2410/gpio.h65
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h81
-rw-r--r--include/asm-arm/gpio.h7
-rw-r--r--include/asm-arm/hardware/gpio_keys.h17
-rw-r--r--include/asm-arm/io.h5
-rw-r--r--include/asm-arm/spinlock.h1
-rw-r--r--include/asm-arm/termios.h18
-rw-r--r--include/asm-arm/uaccess.h10
16 files changed, 435 insertions, 102 deletions
diff --git a/include/asm-arm/apm.h b/include/asm-arm/apm.h
deleted file mode 100644
index d09113b37e4a..000000000000
--- a/include/asm-arm/apm.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/* -*- linux-c -*-
2 *
3 * (C) 2003 zecke@handhelds.org
4 *
5 * GPL version 2
6 *
7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide
9 * apm status
10 *
11 *
12 */
13#ifndef ARM_ASM_SA1100_APM_H
14#define ARM_ASM_SA1100_APM_H
15
16#include <linux/apm_bios.h>
17
18/*
19 * This structure gets filled in by the machine specific 'get_power_status'
20 * implementation. Any fields which are not set default to a safe value.
21 */
22struct apm_power_info {
23 unsigned char ac_line_status;
24#define APM_AC_OFFLINE 0
25#define APM_AC_ONLINE 1
26#define APM_AC_BACKUP 2
27#define APM_AC_UNKNOWN 0xff
28
29 unsigned char battery_status;
30#define APM_BATTERY_STATUS_HIGH 0
31#define APM_BATTERY_STATUS_LOW 1
32#define APM_BATTERY_STATUS_CRITICAL 2
33#define APM_BATTERY_STATUS_CHARGING 3
34#define APM_BATTERY_STATUS_NOT_PRESENT 4
35#define APM_BATTERY_STATUS_UNKNOWN 0xff
36
37 unsigned char battery_flag;
38#define APM_BATTERY_FLAG_HIGH (1 << 0)
39#define APM_BATTERY_FLAG_LOW (1 << 1)
40#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
41#define APM_BATTERY_FLAG_CHARGING (1 << 3)
42#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
43#define APM_BATTERY_FLAG_UNKNOWN 0xff
44
45 int battery_life;
46 int time;
47 int units;
48#define APM_UNITS_MINS 0
49#define APM_UNITS_SECS 1
50#define APM_UNITS_UNKNOWN -1
51
52};
53
54/*
55 * This allows machines to provide their own "apm get power status" function.
56 */
57extern void (*apm_get_power_status)(struct apm_power_info *);
58
59/*
60 * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
61 */
62void apm_queue_event(apm_event_t event);
63
64#endif
diff --git a/include/asm-arm/arch-at91/gpio.h b/include/asm-arm/arch-at91/gpio.h
index 256f9b200ab2..98ad2114f43a 100644
--- a/include/asm-arm/arch-at91/gpio.h
+++ b/include/asm-arm/arch-at91/gpio.h
@@ -188,6 +188,7 @@
188 188
189#ifndef __ASSEMBLY__ 189#ifndef __ASSEMBLY__
190/* setup setup routines, called from board init or driver probe() */ 190/* setup setup routines, called from board init or driver probe() */
191extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup);
191extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); 192extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
192extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); 193extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
193extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); 194extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
@@ -202,7 +203,50 @@ extern int at91_get_gpio_value(unsigned pin);
202/* callable only from core power-management code */ 203/* callable only from core power-management code */
203extern void at91_gpio_suspend(void); 204extern void at91_gpio_suspend(void);
204extern void at91_gpio_resume(void); 205extern void at91_gpio_resume(void);
205#endif
206 206
207#endif 207/*-------------------------------------------------------------------------*/
208
209/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
210 * eventually be removed (along with this errno.h inclusion), and the
211 * gpio request/free calls should probably be implemented.
212 */
213
214#include <asm/errno.h>
215
216static inline int gpio_request(unsigned gpio, const char *label)
217{
218 return 0;
219}
220
221static inline void gpio_free(unsigned gpio)
222{
223}
224
225extern int gpio_direction_input(unsigned gpio);
226extern int gpio_direction_output(unsigned gpio);
208 227
228static inline int gpio_get_value(unsigned gpio)
229{
230 return at91_get_gpio_value(gpio);
231}
232
233static inline void gpio_set_value(unsigned gpio, int value)
234{
235 at91_set_gpio_value(gpio, value);
236}
237
238#include <asm-generic/gpio.h> /* cansleep wrappers */
239
240static inline int gpio_to_irq(unsigned gpio)
241{
242 return gpio;
243}
244
245static inline int irq_to_gpio(unsigned irq)
246{
247 return irq;
248}
249
250#endif /* __ASSEMBLY__ */
251
252#endif
diff --git a/include/asm-arm/arch-imx/spi_imx.h b/include/asm-arm/arch-imx/spi_imx.h
new file mode 100644
index 000000000000..2165449e976e
--- /dev/null
+++ b/include/asm-arm/arch-imx/spi_imx.h
@@ -0,0 +1,72 @@
1/*
2 * include/asm-arm/arch-imx/spi_imx.h
3 *
4 * Copyright (C) 2006 SWAPP
5 * Andrea Paterniani <a.paterniani@swapp-eng.it>
6 *
7 * Initial version inspired by:
8 * linux-2.6.17-rc3-mm1/include/asm-arm/arch-pxa/pxa2xx_spi.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#ifndef SPI_IMX_H_
26#define SPI_IMX_H_
27
28
29/*-------------------------------------------------------------------------*/
30/**
31 * struct spi_imx_master - device.platform_data for SPI controller devices.
32 * @num_chipselect: chipselects are used to distinguish individual
33 * SPI slaves, and are numbered from zero to num_chipselects - 1.
34 * each slave has a chipselect signal, but it's common that not
35 * every chipselect is connected to a slave.
36 * @enable_dma: if true enables DMA driven transfers.
37*/
38struct spi_imx_master {
39 u8 num_chipselect;
40 u8 enable_dma:1;
41};
42/*-------------------------------------------------------------------------*/
43
44
45/*-------------------------------------------------------------------------*/
46/**
47 * struct spi_imx_chip - spi_board_info.controller_data for SPI
48 * slave devices, copied to spi_device.controller_data.
49 * @enable_loopback : used for test purpouse to internally connect RX and TX
50 * sections.
51 * @enable_dma : enables dma transfer (provided that controller driver has
52 * dma enabled too).
53 * @ins_ss_pulse : enable /SS pulse insertion between SPI burst.
54 * @bclk_wait : number of bclk waits between each bits_per_word SPI burst.
55 * @cs_control : function pointer to board-specific function to assert/deassert
56 * I/O port to control HW generation of devices chip-select.
57*/
58struct spi_imx_chip {
59 u8 enable_loopback:1;
60 u8 enable_dma:1;
61 u8 ins_ss_pulse:1;
62 u16 bclk_wait:15;
63 void (*cs_control)(u32 control);
64};
65
66/* Chip-select state */
67#define SPI_CS_ASSERT (1 << 0)
68#define SPI_CS_DEASSERT (1 << 1)
69/*-------------------------------------------------------------------------*/
70
71
72#endif /* SPI_IMX_H_*/
diff --git a/include/asm-arm/arch-ixp23xx/ixdp2351.h b/include/asm-arm/arch-ixp23xx/ixdp2351.h
index 4a24f8f15655..d5e8a43d7bbd 100644
--- a/include/asm-arm/arch-ixp23xx/ixdp2351.h
+++ b/include/asm-arm/arch-ixp23xx/ixdp2351.h
@@ -46,7 +46,7 @@
46#define IXDP2351_VIRT_NVRAM_BASE IXDP2351_BB_AREA_BASE(0x0) 46#define IXDP2351_VIRT_NVRAM_BASE IXDP2351_BB_AREA_BASE(0x0)
47#define IXDP2351_NVRAM_SIZE (0x20000) 47#define IXDP2351_NVRAM_SIZE (0x20000)
48 48
49#define IXDP2351_VIRT_MB_IXF1104_BASE IXDP3251_BB_AREA_BASE(0x00020000) 49#define IXDP2351_VIRT_MB_IXF1104_BASE IXDP2351_BB_AREA_BASE(0x00020000)
50#define IXDP2351_VIRT_ADD_UART_BASE IXDP2351_BB_AREA_BASE(0x000240C0) 50#define IXDP2351_VIRT_ADD_UART_BASE IXDP2351_BB_AREA_BASE(0x000240C0)
51#define IXDP2351_VIRT_FIC_BASE IXDP2351_BB_AREA_BASE(0x00200000) 51#define IXDP2351_VIRT_FIC_BASE IXDP2351_BB_AREA_BASE(0x00200000)
52#define IXDP2351_VIRT_DB0_BASE IXDP2351_BB_AREA_BASE(0x00400000) 52#define IXDP2351_VIRT_DB0_BASE IXDP2351_BB_AREA_BASE(0x00400000)
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index 0d517267fb63..b7b5414d9320 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -238,9 +238,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count)
238#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l)) 238#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l))
239#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l)) 239#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l))
240 240
241#define eth_io_copy_and_sum(s,c,l,b) \
242 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
243
244static inline int 241static inline int
245check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature, 242check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature,
246 int length) 243 int length)
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index f486b72070ea..3762a6ae6a7f 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -76,4 +76,70 @@ extern void omap_set_gpio_direction(int gpio, int is_input);
76extern void omap_set_gpio_dataout(int gpio, int enable); 76extern void omap_set_gpio_dataout(int gpio, int enable);
77extern int omap_get_gpio_datain(int gpio); 77extern int omap_get_gpio_datain(int gpio);
78 78
79/*-------------------------------------------------------------------------*/
80
81/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should
82 * eventually be removed (along with this errno.h inclusion), and maybe
83 * gpios should put MPUIOs last too.
84 */
85
86#include <asm/errno.h>
87
88static inline int gpio_request(unsigned gpio, const char *label)
89{
90 return omap_request_gpio(gpio);
91}
92
93static inline void gpio_free(unsigned gpio)
94{
95 omap_free_gpio(gpio);
96}
97
98static inline int __gpio_set_direction(unsigned gpio, int is_input)
99{
100 if (cpu_class_is_omap2()) {
101 if (gpio > OMAP_MAX_GPIO_LINES)
102 return -EINVAL;
103 } else {
104 if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
105 return -EINVAL;
106 }
107 omap_set_gpio_direction(gpio, is_input);
108 return 0;
109}
110
111static inline int gpio_direction_input(unsigned gpio)
112{
113 return __gpio_set_direction(gpio, 1);
114}
115
116static inline int gpio_direction_output(unsigned gpio)
117{
118 return __gpio_set_direction(gpio, 0);
119}
120
121static inline int gpio_get_value(unsigned gpio)
122{
123 return omap_get_gpio_datain(gpio);
124}
125
126static inline void gpio_set_value(unsigned gpio, int value)
127{
128 omap_set_gpio_dataout(gpio, value);
129}
130
131#include <asm-generic/gpio.h> /* cansleep wrappers */
132
133static inline int gpio_to_irq(unsigned gpio)
134{
135 return OMAP_GPIO_IRQ(gpio);
136}
137
138static inline int irq_to_gpio(unsigned irq)
139{
140 if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
141 return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
142 return irq - IH_GPIO_BASE;
143}
144
79#endif 145#endif
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h
new file mode 100644
index 000000000000..e67c23821017
--- /dev/null
+++ b/include/asm-arm/arch-pxa/gpio.h
@@ -0,0 +1,72 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * PXA GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_PXA_GPIO_H
25#define __ASM_ARCH_PXA_GPIO_H
26
27#include <asm/arch/pxa-regs.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 if (gpio > PXA_LAST_GPIO)
46 return -EINVAL;
47 pxa_gpio_mode(gpio | GPIO_IN);
48}
49
50static inline int gpio_direction_output(unsigned gpio)
51{
52 if (gpio > PXA_LAST_GPIO)
53 return -EINVAL;
54 pxa_gpio_mode(gpio | GPIO_OUT);
55}
56
57/* REVISIT these macros are correct, but suffer code explosion
58 * for non-constant parameters. Provide out-line versions too.
59 */
60#define gpio_get_value(gpio) \
61 (GPLR(gpio) & GPIO_bit(gpio))
62
63#define gpio_set_value(gpio,value) \
64 ((value) ? (GPSR(gpio) = GPIO_bit(gpio)):(GPCR(gpio) = GPIO_bit(gpio)))
65
66#include <asm-generic/gpio.h> /* cansleep wrappers */
67
68#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
69#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)
70
71
72#endif
diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h
index 65e0acffa1ad..0a6977fb5770 100644
--- a/include/asm-arm/arch-s3c2410/audio.h
+++ b/include/asm-arm/arch-s3c2410/audio.h
@@ -31,9 +31,9 @@ struct s3c24xx_iis_ops {
31 int (*suspend)(struct s3c24xx_iis_ops *me); 31 int (*suspend)(struct s3c24xx_iis_ops *me);
32 int (*resume)(struct s3c24xx_iis_ops *me); 32 int (*resume)(struct s3c24xx_iis_ops *me);
33 33
34 int (*open)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); 34 int (*open)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm);
35 int (*close)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); 35 int (*close)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm);
36 int (*prepare)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm, snd_pcm_runtime_t *rt); 36 int (*prepare)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm, struct snd_pcm_runtime *rt);
37}; 37};
38 38
39struct s3c24xx_platdata_iis { 39struct s3c24xx_platdata_iis {
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h
new file mode 100644
index 000000000000..67b8b9ab22e9
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/gpio.h
@@ -0,0 +1,65 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * S3C2400 GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_PXA_GPIO_H
25#define __ASM_ARCH_PXA_GPIO_H
26
27#include <asm/arch/pxa-regs.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_INPUT);
46 return 0;
47}
48
49static inline int gpio_direction_output(unsigned gpio)
50{
51 s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
52 return 0;
53}
54
55#define gpio_get_value(gpio) s3c2410_gpio_getpin(gpio)
56#define gpio_set_value(gpio,value) s3c2410_gpio_setpin(gpio, value)
57
58#include <asm-generic/gpio.h> /* cansleep wrappers */
59
60/* FIXME or maybe s3c2400_gpio_getirq() ... */
61#define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio)
62
63/* FIXME implement irq_to_gpio() */
64
65#endif
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
new file mode 100644
index 000000000000..a331fe3f6e48
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -0,0 +1,81 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * SA1100 GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_SA1100_GPIO_H
25#define __ASM_ARCH_SA1100_GPIO_H
26
27#include <asm/arch/SA-1100.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 if (gpio > GPIO_MAX)
46 return -EINVAL;
47 GPDR = (GPDR_In << gpio) 0
48}
49
50static inline int gpio_direction_output(unsigned gpio)
51{
52 if (gpio > GPIO_MAX)
53 return -EINVAL;
54 GPDR = (GPDR_Out << gpio) 0
55}
56
57#define gpio_get_value(gpio) \
58 (GPLR & GPIO_GPIO(gpio))
59
60#define gpio_set_value(gpio,value) \
61 ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio)))
62
63#include <asm-generic/gpio.h> /* cansleep wrappers */
64
65static inline unsigned gpio_to_irq(unsigned gpio)
66{
67 if (gpio < 11)
68 return IRQ_GPIO0 + gpio;
69 else
70 return IRQ_GPIO11 - 11 + gpio;
71}
72
73static inline unsigned irq_to_gpio(unsigned irq)
74{
75 if (irq < IRQ_GPIO11_27)
76 return irq - IRQ_GPIO0;
77 else
78 return irq - IRQ_GPIO11 + 11;
79}
80
81#endif
diff --git a/include/asm-arm/gpio.h b/include/asm-arm/gpio.h
new file mode 100644
index 000000000000..fff4f800ee42
--- /dev/null
+++ b/include/asm-arm/gpio.h
@@ -0,0 +1,7 @@
1#ifndef _ARCH_ARM_GPIO_H
2#define _ARCH_ARM_GPIO_H
3
4/* not all ARM platforms necessarily support this API ... */
5#include <asm/arch/gpio.h>
6
7#endif /* _ARCH_ARM_GPIO_H */
diff --git a/include/asm-arm/hardware/gpio_keys.h b/include/asm-arm/hardware/gpio_keys.h
new file mode 100644
index 000000000000..2b217c7b9312
--- /dev/null
+++ b/include/asm-arm/hardware/gpio_keys.h
@@ -0,0 +1,17 @@
1#ifndef _GPIO_KEYS_H
2#define _GPIO_KEYS_H
3
4struct gpio_keys_button {
5 /* Configuration parameters */
6 int keycode;
7 int gpio;
8 int active_low;
9 char *desc;
10};
11
12struct gpio_keys_platform_data {
13 struct gpio_keys_button *buttons;
14 int nbuttons;
15};
16
17#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 288f76b166d0..5f60b4220906 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -182,9 +182,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
182#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) 182#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
183#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) 183#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
184 184
185#define eth_io_copy_and_sum(s,c,l,b) \
186 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
187
188#elif !defined(readb) 185#elif !defined(readb)
189 186
190#define readb(c) (__readwrite_bug("readb"),0) 187#define readb(c) (__readwrite_bug("readb"),0)
@@ -194,8 +191,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
194#define writew(v,c) __readwrite_bug("writew") 191#define writew(v,c) __readwrite_bug("writew")
195#define writel(v,c) __readwrite_bug("writel") 192#define writel(v,c) __readwrite_bug("writel")
196 193
197#define eth_io_copy_and_sum(s,c,l,b) __readwrite_bug("eth_io_copy_and_sum")
198
199#define check_signature(io,sig,len) (0) 194#define check_signature(io,sig,len) (0)
200 195
201#endif /* __mem_pci */ 196#endif /* __mem_pci */
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 861092fbaa53..800ba5254daf 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -85,7 +85,6 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
85 * Write locks are easy - we just set bit 31. When unlocking, we can 85 * Write locks are easy - we just set bit 31. When unlocking, we can
86 * just write zero since the lock is exclusively held. 86 * just write zero since the lock is exclusively held.
87 */ 87 */
88#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0)
89 88
90static inline void __raw_write_lock(raw_rwlock_t *rw) 89static inline void __raw_write_lock(raw_rwlock_t *rw)
91{ 90{
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
index 7b8f5e8ae063..329c324c4040 100644
--- a/include/asm-arm/termios.h
+++ b/include/asm-arm/termios.h
@@ -49,24 +49,6 @@ struct termio {
49 49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51 51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__ 52#ifdef __KERNEL__
71 53
72/* 54/*
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index 5f420a0149f1..4c1a3fa9f259 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -76,10 +76,10 @@ static inline void set_fs(mm_segment_t fs)
76 76
77/* We use 33-bit arithmetic here... */ 77/* We use 33-bit arithmetic here... */
78#define __range_ok(addr,size) ({ \ 78#define __range_ok(addr,size) ({ \
79 unsigned long flag, sum; \ 79 unsigned long flag, roksum; \
80 __chk_user_ptr(addr); \ 80 __chk_user_ptr(addr); \
81 __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \ 81 __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
82 : "=&r" (flag), "=&r" (sum) \ 82 : "=&r" (flag), "=&r" (roksum) \
83 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \ 83 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
84 : "cc"); \ 84 : "cc"); \
85 flag; }) 85 flag; })
@@ -109,7 +109,7 @@ extern int __get_user_4(void *);
109 109
110#define get_user(x,p) \ 110#define get_user(x,p) \
111 ({ \ 111 ({ \
112 const register typeof(*(p)) __user *__p asm("r0") = (p);\ 112 register const typeof(*(p)) __user *__p asm("r0") = (p);\
113 register unsigned long __r2 asm("r2"); \ 113 register unsigned long __r2 asm("r2"); \
114 register int __e asm("r0"); \ 114 register int __e asm("r0"); \
115 switch (sizeof(*(__p))) { \ 115 switch (sizeof(*(__p))) { \
@@ -143,8 +143,8 @@ extern int __put_user_8(void *, unsigned long long);
143 143
144#define put_user(x,p) \ 144#define put_user(x,p) \
145 ({ \ 145 ({ \
146 const register typeof(*(p)) __r2 asm("r2") = (x); \ 146 register const typeof(*(p)) __r2 asm("r2") = (x); \
147 const register typeof(*(p)) __user *__p asm("r0") = (p);\ 147 register const typeof(*(p)) __user *__p asm("r0") = (p);\
148 register int __e asm("r0"); \ 148 register int __e asm("r0"); \
149 switch (sizeof(*(__p))) { \ 149 switch (sizeof(*(__p))) { \
150 case 1: \ 150 case 1: \