diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2008-04-09 20:22:57 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:29:07 +0200 |
commit | 70e357f8426c54e1500ac4fdb6b1172df16d8b93 (patch) | |
tree | 37b8d927ed21561a5f103bba83188e7bf60a17c9 /arch/arm | |
parent | [ARM] 4947/1: htc-egpio, a driver for GPIO/IRQ expanders with fixed input/out... (diff) | |
download | linux-70e357f8426c54e1500ac4fdb6b1172df16d8b93.tar.xz linux-70e357f8426c54e1500ac4fdb6b1172df16d8b93.zip |
[ARM] 4948/1: magician: use htc-egpio to drive the GPIO/IRQ expander CPLD
needed for power management (audio, BT, charging, GSM, LCD, SD), GSM, flash and SD operation and audio routing.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/configs/magician_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/magician.c | 60 |
2 files changed, 60 insertions, 1 deletions
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig index 703d741f5a23..76960c71d890 100644 --- a/arch/arm/configs/magician_defconfig +++ b/arch/arm/configs/magician_defconfig @@ -712,6 +712,7 @@ CONFIG_SSB_POSSIBLE=y # Multifunction device drivers # # CONFIG_MFD_SM501 is not set +CONFIG_HTC_EGPIO=y # # Multimedia devices diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 0160cd8f6c65..3b7e8bac7344 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c @@ -18,6 +18,7 @@ #include <linux/platform_device.h> #include <linux/gpio_keys.h> #include <linux/input.h> +#include <linux/mfd/htc-egpio.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> @@ -84,6 +85,62 @@ static struct platform_device gpio_keys = { .id = -1, }; + +/* + * EGPIO (Xilinx CPLD) + * + * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input + */ + +static struct resource egpio_resources[] = { + [0] = { + .start = PXA_CS3_PHYS, + .end = PXA_CS3_PHYS + 0x20, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ), + .end = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct htc_egpio_chip egpio_chips[] = { + [0] = { + .reg_start = 0, + .gpio_base = MAGICIAN_EGPIO(0, 0), + .num_gpios = 24, + .direction = HTC_EGPIO_OUTPUT, + .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */ + }, + [1] = { + .reg_start = 4, + .gpio_base = MAGICIAN_EGPIO(4, 0), + .num_gpios = 24, + .direction = HTC_EGPIO_INPUT, + }, +}; + +static struct htc_egpio_platform_data egpio_info = { + .reg_width = 8, + .bus_width = 32, + .irq_base = IRQ_BOARD_START, + .num_irqs = 4, + .ack_register = 3, + .chip = egpio_chips, + .num_chips = ARRAY_SIZE(egpio_chips), +}; + +static struct platform_device egpio = { + .name = "htc-egpio", + .id = -1, + .resource = egpio_resources, + .num_resources = ARRAY_SIZE(egpio_resources), + .dev = { + .platform_data = &egpio_info, + }, +}; + /* * LCD - Toppoly TD028STEB1 */ @@ -182,8 +239,8 @@ static struct physmap_flash_data strataflash_data = { static struct platform_device strataflash = { .name = "physmap-flash", .id = -1, - .num_resources = 1, .resource = &strataflash_resource, + .num_resources = 1, .dev = { .platform_data = &strataflash_data, }, @@ -195,6 +252,7 @@ static struct platform_device strataflash = { static struct platform_device *devices[] __initdata = { &gpio_keys, + &egpio, &backlight, &strataflash, }; |