ixp4xx: add v3.18 support
[openwrt/svn-archive/archive.git] / target / linux / ixp4xx / patches-3.18 / 030-gpio_line_config.patch
1 --- a/arch/arm/mach-ixp4xx/common.c
2 +++ b/arch/arm/mach-ixp4xx/common.c
3 @@ -84,22 +84,7 @@ void __init ixp4xx_map_io(void)
4 /*
5 * GPIO-functions
6 */
7 -/*
8 - * The following converted to the real HW bits the gpio_line_config
9 - */
10 -/* GPIO pin types */
11 -#define IXP4XX_GPIO_OUT 0x1
12 -#define IXP4XX_GPIO_IN 0x2
13 -
14 -/* GPIO signal types */
15 -#define IXP4XX_GPIO_LOW 0
16 -#define IXP4XX_GPIO_HIGH 1
17 -
18 -/* GPIO Clocks */
19 -#define IXP4XX_GPIO_CLK_0 14
20 -#define IXP4XX_GPIO_CLK_1 15
21 -
22 -static void gpio_line_config(u8 line, u32 direction)
23 +void gpio_line_config(u8 line, u32 direction)
24 {
25 if (direction == IXP4XX_GPIO_IN)
26 *IXP4XX_GPIO_GPOER |= (1 << line);
27 @@ -107,12 +92,12 @@ static void gpio_line_config(u8 line, u3
28 *IXP4XX_GPIO_GPOER &= ~(1 << line);
29 }
30
31 -static void gpio_line_get(u8 line, int *value)
32 +void gpio_line_get(u8 line, int *value)
33 {
34 *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1;
35 }
36
37 -static void gpio_line_set(u8 line, int value)
38 +void gpio_line_set(u8 line, int value)
39 {
40 if (value == IXP4XX_GPIO_HIGH)
41 *IXP4XX_GPIO_GPOUTR |= (1 << line);
42 --- a/arch/arm/mach-ixp4xx/include/mach/platform.h
43 +++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
44 @@ -131,5 +131,21 @@ struct pci_sys_data;
45 extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
46 extern struct pci_ops ixp4xx_ops;
47
48 +/* GPIO pin types */
49 +#define IXP4XX_GPIO_OUT 0x1
50 +#define IXP4XX_GPIO_IN 0x2
51 +
52 +/* GPIO signal types */
53 +#define IXP4XX_GPIO_LOW 0
54 +#define IXP4XX_GPIO_HIGH 1
55 +
56 +/* GPIO Clocks */
57 +#define IXP4XX_GPIO_CLK_0 14
58 +#define IXP4XX_GPIO_CLK_1 15
59 +
60 +void gpio_line_config(u8 line, u32 direction);
61 +void gpio_line_get(u8 line, int *value);
62 +void gpio_line_set(u8 line, int value);
63 +
64 #endif // __ASSEMBLY__
65