summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/magician.c
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2008-04-09 19:22:57 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 11:29:07 +0100
commit70e357f8426c54e1500ac4fdb6b1172df16d8b93 (patch)
tree37b8d927ed21561a5f103bba83188e7bf60a17c9 /arch/arm/mach-pxa/magician.c
parenta1635b8fe59de2c5223cda5ca8397b875c901904 (diff)
downloadlinux-3.10-70e357f8426c54e1500ac4fdb6b1172df16d8b93.tar.gz
linux-3.10-70e357f8426c54e1500ac4fdb6b1172df16d8b93.tar.bz2
linux-3.10-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/mach-pxa/magician.c')
-rw-r--r--arch/arm/mach-pxa/magician.c60
1 files changed, 59 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 0160cd8f6c6..3b7e8bac734 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,
};