aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2008-04-09 14:22:57 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:07 -0400
commit70e357f8426c54e1500ac4fdb6b1172df16d8b93 (patch)
tree37b8d927ed21561a5f103bba83188e7bf60a17c9 /arch/arm/mach-pxa
parenta1635b8fe59de2c5223cda5ca8397b875c901904 (diff)
[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')
-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 0160cd8f6c65..3b7e8bac7344 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/gpio_keys.h> 19#include <linux/gpio_keys.h>
20#include <linux/input.h> 20#include <linux/input.h>
21#include <linux/mfd/htc-egpio.h>
21#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
22#include <linux/mtd/map.h> 23#include <linux/mtd/map.h>
23#include <linux/mtd/physmap.h> 24#include <linux/mtd/physmap.h>
@@ -84,6 +85,62 @@ static struct platform_device gpio_keys = {
84 .id = -1, 85 .id = -1,
85}; 86};
86 87
88
89/*
90 * EGPIO (Xilinx CPLD)
91 *
92 * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input
93 */
94
95static struct resource egpio_resources[] = {
96 [0] = {
97 .start = PXA_CS3_PHYS,
98 .end = PXA_CS3_PHYS + 0x20,
99 .flags = IORESOURCE_MEM,
100 },
101 [1] = {
102 .start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
103 .end = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
104 .flags = IORESOURCE_IRQ,
105 },
106};
107
108static struct htc_egpio_chip egpio_chips[] = {
109 [0] = {
110 .reg_start = 0,
111 .gpio_base = MAGICIAN_EGPIO(0, 0),
112 .num_gpios = 24,
113 .direction = HTC_EGPIO_OUTPUT,
114 .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */
115 },
116 [1] = {
117 .reg_start = 4,
118 .gpio_base = MAGICIAN_EGPIO(4, 0),
119 .num_gpios = 24,
120 .direction = HTC_EGPIO_INPUT,
121 },
122};
123
124static struct htc_egpio_platform_data egpio_info = {
125 .reg_width = 8,
126 .bus_width = 32,
127 .irq_base = IRQ_BOARD_START,
128 .num_irqs = 4,
129 .ack_register = 3,
130 .chip = egpio_chips,
131 .num_chips = ARRAY_SIZE(egpio_chips),
132};
133
134static struct platform_device egpio = {
135 .name = "htc-egpio",
136 .id = -1,
137 .resource = egpio_resources,
138 .num_resources = ARRAY_SIZE(egpio_resources),
139 .dev = {
140 .platform_data = &egpio_info,
141 },
142};
143
87/* 144/*
88 * LCD - Toppoly TD028STEB1 145 * LCD - Toppoly TD028STEB1
89 */ 146 */
@@ -182,8 +239,8 @@ static struct physmap_flash_data strataflash_data = {
182static struct platform_device strataflash = { 239static struct platform_device strataflash = {
183 .name = "physmap-flash", 240 .name = "physmap-flash",
184 .id = -1, 241 .id = -1,
185 .num_resources = 1,
186 .resource = &strataflash_resource, 242 .resource = &strataflash_resource,
243 .num_resources = 1,
187 .dev = { 244 .dev = {
188 .platform_data = &strataflash_data, 245 .platform_data = &strataflash_data,
189 }, 246 },
@@ -195,6 +252,7 @@ static struct platform_device strataflash = {
195 252
196static struct platform_device *devices[] __initdata = { 253static struct platform_device *devices[] __initdata = {
197 &gpio_keys, 254 &gpio_keys,
255 &egpio,
198 &backlight, 256 &backlight,
199 &strataflash, 257 &strataflash,
200}; 258};