aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/zylonite_pxa300.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/zylonite_pxa300.c')
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c50
1 files changed, 47 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index 324fb9daae28..b28d46e081d3 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"
@@ -50,6 +53,7 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
50 GPIO75_LCD_BIAS, 53 GPIO75_LCD_BIAS,
51 GPIO76_LCD_VSYNC, 54 GPIO76_LCD_VSYNC,
52 GPIO127_LCD_CS_N, 55 GPIO127_LCD_CS_N,
56 GPIO20_PWM3_OUT, /* backlight */
53 57
54 /* BTUART */ 58 /* BTUART */
55 GPIO111_UART2_RTS, 59 GPIO111_UART2_RTS,
@@ -108,6 +112,10 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
108 GPIO12_MMC2_DAT3, 112 GPIO12_MMC2_DAT3,
109 GPIO13_MMC2_CLK, 113 GPIO13_MMC2_CLK,
110 GPIO14_MMC2_CMD, 114 GPIO14_MMC2_CMD,
115
116 /* Standard I2C */
117 GPIO21_I2C_SCL,
118 GPIO22_I2C_SDA,
111}; 119};
112 120
113static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { 121static mfp_cfg_t pxa300_mfp_cfg[] __initdata = {
@@ -191,6 +199,39 @@ static void __init zylonite_detect_lcd_panel(void)
191 pxa3xx_mfp_write(lcd_detect_pins[i], mfpr_save[i]); 199 pxa3xx_mfp_write(lcd_detect_pins[i], mfpr_save[i]);
192} 200}
193 201
202#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
203static struct pca953x_platform_data gpio_exp[] = {
204 [0] = {
205 .gpio_base = 128,
206 },
207 [1] = {
208 .gpio_base = 144,
209 },
210};
211
212struct 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
226static 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
232static inline void zylonite_init_i2c(void) {}
233#endif
234
194void __init zylonite_pxa300_init(void) 235void __init zylonite_pxa300_init(void)
195{ 236{
196 if (cpu_is_pxa300() || cpu_is_pxa310()) { 237 if (cpu_is_pxa300() || cpu_is_pxa310()) {
@@ -200,15 +241,14 @@ void __init zylonite_pxa300_init(void)
200 /* detect LCD panel */ 241 /* detect LCD panel */
201 zylonite_detect_lcd_panel(); 242 zylonite_detect_lcd_panel();
202 243
203 /* GPIO pin assignment */
204 gpio_backlight = mfp_to_gpio(MFP_PIN_GPIO20);
205
206 /* MMC card detect & write protect for controller 0 */ 244 /* MMC card detect & write protect for controller 0 */
207 zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); 245 zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0);
208 zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2); 246 zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2);
209 247
210 /* WM9713 IRQ */ 248 /* WM9713 IRQ */
211 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); 249 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26);
250
251 zylonite_init_i2c();
212 } 252 }
213 253
214 if (cpu_is_pxa300()) { 254 if (cpu_is_pxa300()) {
@@ -224,4 +264,8 @@ void __init zylonite_pxa300_init(void)
224 zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30); 264 zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30);
225 zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31); 265 zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31);
226 } 266 }
267
268 /* GPIOs for Debug LEDs */
269 gpio_debug_led1 = EXT_GPIO(25);
270 gpio_debug_led2 = EXT_GPIO(26);
227} 271}