diff options
author | Dmitry Artamonow <mad_soft@inbox.ru> | 2009-11-27 06:00:00 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-06 11:52:55 -0500 |
commit | 2eec62d7dbaa8ed05f318d88f938a86fcf274b34 (patch) | |
tree | c3581ee62fabe4104c379d647495fc2b87c22f63 /arch/arm/mach-sa1100 | |
parent | cf5a87d80a70958b0622042b0b447f61aca1caf8 (diff) |
ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driver
It will be used for future conversion of assign_h3600_egpio calls to
gpiolib.
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100')
-rw-r--r-- | arch/arm/mach-sa1100/h3600.c | 45 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/include/mach/h3600_gpio.h | 24 |
2 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 1297c11c030a..429fdb051a35 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c | |||
@@ -25,10 +25,12 @@ | |||
25 | #include <linux/tty.h> | 25 | #include <linux/tty.h> |
26 | #include <linux/pm.h> | 26 | #include <linux/pm.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/mfd/htc-egpio.h> | ||
28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
30 | #include <linux/serial_core.h> | 31 | #include <linux/serial_core.h> |
31 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/platform_device.h> | ||
32 | 34 | ||
33 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
34 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
@@ -184,11 +186,54 @@ static struct sa1100_port_fns h3xxx_port_fns __initdata = { | |||
184 | .set_wake = h3xxx_uart_set_wake, | 186 | .set_wake = h3xxx_uart_set_wake, |
185 | }; | 187 | }; |
186 | 188 | ||
189 | /* | ||
190 | * EGPIO | ||
191 | */ | ||
192 | |||
193 | static struct resource egpio_resources[] = { | ||
194 | [0] = { | ||
195 | .start = H3600_EGPIO_PHYS, | ||
196 | .end = H3600_EGPIO_PHYS + 0x4 - 1, | ||
197 | .flags = IORESOURCE_MEM, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | static struct htc_egpio_chip egpio_chips[] = { | ||
202 | [0] = { | ||
203 | .reg_start = 0, | ||
204 | .gpio_base = H3XXX_EGPIO_BASE, | ||
205 | .num_gpios = 16, | ||
206 | .direction = HTC_EGPIO_OUTPUT, | ||
207 | .initial_values = 0x0080, /* H3XXX_EGPIO_RS232_ON */ | ||
208 | }, | ||
209 | }; | ||
210 | |||
211 | static struct htc_egpio_platform_data egpio_info = { | ||
212 | .reg_width = 16, | ||
213 | .bus_width = 16, | ||
214 | .chip = egpio_chips, | ||
215 | .num_chips = ARRAY_SIZE(egpio_chips), | ||
216 | }; | ||
217 | |||
218 | static struct platform_device h3xxx_egpio = { | ||
219 | .name = "htc-egpio", | ||
220 | .id = -1, | ||
221 | .resource = egpio_resources, | ||
222 | .num_resources = ARRAY_SIZE(egpio_resources), | ||
223 | .dev = { | ||
224 | .platform_data = &egpio_info, | ||
225 | }, | ||
226 | }; | ||
227 | |||
228 | static struct platform_device *h3xxx_devices[] = { | ||
229 | &h3xxx_egpio, | ||
230 | }; | ||
187 | 231 | ||
188 | static void __init h3xxx_mach_init(void) | 232 | static void __init h3xxx_mach_init(void) |
189 | { | 233 | { |
190 | sa1100_register_uart_fns(&h3xxx_port_fns); | 234 | sa1100_register_uart_fns(&h3xxx_port_fns); |
191 | sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); | 235 | sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); |
236 | platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices)); | ||
192 | } | 237 | } |
193 | 238 | ||
194 | static struct map_desc h3600_io_desc[] __initdata = { | 239 | static struct map_desc h3600_io_desc[] __initdata = { |
diff --git a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h b/arch/arm/mach-sa1100/include/mach/h3600_gpio.h index 18de674af560..ce80f1ae0c1a 100644 --- a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h +++ b/arch/arm/mach-sa1100/include/mach/h3600_gpio.h | |||
@@ -97,4 +97,28 @@ | |||
97 | #define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */ | 97 | #define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */ |
98 | 98 | ||
99 | 99 | ||
100 | /* gpiolib versions of EGPIOs */ | ||
101 | |||
102 | /* H3100 / 3600 EGPIO pins */ | ||
103 | #define H3XXX_EGPIO_BASE (GPIO_MAX + 1) | ||
104 | |||
105 | #define H3XXX_EGPIO_VPP_ON (H3XXX_EGPIO_BASE + 0) | ||
106 | #define H3XXX_EGPIO_CARD_RESET (H3XXX_EGPIO_BASE + 1) /* reset the attached pcmcia/compactflash card. active high. */ | ||
107 | #define H3XXX_EGPIO_OPT_RESET (H3XXX_EGPIO_BASE + 2) /* reset the attached option pack. active high. */ | ||
108 | #define H3XXX_EGPIO_CODEC_NRESET (H3XXX_EGPIO_BASE + 3) /* reset the onboard UDA1341. active low. */ | ||
109 | #define H3XXX_EGPIO_OPT_NVRAM_ON (H3XXX_EGPIO_BASE + 4) /* apply power to optionpack nvram, active high. */ | ||
110 | #define H3XXX_EGPIO_OPT_ON (H3XXX_EGPIO_BASE + 5) /* full power to option pack. active high. */ | ||
111 | #define H3XXX_EGPIO_LCD_ON (H3XXX_EGPIO_BASE + 6) /* enable 3.3V to LCD. active high. */ | ||
112 | #define H3XXX_EGPIO_RS232_ON (H3XXX_EGPIO_BASE + 7) /* UART3 transceiver force on. Active high. */ | ||
113 | |||
114 | /* H3600 only EGPIO pins */ | ||
115 | #define H3600_EGPIO_LCD_PCI (H3XXX_EGPIO_BASE + 8) /* LCD control IC enable. active high. */ | ||
116 | #define H3600_EGPIO_IR_ON (H3XXX_EGPIO_BASE + 9) /* apply power to IR module. active high. */ | ||
117 | #define H3600_EGPIO_AUD_AMP_ON (H3XXX_EGPIO_BASE + 10) /* apply power to audio power amp. active high. */ | ||
118 | #define H3600_EGPIO_AUD_PWR_ON (H3XXX_EGPIO_BASE + 11) /* apply power to reset of audio circuit. active high. */ | ||
119 | #define H3600_EGPIO_QMUTE (H3XXX_EGPIO_BASE + 12) /* mute control for onboard UDA1341. active high. */ | ||
120 | #define H3600_EGPIO_IR_FSEL (H3XXX_EGPIO_BASE + 13) /* IR speed select: 1->fast, 0->slow */ | ||
121 | #define H3600_EGPIO_LCD_5V_ON (H3XXX_EGPIO_BASE + 14) /* enable 5V to LCD. active high. */ | ||
122 | #define H3600_EGPIO_LVDD_ON (H3XXX_EGPIO_BASE + 15) /* enable 9V and -6.5V to LCD. */ | ||
123 | |||
100 | #endif /* _INCLUDE_H3600_GPIO_H_ */ | 124 | #endif /* _INCLUDE_H3600_GPIO_H_ */ |