diff options
Diffstat (limited to 'arch/arm/mach-ks8695')
-rw-r--r-- | arch/arm/mach-ks8695/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/board-dsm320.c | 131 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/board-micrel.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/devices.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/gpio.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/include/mach/dma.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/include/mach/gpio.h | 49 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/include/mach/io.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/include/mach/memory.h | 5 |
10 files changed, 207 insertions, 91 deletions
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig index ce1cf8de2b4d..2754daabda55 100644 --- a/arch/arm/mach-ks8695/Kconfig +++ b/arch/arm/mach-ks8695/Kconfig | |||
@@ -8,6 +8,12 @@ config MACH_KS8695 | |||
8 | Say 'Y' here if you want your kernel to run on the original | 8 | Say 'Y' here if you want your kernel to run on the original |
9 | Kendin-Micrel KS8695 development board. | 9 | Kendin-Micrel KS8695 development board. |
10 | 10 | ||
11 | config MACH_DSM320 | ||
12 | bool "DSM-320 Wireless Media Player" | ||
13 | help | ||
14 | Say 'Y' here if you want your kernel to run on the D-Link | ||
15 | DSM-320 Wireless Media Player. | ||
16 | |||
11 | endmenu | 17 | endmenu |
12 | 18 | ||
13 | endif | 19 | endif |
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile index ade42b73afbb..f735d2cc0294 100644 --- a/arch/arm/mach-ks8695/Makefile +++ b/arch/arm/mach-ks8695/Makefile | |||
@@ -16,3 +16,4 @@ obj-$(CONFIG_LEDS) += leds.o | |||
16 | 16 | ||
17 | # Board-specific support | 17 | # Board-specific support |
18 | obj-$(CONFIG_MACH_KS8695) += board-micrel.o | 18 | obj-$(CONFIG_MACH_KS8695) += board-micrel.o |
19 | obj-$(CONFIG_MACH_DSM320) += board-dsm320.o | ||
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c new file mode 100644 index 000000000000..521ff0789f39 --- /dev/null +++ b/arch/arm/mach-ks8695/board-dsm320.c | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ks8695/board-dsm320.c | ||
3 | * | ||
4 | * DSM-320 D-Link Wireless Media Player, board support. | ||
5 | * | ||
6 | * Copyright 2008 Simtec Electronics | ||
7 | * Daniel Silverstone <dsilvers@simtec.co.uk> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <linux/mtd/mtd.h> | ||
21 | #include <linux/mtd/map.h> | ||
22 | #include <linux/mtd/physmap.h> | ||
23 | #include <linux/mtd/partitions.h> | ||
24 | |||
25 | #include <asm/mach-types.h> | ||
26 | |||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/irq.h> | ||
30 | |||
31 | #include <mach/devices.h> | ||
32 | #include <mach/gpio.h> | ||
33 | |||
34 | #include "generic.h" | ||
35 | |||
36 | #ifdef CONFIG_PCI | ||
37 | static int dsm320_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
38 | { | ||
39 | switch (slot) { | ||
40 | case 0: | ||
41 | /* PCI-AHB bridge? */ | ||
42 | return KS8695_IRQ_EXTERN0; | ||
43 | case 18: | ||
44 | /* Mini PCI slot */ | ||
45 | return KS8695_IRQ_EXTERN2; | ||
46 | case 20: | ||
47 | /* RealMAGIC chip */ | ||
48 | return KS8695_IRQ_EXTERN0; | ||
49 | } | ||
50 | BUG(); | ||
51 | } | ||
52 | |||
53 | static struct ks8695_pci_cfg __initdata dsm320_pci = { | ||
54 | .mode = KS8695_MODE_MINIPCI, | ||
55 | .map_irq = dsm320_pci_map_irq, | ||
56 | }; | ||
57 | |||
58 | static void __init dsm320_register_pci(void) | ||
59 | { | ||
60 | /* Initialise the GPIO lines for interrupt mode */ | ||
61 | /* RealMAGIC */ | ||
62 | ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW); | ||
63 | /* MiniPCI Slot */ | ||
64 | ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW); | ||
65 | |||
66 | ks8695_init_pci(&dsm320_pci); | ||
67 | } | ||
68 | |||
69 | #else | ||
70 | static inline void __init dsm320_register_pci(void) { } | ||
71 | #endif | ||
72 | |||
73 | static struct physmap_flash_data dsm320_nor_pdata = { | ||
74 | .width = 4, | ||
75 | .nr_parts = 0, | ||
76 | }; | ||
77 | |||
78 | static struct resource dsm320_nor_resource[] = { | ||
79 | [0] = { | ||
80 | .start = SZ_32M, /* We expect the bootloader to map | ||
81 | * the flash here. | ||
82 | */ | ||
83 | .end = SZ_32M + SZ_4M - 1, | ||
84 | .flags = IORESOURCE_MEM, | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | static struct platform_device dsm320_device_nor = { | ||
89 | .name = "physmap-flash", | ||
90 | .id = -1, | ||
91 | .num_resources = ARRAY_SIZE(dsm320_nor_resource), | ||
92 | .resource = dsm320_nor_resource, | ||
93 | .dev = { | ||
94 | .platform_data = &dsm320_nor_pdata, | ||
95 | }, | ||
96 | }; | ||
97 | |||
98 | void __init dsm320_register_nor(void) | ||
99 | { | ||
100 | int ret; | ||
101 | |||
102 | ret = platform_device_register(&dsm320_device_nor); | ||
103 | if (ret < 0) | ||
104 | printk(KERN_ERR "failed to register physmap-flash device\n"); | ||
105 | } | ||
106 | |||
107 | static void __init dsm320_init(void) | ||
108 | { | ||
109 | /* GPIO registration */ | ||
110 | ks8695_register_gpios(); | ||
111 | |||
112 | /* PCI registration */ | ||
113 | dsm320_register_pci(); | ||
114 | |||
115 | /* Network device */ | ||
116 | ks8695_add_device_lan(); /* eth0 = LAN */ | ||
117 | |||
118 | /* NOR devices */ | ||
119 | dsm320_register_nor(); | ||
120 | } | ||
121 | |||
122 | MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player") | ||
123 | /* Maintainer: Simtec Electronics. */ | ||
124 | .phys_io = KS8695_IO_PA, | ||
125 | .io_pg_offst = (KS8695_IO_VA >> 18) & 0xfffc, | ||
126 | .boot_params = KS8695_SDRAM_PA + 0x100, | ||
127 | .map_io = ks8695_map_io, | ||
128 | .init_irq = ks8695_init_irq, | ||
129 | .init_machine = dsm320_init, | ||
130 | .timer = &ks8695_timer, | ||
131 | MACHINE_END | ||
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c index 0468e93b7d3b..8ceaf5ac6e2c 100644 --- a/arch/arm/mach-ks8695/board-micrel.c +++ b/arch/arm/mach-ks8695/board-micrel.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
19 | #include <asm/mach/irq.h> | 19 | #include <asm/mach/irq.h> |
20 | 20 | ||
21 | #include <mach/gpio.h> | ||
21 | #include <mach/devices.h> | 22 | #include <mach/devices.h> |
22 | 23 | ||
23 | #include "generic.h" | 24 | #include "generic.h" |
@@ -39,6 +40,8 @@ static void __init micrel_init(void) | |||
39 | { | 40 | { |
40 | printk(KERN_INFO "Micrel KS8695 Development Board initializing\n"); | 41 | printk(KERN_INFO "Micrel KS8695 Development Board initializing\n"); |
41 | 42 | ||
43 | ks8695_register_gpios(); | ||
44 | |||
42 | #ifdef CONFIG_PCI | 45 | #ifdef CONFIG_PCI |
43 | ks8695_init_pci(&micrel_pci); | 46 | ks8695_init_pci(&micrel_pci); |
44 | #endif | 47 | #endif |
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c index 4bd251482c8f..36ab0fd3d9b6 100644 --- a/arch/arm/mach-ks8695/devices.c +++ b/arch/arm/mach-ks8695/devices.c | |||
@@ -25,19 +25,20 @@ | |||
25 | #include <mach/regs-wan.h> | 25 | #include <mach/regs-wan.h> |
26 | #include <mach/regs-lan.h> | 26 | #include <mach/regs-lan.h> |
27 | #include <mach/regs-hpna.h> | 27 | #include <mach/regs-hpna.h> |
28 | #include <mach/regs-switch.h> | ||
29 | #include <mach/regs-misc.h> | ||
28 | 30 | ||
29 | 31 | ||
30 | /* -------------------------------------------------------------------- | 32 | /* -------------------------------------------------------------------- |
31 | * Ethernet | 33 | * Ethernet |
32 | * -------------------------------------------------------------------- */ | 34 | * -------------------------------------------------------------------- */ |
33 | 35 | ||
34 | #if defined(CONFIG_ARM_KS8695_ETHER) || defined(CONFIG_ARM_KS8695_ETHER_MODULE) | ||
35 | static u64 eth_dmamask = 0xffffffffUL; | 36 | static u64 eth_dmamask = 0xffffffffUL; |
36 | 37 | ||
37 | static struct resource ks8695_wan_resources[] = { | 38 | static struct resource ks8695_wan_resources[] = { |
38 | [0] = { | 39 | [0] = { |
39 | .start = KS8695_WAN_VA, | 40 | .start = KS8695_WAN_PA, |
40 | .end = KS8695_WAN_VA + 0x00ff, | 41 | .end = KS8695_WAN_PA + 0x00ff, |
41 | .flags = IORESOURCE_MEM, | 42 | .flags = IORESOURCE_MEM, |
42 | }, | 43 | }, |
43 | [1] = { | 44 | [1] = { |
@@ -58,6 +59,12 @@ static struct resource ks8695_wan_resources[] = { | |||
58 | .end = KS8695_IRQ_WAN_LINK, | 59 | .end = KS8695_IRQ_WAN_LINK, |
59 | .flags = IORESOURCE_IRQ, | 60 | .flags = IORESOURCE_IRQ, |
60 | }, | 61 | }, |
62 | [4] = { | ||
63 | .name = "WAN PHY", | ||
64 | .start = KS8695_MISC_PA, | ||
65 | .end = KS8695_MISC_PA + 0x1f, | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | }, | ||
61 | }; | 68 | }; |
62 | 69 | ||
63 | static struct platform_device ks8695_wan_device = { | 70 | static struct platform_device ks8695_wan_device = { |
@@ -74,8 +81,8 @@ static struct platform_device ks8695_wan_device = { | |||
74 | 81 | ||
75 | static struct resource ks8695_lan_resources[] = { | 82 | static struct resource ks8695_lan_resources[] = { |
76 | [0] = { | 83 | [0] = { |
77 | .start = KS8695_LAN_VA, | 84 | .start = KS8695_LAN_PA, |
78 | .end = KS8695_LAN_VA + 0x00ff, | 85 | .end = KS8695_LAN_PA + 0x00ff, |
79 | .flags = IORESOURCE_MEM, | 86 | .flags = IORESOURCE_MEM, |
80 | }, | 87 | }, |
81 | [1] = { | 88 | [1] = { |
@@ -90,6 +97,12 @@ static struct resource ks8695_lan_resources[] = { | |||
90 | .end = KS8695_IRQ_LAN_TX_STATUS, | 97 | .end = KS8695_IRQ_LAN_TX_STATUS, |
91 | .flags = IORESOURCE_IRQ, | 98 | .flags = IORESOURCE_IRQ, |
92 | }, | 99 | }, |
100 | [3] = { | ||
101 | .name = "LAN SWITCH", | ||
102 | .start = KS8695_SWITCH_PA, | ||
103 | .end = KS8695_SWITCH_PA + 0x4f, | ||
104 | .flags = IORESOURCE_MEM, | ||
105 | }, | ||
93 | }; | 106 | }; |
94 | 107 | ||
95 | static struct platform_device ks8695_lan_device = { | 108 | static struct platform_device ks8695_lan_device = { |
@@ -106,8 +119,8 @@ static struct platform_device ks8695_lan_device = { | |||
106 | 119 | ||
107 | static struct resource ks8695_hpna_resources[] = { | 120 | static struct resource ks8695_hpna_resources[] = { |
108 | [0] = { | 121 | [0] = { |
109 | .start = KS8695_HPNA_VA, | 122 | .start = KS8695_HPNA_PA, |
110 | .end = KS8695_HPNA_VA + 0x00ff, | 123 | .end = KS8695_HPNA_PA + 0x00ff, |
111 | .flags = IORESOURCE_MEM, | 124 | .flags = IORESOURCE_MEM, |
112 | }, | 125 | }, |
113 | [1] = { | 126 | [1] = { |
@@ -149,18 +162,12 @@ void __init ks8696_add_device_hpna(void) | |||
149 | { | 162 | { |
150 | platform_device_register(&ks8695_hpna_device); | 163 | platform_device_register(&ks8695_hpna_device); |
151 | } | 164 | } |
152 | #else | ||
153 | void __init ks8695_add_device_wan(void) {} | ||
154 | void __init ks8695_add_device_lan(void) {} | ||
155 | void __init ks8696_add_device_hpna(void) {} | ||
156 | #endif | ||
157 | 165 | ||
158 | 166 | ||
159 | /* -------------------------------------------------------------------- | 167 | /* -------------------------------------------------------------------- |
160 | * Watchdog | 168 | * Watchdog |
161 | * -------------------------------------------------------------------- */ | 169 | * -------------------------------------------------------------------- */ |
162 | 170 | ||
163 | #if defined(CONFIG_KS8695_WATCHDOG) || defined(CONFIG_KS8695_WATCHDOG_MODULE) | ||
164 | static struct platform_device ks8695_wdt_device = { | 171 | static struct platform_device ks8695_wdt_device = { |
165 | .name = "ks8695_wdt", | 172 | .name = "ks8695_wdt", |
166 | .id = -1, | 173 | .id = -1, |
@@ -171,9 +178,6 @@ static void __init ks8695_add_device_watchdog(void) | |||
171 | { | 178 | { |
172 | platform_device_register(&ks8695_wdt_device); | 179 | platform_device_register(&ks8695_wdt_device); |
173 | } | 180 | } |
174 | #else | ||
175 | static void __init ks8695_add_device_watchdog(void) {} | ||
176 | #endif | ||
177 | 181 | ||
178 | 182 | ||
179 | /* -------------------------------------------------------------------- | 183 | /* -------------------------------------------------------------------- |
@@ -190,7 +194,7 @@ void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) | |||
190 | gpio_direction_output(cpu_led, 1); | 194 | gpio_direction_output(cpu_led, 1); |
191 | gpio_direction_output(timer_led, 1); | 195 | gpio_direction_output(timer_led, 1); |
192 | 196 | ||
193 | ks8695_leds_cpu = cpu_led; | 197 | ks8695_leds_cpu = cpu_led; |
194 | ks8695_leds_timer = timer_led; | 198 | ks8695_leds_timer = timer_led; |
195 | } | 199 | } |
196 | #else | 200 | #else |
diff --git a/arch/arm/mach-ks8695/gpio.c b/arch/arm/mach-ks8695/gpio.c index 9aecf0c4b8b1..55fbf7111a5b 100644 --- a/arch/arm/mach-ks8695/gpio.c +++ b/arch/arm/mach-ks8695/gpio.c | |||
@@ -2,6 +2,8 @@ | |||
2 | * arch/arm/mach-ks8695/gpio.c | 2 | * arch/arm/mach-ks8695/gpio.c |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Andrew Victor | 4 | * Copyright (C) 2006 Andrew Victor |
5 | * Updated to GPIOLIB, Copyright 2008 Simtec Electronics | ||
6 | * Daniel Silverstone <dsilvers@simtec.co.uk> | ||
5 | * | 7 | * |
6 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -35,7 +37,7 @@ | |||
35 | * Configure a GPIO line for either GPIO function, or its internal | 37 | * Configure a GPIO line for either GPIO function, or its internal |
36 | * function (Interrupt, Timer, etc). | 38 | * function (Interrupt, Timer, etc). |
37 | */ | 39 | */ |
38 | static void __init_or_module ks8695_gpio_mode(unsigned int pin, short gpio) | 40 | static void ks8695_gpio_mode(unsigned int pin, short gpio) |
39 | { | 41 | { |
40 | unsigned int enable[] = { IOPC_IOEINT0EN, IOPC_IOEINT1EN, IOPC_IOEINT2EN, IOPC_IOEINT3EN, IOPC_IOTIM0EN, IOPC_IOTIM1EN }; | 42 | unsigned int enable[] = { IOPC_IOEINT0EN, IOPC_IOEINT1EN, IOPC_IOEINT2EN, IOPC_IOEINT3EN, IOPC_IOTIM0EN, IOPC_IOTIM1EN }; |
41 | unsigned long x, flags; | 43 | unsigned long x, flags; |
@@ -61,7 +63,7 @@ static unsigned short gpio_irq[] = { KS8695_IRQ_EXTERN0, KS8695_IRQ_EXTERN1, KS8 | |||
61 | /* | 63 | /* |
62 | * Configure GPIO pin as external interrupt source. | 64 | * Configure GPIO pin as external interrupt source. |
63 | */ | 65 | */ |
64 | int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type) | 66 | int ks8695_gpio_interrupt(unsigned int pin, unsigned int type) |
65 | { | 67 | { |
66 | unsigned long x, flags; | 68 | unsigned long x, flags; |
67 | 69 | ||
@@ -94,7 +96,7 @@ EXPORT_SYMBOL(ks8695_gpio_interrupt); | |||
94 | /* | 96 | /* |
95 | * Configure the GPIO line as an input. | 97 | * Configure the GPIO line as an input. |
96 | */ | 98 | */ |
97 | int __init_or_module gpio_direction_input(unsigned int pin) | 99 | static int ks8695_gpio_direction_input(struct gpio_chip *gc, unsigned int pin) |
98 | { | 100 | { |
99 | unsigned long x, flags; | 101 | unsigned long x, flags; |
100 | 102 | ||
@@ -115,13 +117,13 @@ int __init_or_module gpio_direction_input(unsigned int pin) | |||
115 | 117 | ||
116 | return 0; | 118 | return 0; |
117 | } | 119 | } |
118 | EXPORT_SYMBOL(gpio_direction_input); | ||
119 | 120 | ||
120 | 121 | ||
121 | /* | 122 | /* |
122 | * Configure the GPIO line as an output, with default state. | 123 | * Configure the GPIO line as an output, with default state. |
123 | */ | 124 | */ |
124 | int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state) | 125 | static int ks8695_gpio_direction_output(struct gpio_chip *gc, |
126 | unsigned int pin, int state) | ||
125 | { | 127 | { |
126 | unsigned long x, flags; | 128 | unsigned long x, flags; |
127 | 129 | ||
@@ -150,13 +152,13 @@ int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state) | |||
150 | 152 | ||
151 | return 0; | 153 | return 0; |
152 | } | 154 | } |
153 | EXPORT_SYMBOL(gpio_direction_output); | ||
154 | 155 | ||
155 | 156 | ||
156 | /* | 157 | /* |
157 | * Set the state of an output GPIO line. | 158 | * Set the state of an output GPIO line. |
158 | */ | 159 | */ |
159 | void gpio_set_value(unsigned int pin, unsigned int state) | 160 | static void ks8695_gpio_set_value(struct gpio_chip *gc, |
161 | unsigned int pin, int state) | ||
160 | { | 162 | { |
161 | unsigned long x, flags; | 163 | unsigned long x, flags; |
162 | 164 | ||
@@ -175,13 +177,12 @@ void gpio_set_value(unsigned int pin, unsigned int state) | |||
175 | 177 | ||
176 | local_irq_restore(flags); | 178 | local_irq_restore(flags); |
177 | } | 179 | } |
178 | EXPORT_SYMBOL(gpio_set_value); | ||
179 | 180 | ||
180 | 181 | ||
181 | /* | 182 | /* |
182 | * Read the state of a GPIO line. | 183 | * Read the state of a GPIO line. |
183 | */ | 184 | */ |
184 | int gpio_get_value(unsigned int pin) | 185 | static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin) |
185 | { | 186 | { |
186 | unsigned long x; | 187 | unsigned long x; |
187 | 188 | ||
@@ -191,21 +192,18 @@ int gpio_get_value(unsigned int pin) | |||
191 | x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD); | 192 | x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD); |
192 | return (x & IOPD(pin)) != 0; | 193 | return (x & IOPD(pin)) != 0; |
193 | } | 194 | } |
194 | EXPORT_SYMBOL(gpio_get_value); | ||
195 | 195 | ||
196 | 196 | ||
197 | /* | 197 | /* |
198 | * Map GPIO line to IRQ number. | 198 | * Map GPIO line to IRQ number. |
199 | */ | 199 | */ |
200 | int gpio_to_irq(unsigned int pin) | 200 | static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin) |
201 | { | 201 | { |
202 | if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ | 202 | if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ |
203 | return -EINVAL; | 203 | return -EINVAL; |
204 | 204 | ||
205 | return gpio_irq[pin]; | 205 | return gpio_irq[pin]; |
206 | } | 206 | } |
207 | EXPORT_SYMBOL(gpio_to_irq); | ||
208 | |||
209 | 207 | ||
210 | /* | 208 | /* |
211 | * Map IRQ number to GPIO line. | 209 | * Map IRQ number to GPIO line. |
@@ -219,6 +217,26 @@ int irq_to_gpio(unsigned int irq) | |||
219 | } | 217 | } |
220 | EXPORT_SYMBOL(irq_to_gpio); | 218 | EXPORT_SYMBOL(irq_to_gpio); |
221 | 219 | ||
220 | /* GPIOLIB interface */ | ||
221 | |||
222 | static struct gpio_chip ks8695_gpio_chip = { | ||
223 | .label = "KS8695", | ||
224 | .direction_input = ks8695_gpio_direction_input, | ||
225 | .direction_output = ks8695_gpio_direction_output, | ||
226 | .get = ks8695_gpio_get_value, | ||
227 | .set = ks8695_gpio_set_value, | ||
228 | .to_irq = ks8695_gpio_to_irq, | ||
229 | .base = 0, | ||
230 | .ngpio = 16, | ||
231 | .can_sleep = 0, | ||
232 | }; | ||
233 | |||
234 | /* Register the GPIOs */ | ||
235 | void ks8695_register_gpios(void) | ||
236 | { | ||
237 | if (gpiochip_add(&ks8695_gpio_chip)) | ||
238 | printk(KERN_ERR "Unable to register core GPIOs\n"); | ||
239 | } | ||
222 | 240 | ||
223 | /* .... Debug interface ..................................................... */ | 241 | /* .... Debug interface ..................................................... */ |
224 | 242 | ||
diff --git a/arch/arm/mach-ks8695/include/mach/dma.h b/arch/arm/mach-ks8695/include/mach/dma.h deleted file mode 100644 index 561206280089..000000000000 --- a/arch/arm/mach-ks8695/include/mach/dma.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ks8695/include/mach/dma.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index d4af5c335f16..86312d476bc6 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h | |||
@@ -30,53 +30,28 @@ | |||
30 | #define KS8695_GPIO_14 14 | 30 | #define KS8695_GPIO_14 14 |
31 | #define KS8695_GPIO_15 15 | 31 | #define KS8695_GPIO_15 15 |
32 | 32 | ||
33 | |||
34 | /* | 33 | /* |
35 | * Configure GPIO pin as external interrupt source. | 34 | * Configure GPIO pin as external interrupt source. |
36 | */ | 35 | */ |
37 | int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type); | 36 | extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); |
38 | |||
39 | /* | ||
40 | * Configure the GPIO line as an input. | ||
41 | */ | ||
42 | int __init_or_module gpio_direction_input(unsigned int pin); | ||
43 | |||
44 | /* | ||
45 | * Configure the GPIO line as an output, with default state. | ||
46 | */ | ||
47 | int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state); | ||
48 | |||
49 | /* | ||
50 | * Set the state of an output GPIO line. | ||
51 | */ | ||
52 | void gpio_set_value(unsigned int pin, unsigned int state); | ||
53 | |||
54 | /* | ||
55 | * Read the state of a GPIO line. | ||
56 | */ | ||
57 | int gpio_get_value(unsigned int pin); | ||
58 | |||
59 | /* | ||
60 | * Map GPIO line to IRQ number. | ||
61 | */ | ||
62 | int gpio_to_irq(unsigned int pin); | ||
63 | 37 | ||
64 | /* | 38 | /* |
65 | * Map IRQ number to GPIO line. | 39 | * Map IRQ number to GPIO line. |
66 | */ | 40 | */ |
67 | int irq_to_gpio(unsigned int irq); | 41 | extern int irq_to_gpio(unsigned int irq); |
68 | |||
69 | 42 | ||
70 | #include <asm-generic/gpio.h> | 43 | #include <asm-generic/gpio.h> |
71 | 44 | ||
72 | static inline int gpio_request(unsigned int pin, const char *label) | 45 | /* If it turns out that we need to optimise GPIO access for the |
73 | { | 46 | * Micrel's GPIOs, then these can be changed to check their argument |
74 | return 0; | 47 | * directly as static inlines. However for now it's probably not |
75 | } | 48 | * worthwhile. |
49 | */ | ||
50 | #define gpio_get_value __gpio_get_value | ||
51 | #define gpio_set_value __gpio_set_value | ||
52 | #define gpio_to_irq __gpio_to_irq | ||
76 | 53 | ||
77 | static inline void gpio_free(unsigned int pin) | 54 | /* Register the GPIOs */ |
78 | { | 55 | extern void ks8695_register_gpios(void); |
79 | might_sleep(); | ||
80 | } | ||
81 | 56 | ||
82 | #endif | 57 | #endif |
diff --git a/arch/arm/mach-ks8695/include/mach/io.h b/arch/arm/mach-ks8695/include/mach/io.h index f364f24ffe1e..a7a63ac3ba4e 100644 --- a/arch/arm/mach-ks8695/include/mach/io.h +++ b/arch/arm/mach-ks8695/include/mach/io.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #define IO_SPACE_LIMIT 0xffffffff | 14 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 15 | ||
16 | #define __io(a) ((void __iomem *)(a)) | 16 | #define __io(a) __typesafe_io(a) |
17 | #define __mem_pci(a) (a) | 17 | #define __mem_pci(a) (a) |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h index 8fbc4c76c38b..6d5887cf5742 100644 --- a/arch/arm/mach-ks8695/include/mach/memory.h +++ b/arch/arm/mach-ks8695/include/mach/memory.h | |||
@@ -37,11 +37,6 @@ extern struct bus_type platform_bus_type; | |||
37 | (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) | 37 | (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) |
38 | #define __arch_page_to_dma(dev, x) __arch_virt_to_dma(dev, page_address(x)) | 38 | #define __arch_page_to_dma(dev, x) __arch_virt_to_dma(dev, page_address(x)) |
39 | 39 | ||
40 | #else | ||
41 | |||
42 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
43 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
44 | |||
45 | #endif | 40 | #endif |
46 | 41 | ||
47 | #endif | 42 | #endif |