diff options
author | Eric Miao <eric.miao@marvell.com> | 2008-05-27 22:44:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-09 16:38:33 -0400 |
commit | a1f7fc48c143537e2bf70affee7e8932f5be9bb4 (patch) | |
tree | 6552959ef42504b804bd527cc751058d33847c0b /arch/arm | |
parent | 9c1db1a1333197bc04dfd0c71d15f8ed43eb844d (diff) |
[ARM] pxa: add GPIO expander (PCA9539) support for zylonite
And also reserve 32 IRQs for the two GPIO expanders.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa300.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index 6f7ae972b8db..75bf61f1f1c3 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c | |||
@@ -16,9 +16,12 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/i2c.h> | ||
20 | #include <linux/i2c/pca953x.h> | ||
19 | 21 | ||
20 | #include <asm/gpio.h> | 22 | #include <asm/gpio.h> |
21 | #include <asm/arch/mfp-pxa300.h> | 23 | #include <asm/arch/mfp-pxa300.h> |
24 | #include <asm/arch/i2c.h> | ||
22 | #include <asm/arch/zylonite.h> | 25 | #include <asm/arch/zylonite.h> |
23 | 26 | ||
24 | #include "generic.h" | 27 | #include "generic.h" |
@@ -109,6 +112,10 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = { | |||
109 | GPIO12_MMC2_DAT3, | 112 | GPIO12_MMC2_DAT3, |
110 | GPIO13_MMC2_CLK, | 113 | GPIO13_MMC2_CLK, |
111 | GPIO14_MMC2_CMD, | 114 | GPIO14_MMC2_CMD, |
115 | |||
116 | /* Standard I2C */ | ||
117 | GPIO21_I2C_SCL, | ||
118 | GPIO22_I2C_SDA, | ||
112 | }; | 119 | }; |
113 | 120 | ||
114 | static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { | 121 | static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { |
@@ -192,6 +199,39 @@ static void __init zylonite_detect_lcd_panel(void) | |||
192 | pxa3xx_mfp_write(lcd_detect_pins[i], mfpr_save[i]); | 199 | pxa3xx_mfp_write(lcd_detect_pins[i], mfpr_save[i]); |
193 | } | 200 | } |
194 | 201 | ||
202 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
203 | static struct pca953x_platform_data gpio_exp[] = { | ||
204 | [0] = { | ||
205 | .gpio_base = 128, | ||
206 | }, | ||
207 | [1] = { | ||
208 | .gpio_base = 144, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | struct i2c_board_info zylonite_i2c_board_info[] = { | ||
213 | { | ||
214 | .type = "pca9539", | ||
215 | .addr = 0x74, | ||
216 | .platform_data = &gpio_exp[0], | ||
217 | .irq = IRQ_GPIO(18), | ||
218 | }, { | ||
219 | .type = "pca9539", | ||
220 | .addr = 0x75, | ||
221 | .platform_data = &gpio_exp[1], | ||
222 | .irq = IRQ_GPIO(19), | ||
223 | }, | ||
224 | }; | ||
225 | |||
226 | static void __init zylonite_init_i2c(void) | ||
227 | { | ||
228 | pxa_set_i2c_info(NULL); | ||
229 | i2c_register_board_info(0, ARRAY_AND_SIZE(zylonite_i2c_board_info)); | ||
230 | } | ||
231 | #else | ||
232 | static inline void zylonite_init_i2c(void) {} | ||
233 | #endif | ||
234 | |||
195 | void __init zylonite_pxa300_init(void) | 235 | void __init zylonite_pxa300_init(void) |
196 | { | 236 | { |
197 | if (cpu_is_pxa300() || cpu_is_pxa310()) { | 237 | if (cpu_is_pxa300() || cpu_is_pxa310()) { |
@@ -207,6 +247,8 @@ void __init zylonite_pxa300_init(void) | |||
207 | 247 | ||
208 | /* WM9713 IRQ */ | 248 | /* WM9713 IRQ */ |
209 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); | 249 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); |
250 | |||
251 | zylonite_init_i2c(); | ||
210 | } | 252 | } |
211 | 253 | ||
212 | if (cpu_is_pxa300()) { | 254 | if (cpu_is_pxa300()) { |