Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 1 | /* |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 2 | * Support for CompuLab EM-X270 platform |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 3 | * |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 4 | * Copyright (C) 2007, 2008 CompuLab, Ltd. |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 5 | * Author: Mike Rapoport <mike@compulab.co.il> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/irq.h> |
| 13 | #include <linux/platform_device.h> |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 14 | #include <linux/delay.h> |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 15 | |
| 16 | #include <linux/dm9000.h> |
| 17 | #include <linux/rtc-v3020.h> |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 18 | #include <linux/mtd/nand.h> |
| 19 | #include <linux/mtd/partitions.h> |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 20 | #include <linux/mtd/physmap.h> |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 21 | #include <linux/input.h> |
| 22 | #include <linux/gpio_keys.h> |
| 23 | #include <linux/gpio.h> |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 24 | #include <linux/mfd/da903x.h> |
| 25 | #include <linux/regulator/machine.h> |
| 26 | #include <linux/spi/spi.h> |
| 27 | #include <linux/spi/tdo24m.h> |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 28 | #include <linux/spi/libertas_spi.h> |
Mike Rapoport | 9f055c4 | 2009-02-02 08:57:53 +0200 | [diff] [blame] | 29 | #include <linux/power_supply.h> |
| 30 | #include <linux/apm-emulation.h> |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 31 | #include <linux/i2c.h> |
| 32 | #include <linux/i2c/pca953x.h> |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 33 | |
| 34 | #include <media/soc_camera.h> |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 35 | |
| 36 | #include <asm/mach-types.h> |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 37 | #include <asm/mach/arch.h> |
| 38 | |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame] | 39 | #include <mach/pxa27x.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 40 | #include <mach/pxa27x-udc.h> |
| 41 | #include <mach/audio.h> |
| 42 | #include <mach/pxafb.h> |
| 43 | #include <mach/ohci.h> |
| 44 | #include <mach/mmc.h> |
| 45 | #include <mach/pxa27x_keypad.h> |
Eric Miao | f0a8370 | 2009-04-13 15:03:11 +0800 | [diff] [blame] | 46 | #include <plat/i2c.h> |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 47 | #include <mach/camera.h> |
| 48 | #include <mach/pxa2xx_spi.h> |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 49 | |
| 50 | #include "generic.h" |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 51 | #include "devices.h" |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 52 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 53 | /* EM-X270 specific GPIOs */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 54 | #define GPIO13_MMC_CD (13) |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 55 | #define GPIO95_MMC_WP (95) |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 56 | #define GPIO56_NAND_RB (56) |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 57 | #define GPIO93_CAM_RESET (93) |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 58 | |
| 59 | /* eXeda specific GPIOs */ |
| 60 | #define GPIO114_MMC_CD (114) |
| 61 | #define GPIO20_NAND_RB (20) |
| 62 | #define GPIO38_SD_PWEN (38) |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 63 | #define GPIO37_WLAN_RST (37) |
| 64 | #define GPIO95_TOUCHPAD_INT (95) |
| 65 | #define GPIO130_CAM_RESET (130) |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 66 | |
| 67 | /* common GPIOs */ |
| 68 | #define GPIO11_NAND_CS (11) |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 69 | #define GPIO41_ETHIRQ (41) |
| 70 | #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 71 | #define GPIO115_WLAN_PWEN (115) |
| 72 | #define GPIO19_WLAN_STRAP (19) |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 73 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 74 | static int mmc_cd; |
| 75 | static int nand_rb; |
| 76 | static int dm9000_flags; |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 77 | static int cam_reset; |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 78 | |
| 79 | static unsigned long common_pin_config[] = { |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 80 | /* AC'97 */ |
| 81 | GPIO28_AC97_BITCLK, |
| 82 | GPIO29_AC97_SDATA_IN_0, |
| 83 | GPIO30_AC97_SDATA_OUT, |
| 84 | GPIO31_AC97_SYNC, |
| 85 | GPIO98_AC97_SYSCLK, |
| 86 | GPIO113_AC97_nRESET, |
| 87 | |
| 88 | /* BTUART */ |
| 89 | GPIO42_BTUART_RXD, |
| 90 | GPIO43_BTUART_TXD, |
| 91 | GPIO44_BTUART_CTS, |
| 92 | GPIO45_BTUART_RTS, |
| 93 | |
| 94 | /* STUART */ |
| 95 | GPIO46_STUART_RXD, |
| 96 | GPIO47_STUART_TXD, |
| 97 | |
| 98 | /* MCI controller */ |
| 99 | GPIO32_MMC_CLK, |
| 100 | GPIO112_MMC_CMD, |
| 101 | GPIO92_MMC_DAT_0, |
| 102 | GPIO109_MMC_DAT_1, |
| 103 | GPIO110_MMC_DAT_2, |
| 104 | GPIO111_MMC_DAT_3, |
| 105 | |
| 106 | /* LCD */ |
| 107 | GPIO58_LCD_LDD_0, |
| 108 | GPIO59_LCD_LDD_1, |
| 109 | GPIO60_LCD_LDD_2, |
| 110 | GPIO61_LCD_LDD_3, |
| 111 | GPIO62_LCD_LDD_4, |
| 112 | GPIO63_LCD_LDD_5, |
| 113 | GPIO64_LCD_LDD_6, |
| 114 | GPIO65_LCD_LDD_7, |
| 115 | GPIO66_LCD_LDD_8, |
| 116 | GPIO67_LCD_LDD_9, |
| 117 | GPIO68_LCD_LDD_10, |
| 118 | GPIO69_LCD_LDD_11, |
| 119 | GPIO70_LCD_LDD_12, |
| 120 | GPIO71_LCD_LDD_13, |
| 121 | GPIO72_LCD_LDD_14, |
| 122 | GPIO73_LCD_LDD_15, |
| 123 | GPIO74_LCD_FCLK, |
| 124 | GPIO75_LCD_LCLK, |
| 125 | GPIO76_LCD_PCLK, |
| 126 | GPIO77_LCD_BIAS, |
| 127 | |
| 128 | /* QCI */ |
| 129 | GPIO84_CIF_FV, |
| 130 | GPIO25_CIF_LV, |
| 131 | GPIO53_CIF_MCLK, |
| 132 | GPIO54_CIF_PCLK, |
| 133 | GPIO81_CIF_DD_0, |
| 134 | GPIO55_CIF_DD_1, |
| 135 | GPIO51_CIF_DD_2, |
| 136 | GPIO50_CIF_DD_3, |
| 137 | GPIO52_CIF_DD_4, |
| 138 | GPIO48_CIF_DD_5, |
| 139 | GPIO17_CIF_DD_6, |
| 140 | GPIO12_CIF_DD_7, |
| 141 | |
| 142 | /* I2C */ |
| 143 | GPIO117_I2C_SCL, |
| 144 | GPIO118_I2C_SDA, |
| 145 | |
| 146 | /* Keypad */ |
| 147 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 148 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 149 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 150 | GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
| 151 | GPIO39_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, |
| 152 | GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, |
| 153 | GPIO91_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH, |
| 154 | GPIO36_KP_MKIN_7 | WAKEUP_ON_LEVEL_HIGH, |
| 155 | GPIO103_KP_MKOUT_0, |
| 156 | GPIO104_KP_MKOUT_1, |
| 157 | GPIO105_KP_MKOUT_2, |
| 158 | GPIO106_KP_MKOUT_3, |
| 159 | GPIO107_KP_MKOUT_4, |
| 160 | GPIO108_KP_MKOUT_5, |
| 161 | GPIO96_KP_MKOUT_6, |
| 162 | GPIO22_KP_MKOUT_7, |
| 163 | |
| 164 | /* SSP1 */ |
| 165 | GPIO26_SSP1_RXD, |
| 166 | GPIO23_SSP1_SCLK, |
| 167 | GPIO24_SSP1_SFRM, |
| 168 | GPIO57_SSP1_TXD, |
| 169 | |
| 170 | /* SSP2 */ |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 171 | GPIO19_GPIO, /* SSP2 clock is used as GPIO for Libertas pin-strap */ |
| 172 | GPIO14_GPIO, |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 173 | GPIO89_SSP2_TXD, |
| 174 | GPIO88_SSP2_RXD, |
| 175 | |
| 176 | /* SDRAM and local bus */ |
| 177 | GPIO15_nCS_1, |
| 178 | GPIO78_nCS_2, |
| 179 | GPIO79_nCS_3, |
| 180 | GPIO80_nCS_4, |
| 181 | GPIO49_nPWE, |
| 182 | GPIO18_RDY, |
| 183 | |
| 184 | /* GPIO */ |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 185 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* sleep/resume button */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 186 | |
| 187 | /* power controls */ |
| 188 | GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */ |
| 189 | GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */ |
| 190 | |
| 191 | /* NAND controls */ |
| 192 | GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 193 | |
| 194 | /* interrupts */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 195 | GPIO41_GPIO, /* DM9000 interrupt */ |
| 196 | }; |
| 197 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 198 | static unsigned long em_x270_pin_config[] = { |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 199 | GPIO13_GPIO, /* MMC card detect */ |
| 200 | GPIO56_GPIO, /* NAND Ready/Busy */ |
| 201 | GPIO93_GPIO | MFP_LPM_DRIVE_LOW, /* Camera reset */ |
| 202 | GPIO95_GPIO, /* MMC Write protect */ |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 203 | }; |
| 204 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 205 | static unsigned long exeda_pin_config[] = { |
| 206 | GPIO20_GPIO, /* NAND Ready/Busy */ |
| 207 | GPIO38_GPIO | MFP_LPM_DRIVE_LOW, /* SD slot power */ |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 208 | GPIO95_GPIO, /* touchpad IRQ */ |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 209 | GPIO114_GPIO, /* MMC card detect */ |
| 210 | }; |
| 211 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 212 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 213 | static struct resource em_x270_dm9000_resource[] = { |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 214 | [0] = { |
| 215 | .start = PXA_CS2_PHYS, |
| 216 | .end = PXA_CS2_PHYS + 3, |
| 217 | .flags = IORESOURCE_MEM, |
| 218 | }, |
| 219 | [1] = { |
| 220 | .start = PXA_CS2_PHYS + 8, |
| 221 | .end = PXA_CS2_PHYS + 8 + 0x3f, |
| 222 | .flags = IORESOURCE_MEM, |
| 223 | }, |
| 224 | [2] = { |
| 225 | .start = EM_X270_ETHIRQ, |
| 226 | .end = EM_X270_ETHIRQ, |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 227 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 228 | } |
| 229 | }; |
| 230 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 231 | static struct dm9000_plat_data em_x270_dm9000_platdata = { |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 232 | .flags = DM9000_PLATF_NO_EEPROM, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 233 | }; |
| 234 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 235 | static struct platform_device em_x270_dm9000 = { |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 236 | .name = "dm9000", |
| 237 | .id = 0, |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 238 | .num_resources = ARRAY_SIZE(em_x270_dm9000_resource), |
| 239 | .resource = em_x270_dm9000_resource, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 240 | .dev = { |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 241 | .platform_data = &em_x270_dm9000_platdata, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 242 | } |
| 243 | }; |
| 244 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 245 | static void __init em_x270_init_dm9000(void) |
| 246 | { |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 247 | em_x270_dm9000_platdata.flags |= dm9000_flags; |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 248 | platform_device_register(&em_x270_dm9000); |
| 249 | } |
| 250 | #else |
| 251 | static inline void em_x270_init_dm9000(void) {} |
| 252 | #endif |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 253 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 254 | /* V3020 RTC */ |
| 255 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 256 | static struct resource em_x270_v3020_resource[] = { |
| 257 | [0] = { |
| 258 | .start = PXA_CS4_PHYS, |
| 259 | .end = PXA_CS4_PHYS + 3, |
| 260 | .flags = IORESOURCE_MEM, |
| 261 | }, |
| 262 | }; |
| 263 | |
| 264 | static struct v3020_platform_data em_x270_v3020_platdata = { |
| 265 | .leftshift = 0, |
| 266 | }; |
| 267 | |
| 268 | static struct platform_device em_x270_rtc = { |
| 269 | .name = "v3020", |
| 270 | .num_resources = ARRAY_SIZE(em_x270_v3020_resource), |
| 271 | .resource = em_x270_v3020_resource, |
| 272 | .id = -1, |
| 273 | .dev = { |
| 274 | .platform_data = &em_x270_v3020_platdata, |
| 275 | } |
| 276 | }; |
| 277 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 278 | static void __init em_x270_init_rtc(void) |
| 279 | { |
| 280 | platform_device_register(&em_x270_rtc); |
| 281 | } |
| 282 | #else |
| 283 | static inline void em_x270_init_rtc(void) {} |
| 284 | #endif |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 285 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 286 | /* NAND flash */ |
| 287 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 288 | static inline void nand_cs_on(void) |
| 289 | { |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 290 | gpio_set_value(GPIO11_NAND_CS, 0); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | static void nand_cs_off(void) |
| 294 | { |
| 295 | dsb(); |
| 296 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 297 | gpio_set_value(GPIO11_NAND_CS, 1); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | /* hardware specific access to control-lines */ |
| 301 | static void em_x270_nand_cmd_ctl(struct mtd_info *mtd, int dat, |
| 302 | unsigned int ctrl) |
| 303 | { |
| 304 | struct nand_chip *this = mtd->priv; |
| 305 | unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; |
| 306 | |
| 307 | dsb(); |
| 308 | |
| 309 | if (ctrl & NAND_CTRL_CHANGE) { |
| 310 | if (ctrl & NAND_ALE) |
| 311 | nandaddr |= (1 << 3); |
| 312 | else |
| 313 | nandaddr &= ~(1 << 3); |
| 314 | if (ctrl & NAND_CLE) |
| 315 | nandaddr |= (1 << 2); |
| 316 | else |
| 317 | nandaddr &= ~(1 << 2); |
| 318 | if (ctrl & NAND_NCE) |
| 319 | nand_cs_on(); |
| 320 | else |
| 321 | nand_cs_off(); |
| 322 | } |
| 323 | |
| 324 | dsb(); |
| 325 | this->IO_ADDR_W = (void __iomem *)nandaddr; |
| 326 | if (dat != NAND_CMD_NONE) |
| 327 | writel(dat, this->IO_ADDR_W); |
| 328 | |
| 329 | dsb(); |
| 330 | } |
| 331 | |
| 332 | /* read device ready pin */ |
| 333 | static int em_x270_nand_device_ready(struct mtd_info *mtd) |
| 334 | { |
| 335 | dsb(); |
| 336 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 337 | return gpio_get_value(nand_rb); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 338 | } |
| 339 | |
| 340 | static struct mtd_partition em_x270_partition_info[] = { |
| 341 | [0] = { |
| 342 | .name = "em_x270-0", |
| 343 | .offset = 0, |
| 344 | .size = SZ_4M, |
| 345 | }, |
| 346 | [1] = { |
| 347 | .name = "em_x270-1", |
| 348 | .offset = MTDPART_OFS_APPEND, |
| 349 | .size = MTDPART_SIZ_FULL |
| 350 | }, |
| 351 | }; |
| 352 | |
| 353 | static const char *em_x270_part_probes[] = { "cmdlinepart", NULL }; |
| 354 | |
| 355 | struct platform_nand_data em_x270_nand_platdata = { |
| 356 | .chip = { |
| 357 | .nr_chips = 1, |
| 358 | .chip_offset = 0, |
| 359 | .nr_partitions = ARRAY_SIZE(em_x270_partition_info), |
| 360 | .partitions = em_x270_partition_info, |
| 361 | .chip_delay = 20, |
| 362 | .part_probe_types = em_x270_part_probes, |
| 363 | }, |
| 364 | .ctrl = { |
| 365 | .hwcontrol = 0, |
| 366 | .dev_ready = em_x270_nand_device_ready, |
| 367 | .select_chip = 0, |
| 368 | .cmd_ctrl = em_x270_nand_cmd_ctl, |
| 369 | }, |
| 370 | }; |
| 371 | |
| 372 | static struct resource em_x270_nand_resource[] = { |
| 373 | [0] = { |
| 374 | .start = PXA_CS1_PHYS, |
| 375 | .end = PXA_CS1_PHYS + 12, |
| 376 | .flags = IORESOURCE_MEM, |
| 377 | }, |
| 378 | }; |
| 379 | |
| 380 | static struct platform_device em_x270_nand = { |
| 381 | .name = "gen_nand", |
| 382 | .num_resources = ARRAY_SIZE(em_x270_nand_resource), |
| 383 | .resource = em_x270_nand_resource, |
| 384 | .id = -1, |
| 385 | .dev = { |
| 386 | .platform_data = &em_x270_nand_platdata, |
| 387 | } |
| 388 | }; |
| 389 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 390 | static void __init em_x270_init_nand(void) |
| 391 | { |
| 392 | int err; |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 393 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 394 | err = gpio_request(GPIO11_NAND_CS, "NAND CS"); |
| 395 | if (err) { |
| 396 | pr_warning("EM-X270: failed to request NAND CS gpio\n"); |
| 397 | return; |
| 398 | } |
| 399 | |
| 400 | gpio_direction_output(GPIO11_NAND_CS, 1); |
| 401 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 402 | err = gpio_request(nand_rb, "NAND R/B"); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 403 | if (err) { |
| 404 | pr_warning("EM-X270: failed to request NAND R/B gpio\n"); |
| 405 | gpio_free(GPIO11_NAND_CS); |
| 406 | return; |
| 407 | } |
| 408 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 409 | gpio_direction_input(nand_rb); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 410 | |
| 411 | platform_device_register(&em_x270_nand); |
| 412 | } |
| 413 | #else |
| 414 | static inline void em_x270_init_nand(void) {} |
| 415 | #endif |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 416 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 417 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
| 418 | static struct mtd_partition em_x270_nor_parts[] = { |
| 419 | { |
| 420 | .name = "Bootloader", |
| 421 | .offset = 0x00000000, |
| 422 | .size = 0x00050000, |
| 423 | .mask_flags = MTD_WRITEABLE /* force read-only */ |
| 424 | }, { |
| 425 | .name = "Environment", |
| 426 | .offset = 0x00050000, |
| 427 | .size = 0x00010000, |
| 428 | }, { |
| 429 | .name = "Reserved", |
| 430 | .offset = 0x00060000, |
| 431 | .size = 0x00050000, |
| 432 | .mask_flags = MTD_WRITEABLE /* force read-only */ |
| 433 | }, { |
| 434 | .name = "Splashscreen", |
| 435 | .offset = 0x000b0000, |
| 436 | .size = 0x00050000, |
| 437 | } |
| 438 | }; |
| 439 | |
| 440 | static struct physmap_flash_data em_x270_nor_data[] = { |
| 441 | [0] = { |
| 442 | .width = 2, |
| 443 | .parts = em_x270_nor_parts, |
| 444 | .nr_parts = ARRAY_SIZE(em_x270_nor_parts), |
| 445 | }, |
| 446 | }; |
| 447 | |
| 448 | static struct resource em_x270_nor_flash_resource = { |
| 449 | .start = PXA_CS0_PHYS, |
| 450 | .end = PXA_CS0_PHYS + SZ_1M - 1, |
| 451 | .flags = IORESOURCE_MEM, |
| 452 | }; |
| 453 | |
| 454 | static struct platform_device em_x270_physmap_flash = { |
| 455 | .name = "physmap-flash", |
| 456 | .id = 0, |
| 457 | .num_resources = 1, |
| 458 | .resource = &em_x270_nor_flash_resource, |
| 459 | .dev = { |
| 460 | .platform_data = &em_x270_nor_data, |
| 461 | }, |
| 462 | }; |
| 463 | |
| 464 | static void __init em_x270_init_nor(void) |
| 465 | { |
| 466 | platform_device_register(&em_x270_physmap_flash); |
| 467 | } |
| 468 | #else |
| 469 | static inline void em_x270_init_nor(void) {} |
| 470 | #endif |
| 471 | |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 472 | /* PXA27x OHCI controller setup */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 473 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 474 | static int em_x270_ohci_init(struct device *dev) |
| 475 | { |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 476 | /* enable port 2 transiever */ |
| 477 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE; |
| 478 | |
| 479 | return 0; |
| 480 | } |
| 481 | |
| 482 | static struct pxaohci_platform_data em_x270_ohci_platform_data = { |
| 483 | .port_mode = PMM_PERPORT_MODE, |
Eric Miao | 097b533 | 2008-09-27 15:49:57 +0800 | [diff] [blame] | 484 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 485 | .init = em_x270_ohci_init, |
| 486 | }; |
| 487 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 488 | static void __init em_x270_init_ohci(void) |
| 489 | { |
| 490 | pxa_set_ohci_info(&em_x270_ohci_platform_data); |
| 491 | } |
| 492 | #else |
| 493 | static inline void em_x270_init_ohci(void) {} |
| 494 | #endif |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 495 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 496 | /* MCI controller setup */ |
| 497 | #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 498 | static struct regulator *em_x270_sdio_ldo; |
| 499 | |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 500 | static int em_x270_mci_init(struct device *dev, |
| 501 | irq_handler_t em_x270_detect_int, |
| 502 | void *data) |
| 503 | { |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 504 | int err; |
| 505 | |
| 506 | em_x270_sdio_ldo = regulator_get(dev, "vcc sdio"); |
| 507 | if (IS_ERR(em_x270_sdio_ldo)) { |
| 508 | dev_err(dev, "can't request SDIO power supply: %ld\n", |
| 509 | PTR_ERR(em_x270_sdio_ldo)); |
| 510 | return PTR_ERR(em_x270_sdio_ldo); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 511 | } |
| 512 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 513 | err = request_irq(gpio_to_irq(mmc_cd), em_x270_detect_int, |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 514 | IRQF_DISABLED | IRQF_TRIGGER_RISING | |
| 515 | IRQF_TRIGGER_FALLING, |
| 516 | "MMC card detect", data); |
| 517 | if (err) { |
| 518 | dev_err(dev, "can't request MMC card detect IRQ: %d\n", err); |
| 519 | goto err_irq; |
| 520 | } |
| 521 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 522 | if (machine_is_em_x270()) { |
| 523 | err = gpio_request(GPIO95_MMC_WP, "MMC WP"); |
| 524 | if (err) { |
| 525 | dev_err(dev, "can't request MMC write protect: %d\n", |
| 526 | err); |
| 527 | goto err_gpio_wp; |
| 528 | } |
| 529 | gpio_direction_input(GPIO95_MMC_WP); |
| 530 | } else { |
| 531 | err = gpio_request(GPIO38_SD_PWEN, "sdio power"); |
| 532 | if (err) { |
| 533 | dev_err(dev, "can't request MMC power control : %d\n", |
| 534 | err); |
| 535 | goto err_gpio_wp; |
| 536 | } |
| 537 | gpio_direction_output(GPIO38_SD_PWEN, 1); |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 538 | } |
| 539 | |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 540 | return 0; |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 541 | |
| 542 | err_gpio_wp: |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 543 | free_irq(gpio_to_irq(mmc_cd), data); |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 544 | err_irq: |
| 545 | regulator_put(em_x270_sdio_ldo); |
| 546 | |
| 547 | return err; |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | static void em_x270_mci_setpower(struct device *dev, unsigned int vdd) |
| 551 | { |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 552 | struct pxamci_platform_data* p_d = dev->platform_data; |
| 553 | |
| 554 | if ((1 << vdd) & p_d->ocr_mask) { |
| 555 | int vdd_uV = (2000 + (vdd - __ffs(MMC_VDD_20_21)) * 100) * 1000; |
| 556 | |
| 557 | regulator_set_voltage(em_x270_sdio_ldo, vdd_uV, vdd_uV); |
| 558 | regulator_enable(em_x270_sdio_ldo); |
| 559 | } else { |
| 560 | regulator_disable(em_x270_sdio_ldo); |
| 561 | } |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 562 | } |
| 563 | |
| 564 | static void em_x270_mci_exit(struct device *dev, void *data) |
| 565 | { |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 566 | free_irq(gpio_to_irq(mmc_cd), data); |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 567 | regulator_put(em_x270_sdio_ldo); |
| 568 | |
| 569 | if (machine_is_em_x270()) |
| 570 | gpio_free(GPIO95_MMC_WP); |
| 571 | else |
| 572 | gpio_free(GPIO38_SD_PWEN); |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 573 | } |
| 574 | |
| 575 | static int em_x270_mci_get_ro(struct device *dev) |
| 576 | { |
| 577 | return gpio_get_value(GPIO95_MMC_WP); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 578 | } |
| 579 | |
| 580 | static struct pxamci_platform_data em_x270_mci_platform_data = { |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 581 | .ocr_mask = MMC_VDD_20_21|MMC_VDD_21_22|MMC_VDD_22_23| |
| 582 | MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27| |
| 583 | MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30| |
| 584 | MMC_VDD_30_31|MMC_VDD_31_32, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 585 | .init = em_x270_mci_init, |
| 586 | .setpower = em_x270_mci_setpower, |
| 587 | .exit = em_x270_mci_exit, |
| 588 | }; |
| 589 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 590 | static void __init em_x270_init_mmc(void) |
| 591 | { |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 592 | if (machine_is_em_x270()) |
| 593 | em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro; |
| 594 | |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 595 | em_x270_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 596 | pxa_set_mci_info(&em_x270_mci_platform_data); |
| 597 | } |
| 598 | #else |
| 599 | static inline void em_x270_init_mmc(void) {} |
| 600 | #endif |
| 601 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 602 | /* LCD */ |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 603 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 604 | static struct pxafb_mode_info em_x270_lcd_modes[] = { |
| 605 | [0] = { |
| 606 | .pixclock = 38250, |
| 607 | .bpp = 16, |
| 608 | .xres = 480, |
| 609 | .yres = 640, |
| 610 | .hsync_len = 8, |
| 611 | .vsync_len = 2, |
| 612 | .left_margin = 8, |
| 613 | .upper_margin = 2, |
| 614 | .right_margin = 24, |
| 615 | .lower_margin = 4, |
| 616 | .sync = 0, |
| 617 | }, |
| 618 | [1] = { |
| 619 | .pixclock = 153800, |
| 620 | .bpp = 16, |
| 621 | .xres = 240, |
| 622 | .yres = 320, |
| 623 | .hsync_len = 8, |
| 624 | .vsync_len = 2, |
| 625 | .left_margin = 8, |
| 626 | .upper_margin = 2, |
| 627 | .right_margin = 88, |
| 628 | .lower_margin = 2, |
| 629 | .sync = 0, |
| 630 | }, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 631 | }; |
| 632 | |
| 633 | static struct pxafb_mach_info em_x270_lcd = { |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 634 | .modes = em_x270_lcd_modes, |
| 635 | .num_modes = 2, |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 636 | .lcd_conn = LCD_COLOR_TFT_16BPP, |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 637 | }; |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 638 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 639 | static void __init em_x270_init_lcd(void) |
| 640 | { |
| 641 | set_pxa_fb_info(&em_x270_lcd); |
| 642 | } |
| 643 | #else |
| 644 | static inline void em_x270_init_lcd(void) {} |
| 645 | #endif |
| 646 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 647 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) |
| 648 | static struct pxa2xx_spi_master em_x270_spi_info = { |
| 649 | .num_chipselect = 1, |
| 650 | }; |
| 651 | |
| 652 | static struct pxa2xx_spi_chip em_x270_tdo24m_chip = { |
Mike Rapoport | bd9d074 | 2009-04-14 08:32:55 +0300 | [diff] [blame] | 653 | .rx_threshold = 1, |
| 654 | .tx_threshold = 1, |
| 655 | .gpio_cs = -1, |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 656 | }; |
| 657 | |
| 658 | static struct tdo24m_platform_data em_x270_tdo24m_pdata = { |
| 659 | .model = TDO35S, |
| 660 | }; |
| 661 | |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 662 | static struct pxa2xx_spi_master em_x270_spi_2_info = { |
| 663 | .num_chipselect = 1, |
| 664 | .enable_dma = 1, |
| 665 | }; |
| 666 | |
| 667 | static struct pxa2xx_spi_chip em_x270_libertas_chip = { |
| 668 | .rx_threshold = 1, |
| 669 | .tx_threshold = 1, |
| 670 | .timeout = 1000, |
| 671 | }; |
| 672 | |
| 673 | static unsigned long em_x270_libertas_pin_config[] = { |
| 674 | /* SSP2 */ |
| 675 | GPIO19_SSP2_SCLK, |
| 676 | GPIO14_GPIO, |
| 677 | GPIO89_SSP2_TXD, |
| 678 | GPIO88_SSP2_RXD, |
| 679 | }; |
| 680 | |
| 681 | static int em_x270_libertas_setup(struct spi_device *spi) |
| 682 | { |
| 683 | int err = gpio_request(GPIO115_WLAN_PWEN, "WLAN PWEN"); |
| 684 | if (err) |
| 685 | return err; |
| 686 | |
| 687 | gpio_direction_output(GPIO19_WLAN_STRAP, 1); |
| 688 | mdelay(100); |
| 689 | |
| 690 | pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config)); |
| 691 | |
| 692 | gpio_direction_output(GPIO115_WLAN_PWEN, 0); |
| 693 | mdelay(100); |
| 694 | gpio_set_value(GPIO115_WLAN_PWEN, 1); |
| 695 | mdelay(100); |
| 696 | |
| 697 | spi->bits_per_word = 16; |
| 698 | spi_setup(spi); |
| 699 | |
| 700 | return 0; |
| 701 | } |
| 702 | |
| 703 | static int em_x270_libertas_teardown(struct spi_device *spi) |
| 704 | { |
| 705 | gpio_set_value(GPIO115_WLAN_PWEN, 0); |
| 706 | gpio_free(GPIO115_WLAN_PWEN); |
| 707 | |
| 708 | return 0; |
| 709 | } |
| 710 | |
| 711 | struct libertas_spi_platform_data em_x270_libertas_pdata = { |
| 712 | .use_dummy_writes = 1, |
| 713 | .gpio_cs = 14, |
| 714 | .setup = em_x270_libertas_setup, |
| 715 | .teardown = em_x270_libertas_teardown, |
| 716 | }; |
| 717 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 718 | static struct spi_board_info em_x270_spi_devices[] __initdata = { |
| 719 | { |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 720 | .modalias = "tdo24m", |
| 721 | .max_speed_hz = 1000000, |
| 722 | .bus_num = 1, |
| 723 | .chip_select = 0, |
| 724 | .controller_data = &em_x270_tdo24m_chip, |
| 725 | .platform_data = &em_x270_tdo24m_pdata, |
| 726 | }, |
| 727 | { |
| 728 | .modalias = "libertas_spi", |
| 729 | .max_speed_hz = 13000000, |
| 730 | .bus_num = 2, |
| 731 | .irq = IRQ_GPIO(116), |
| 732 | .chip_select = 0, |
| 733 | .controller_data = &em_x270_libertas_chip, |
| 734 | .platform_data = &em_x270_libertas_pdata, |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 735 | }, |
| 736 | }; |
| 737 | |
| 738 | static void __init em_x270_init_spi(void) |
| 739 | { |
| 740 | pxa2xx_set_spi_info(1, &em_x270_spi_info); |
Mike Rapoport | c9be0e3 | 2009-02-03 09:15:30 +0200 | [diff] [blame] | 741 | pxa2xx_set_spi_info(2, &em_x270_spi_2_info); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 742 | spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices)); |
| 743 | } |
| 744 | #else |
| 745 | static inline void em_x270_init_spi(void) {} |
| 746 | #endif |
| 747 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 748 | #if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) |
| 749 | static void __init em_x270_init_ac97(void) |
| 750 | { |
| 751 | pxa_set_ac97_info(NULL); |
| 752 | } |
| 753 | #else |
| 754 | static inline void em_x270_init_ac97(void) {} |
| 755 | #endif |
| 756 | |
| 757 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 758 | static unsigned int em_x270_module_matrix_keys[] = { |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 759 | KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B), |
| 760 | KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT), |
| 761 | KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), |
| 762 | }; |
| 763 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 764 | struct pxa27x_keypad_platform_data em_x270_module_keypad_info = { |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 765 | /* code map for the matrix keys */ |
| 766 | .matrix_key_rows = 3, |
| 767 | .matrix_key_cols = 3, |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 768 | .matrix_key_map = em_x270_module_matrix_keys, |
| 769 | .matrix_key_map_size = ARRAY_SIZE(em_x270_module_matrix_keys), |
| 770 | }; |
| 771 | |
| 772 | static unsigned int em_x270_exeda_matrix_keys[] = { |
| 773 | KEY(0, 0, KEY_RIGHTSHIFT), KEY(0, 1, KEY_RIGHTCTRL), |
| 774 | KEY(0, 2, KEY_RIGHTALT), KEY(0, 3, KEY_SPACE), |
| 775 | KEY(0, 4, KEY_LEFTALT), KEY(0, 5, KEY_LEFTCTRL), |
| 776 | KEY(0, 6, KEY_ENTER), KEY(0, 7, KEY_SLASH), |
| 777 | |
| 778 | KEY(1, 0, KEY_DOT), KEY(1, 1, KEY_M), |
| 779 | KEY(1, 2, KEY_N), KEY(1, 3, KEY_B), |
| 780 | KEY(1, 4, KEY_V), KEY(1, 5, KEY_C), |
| 781 | KEY(1, 6, KEY_X), KEY(1, 7, KEY_Z), |
| 782 | |
| 783 | KEY(2, 0, KEY_LEFTSHIFT), KEY(2, 1, KEY_SEMICOLON), |
| 784 | KEY(2, 2, KEY_L), KEY(2, 3, KEY_K), |
| 785 | KEY(2, 4, KEY_J), KEY(2, 5, KEY_H), |
| 786 | KEY(2, 6, KEY_G), KEY(2, 7, KEY_F), |
| 787 | |
| 788 | KEY(3, 0, KEY_D), KEY(3, 1, KEY_S), |
| 789 | KEY(3, 2, KEY_A), KEY(3, 3, KEY_TAB), |
| 790 | KEY(3, 4, KEY_BACKSPACE), KEY(3, 5, KEY_P), |
| 791 | KEY(3, 6, KEY_O), KEY(3, 7, KEY_I), |
| 792 | |
| 793 | KEY(4, 0, KEY_U), KEY(4, 1, KEY_Y), |
| 794 | KEY(4, 2, KEY_T), KEY(4, 3, KEY_R), |
| 795 | KEY(4, 4, KEY_E), KEY(4, 5, KEY_W), |
| 796 | KEY(4, 6, KEY_Q), KEY(4, 7, KEY_MINUS), |
| 797 | |
| 798 | KEY(5, 0, KEY_0), KEY(5, 1, KEY_9), |
| 799 | KEY(5, 2, KEY_8), KEY(5, 3, KEY_7), |
| 800 | KEY(5, 4, KEY_6), KEY(5, 5, KEY_5), |
| 801 | KEY(5, 6, KEY_4), KEY(5, 7, KEY_3), |
| 802 | |
| 803 | KEY(6, 0, KEY_2), KEY(6, 1, KEY_1), |
| 804 | KEY(6, 2, KEY_ENTER), KEY(6, 3, KEY_END), |
| 805 | KEY(6, 4, KEY_DOWN), KEY(6, 5, KEY_UP), |
| 806 | KEY(6, 6, KEY_MENU), KEY(6, 7, KEY_F1), |
| 807 | |
| 808 | KEY(7, 0, KEY_LEFT), KEY(7, 1, KEY_RIGHT), |
| 809 | KEY(7, 2, KEY_BACK), KEY(7, 3, KEY_HOME), |
| 810 | KEY(7, 4, 0), KEY(7, 5, 0), |
| 811 | KEY(7, 6, 0), KEY(7, 7, 0), |
| 812 | }; |
| 813 | |
| 814 | struct pxa27x_keypad_platform_data em_x270_exeda_keypad_info = { |
| 815 | /* code map for the matrix keys */ |
| 816 | .matrix_key_rows = 8, |
| 817 | .matrix_key_cols = 8, |
| 818 | .matrix_key_map = em_x270_exeda_matrix_keys, |
| 819 | .matrix_key_map_size = ARRAY_SIZE(em_x270_exeda_matrix_keys), |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 820 | }; |
| 821 | |
| 822 | static void __init em_x270_init_keypad(void) |
| 823 | { |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 824 | if (machine_is_em_x270()) |
| 825 | pxa_set_keypad_info(&em_x270_module_keypad_info); |
| 826 | else |
| 827 | pxa_set_keypad_info(&em_x270_exeda_keypad_info); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 828 | } |
| 829 | #else |
| 830 | static inline void em_x270_init_keypad(void) {} |
| 831 | #endif |
| 832 | |
| 833 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 834 | static struct gpio_keys_button gpio_keys_button[] = { |
| 835 | [0] = { |
| 836 | .desc = "sleep/wakeup", |
| 837 | .code = KEY_SUSPEND, |
| 838 | .type = EV_PWR, |
| 839 | .gpio = 1, |
| 840 | .wakeup = 1, |
| 841 | }, |
| 842 | }; |
| 843 | |
| 844 | static struct gpio_keys_platform_data em_x270_gpio_keys_data = { |
| 845 | .buttons = gpio_keys_button, |
| 846 | .nbuttons = 1, |
| 847 | }; |
| 848 | |
| 849 | static struct platform_device em_x270_gpio_keys = { |
| 850 | .name = "gpio-keys", |
| 851 | .id = -1, |
| 852 | .dev = { |
| 853 | .platform_data = &em_x270_gpio_keys_data, |
| 854 | }, |
| 855 | }; |
| 856 | |
| 857 | static void __init em_x270_init_gpio_keys(void) |
| 858 | { |
| 859 | platform_device_register(&em_x270_gpio_keys); |
| 860 | } |
| 861 | #else |
| 862 | static inline void em_x270_init_gpio_keys(void) {} |
| 863 | #endif |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 864 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 865 | /* Quick Capture Interface and sensor setup */ |
| 866 | #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) |
| 867 | static struct regulator *em_x270_camera_ldo; |
| 868 | |
| 869 | static int em_x270_sensor_init(struct device *dev) |
| 870 | { |
| 871 | int ret; |
| 872 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 873 | ret = gpio_request(cam_reset, "camera reset"); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 874 | if (ret) |
| 875 | return ret; |
| 876 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 877 | gpio_direction_output(cam_reset, 0); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 878 | |
| 879 | em_x270_camera_ldo = regulator_get(NULL, "vcc cam"); |
| 880 | if (em_x270_camera_ldo == NULL) { |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 881 | gpio_free(cam_reset); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 882 | return -ENODEV; |
| 883 | } |
| 884 | |
| 885 | ret = regulator_enable(em_x270_camera_ldo); |
| 886 | if (ret) { |
| 887 | regulator_put(em_x270_camera_ldo); |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 888 | gpio_free(cam_reset); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 889 | return ret; |
| 890 | } |
| 891 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 892 | gpio_set_value(cam_reset, 1); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 893 | |
| 894 | return 0; |
| 895 | } |
| 896 | |
| 897 | struct pxacamera_platform_data em_x270_camera_platform_data = { |
| 898 | .init = em_x270_sensor_init, |
| 899 | .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | |
| 900 | PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, |
| 901 | .mclk_10khz = 2600, |
| 902 | }; |
| 903 | |
| 904 | static int em_x270_sensor_power(struct device *dev, int on) |
| 905 | { |
| 906 | int ret; |
| 907 | int is_on = regulator_is_enabled(em_x270_camera_ldo); |
| 908 | |
| 909 | if (on == is_on) |
| 910 | return 0; |
| 911 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 912 | gpio_set_value(cam_reset, !on); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 913 | |
| 914 | if (on) |
| 915 | ret = regulator_enable(em_x270_camera_ldo); |
| 916 | else |
| 917 | ret = regulator_disable(em_x270_camera_ldo); |
| 918 | |
| 919 | if (ret) |
| 920 | return ret; |
| 921 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 922 | gpio_set_value(cam_reset, on); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 923 | |
| 924 | return 0; |
| 925 | } |
| 926 | |
| 927 | static struct soc_camera_link iclink = { |
| 928 | .bus_id = 0, |
| 929 | .power = em_x270_sensor_power, |
| 930 | }; |
| 931 | |
| 932 | static struct i2c_board_info em_x270_i2c_cam_info[] = { |
| 933 | { |
| 934 | I2C_BOARD_INFO("mt9m111", 0x48), |
| 935 | .platform_data = &iclink, |
| 936 | }, |
| 937 | }; |
| 938 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 939 | static void __init em_x270_init_camera(void) |
| 940 | { |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 941 | i2c_register_board_info(0, ARRAY_AND_SIZE(em_x270_i2c_cam_info)); |
| 942 | pxa_set_camera_info(&em_x270_camera_platform_data); |
| 943 | } |
| 944 | #else |
| 945 | static inline void em_x270_init_camera(void) {} |
| 946 | #endif |
| 947 | |
| 948 | /* DA9030 related initializations */ |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 949 | #define REGULATOR_CONSUMER(_name, _dev, _supply) \ |
| 950 | static struct regulator_consumer_supply _name##_consumers[] = { \ |
| 951 | { \ |
| 952 | .dev = _dev, \ |
| 953 | .supply = _supply, \ |
| 954 | }, \ |
| 955 | } |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 956 | |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 957 | REGULATOR_CONSUMER(ldo3, NULL, "vcc gps"); |
| 958 | REGULATOR_CONSUMER(ldo5, NULL, "vcc cam"); |
| 959 | REGULATOR_CONSUMER(ldo10, &pxa_device_mci.dev, "vcc sdio"); |
| 960 | REGULATOR_CONSUMER(ldo12, NULL, "vcc usb"); |
| 961 | REGULATOR_CONSUMER(ldo19, NULL, "vcc gprs"); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 962 | |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 963 | #define REGULATOR_INIT(_ldo, _min_uV, _max_uV, _ops_mask) \ |
| 964 | static struct regulator_init_data _ldo##_data = { \ |
| 965 | .constraints = { \ |
| 966 | .min_uV = _min_uV, \ |
| 967 | .max_uV = _max_uV, \ |
| 968 | .state_mem = { \ |
| 969 | .enabled = 0, \ |
| 970 | }, \ |
| 971 | .valid_ops_mask = _ops_mask, \ |
| 972 | }, \ |
| 973 | .num_consumer_supplies = ARRAY_SIZE(_ldo##_consumers), \ |
| 974 | .consumer_supplies = _ldo##_consumers, \ |
| 975 | }; |
Mike Rapoport | 6432f46 | 2009-02-02 08:57:51 +0200 | [diff] [blame] | 976 | |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 977 | REGULATOR_INIT(ldo3, 3200000, 3200000, REGULATOR_CHANGE_STATUS); |
| 978 | REGULATOR_INIT(ldo5, 3000000, 3000000, REGULATOR_CHANGE_STATUS); |
| 979 | REGULATOR_INIT(ldo10, 2000000, 3200000, |
| 980 | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE); |
| 981 | REGULATOR_INIT(ldo12, 3000000, 3000000, REGULATOR_CHANGE_STATUS); |
| 982 | REGULATOR_INIT(ldo19, 3200000, 3200000, REGULATOR_CHANGE_STATUS); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 983 | |
| 984 | struct led_info em_x270_led_info = { |
| 985 | .name = "em-x270:orange", |
| 986 | .default_trigger = "battery-charging-or-full", |
| 987 | }; |
| 988 | |
Mike Rapoport | 9f055c4 | 2009-02-02 08:57:53 +0200 | [diff] [blame] | 989 | struct power_supply_info em_x270_psy_info = { |
| 990 | .name = "LP555597P6H-FPS", |
| 991 | .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, |
| 992 | .voltage_max_design = 4200000, |
| 993 | .voltage_min_design = 3000000, |
| 994 | .use_for_apm = 1, |
| 995 | }; |
| 996 | |
| 997 | static void em_x270_battery_low(void) |
| 998 | { |
| 999 | apm_queue_event(APM_LOW_BATTERY); |
| 1000 | } |
| 1001 | |
| 1002 | static void em_x270_battery_critical(void) |
| 1003 | { |
| 1004 | apm_queue_event(APM_CRITICAL_SUSPEND); |
| 1005 | } |
| 1006 | |
| 1007 | struct da9030_battery_info em_x270_batterty_info = { |
| 1008 | .battery_info = &em_x270_psy_info, |
| 1009 | |
| 1010 | .charge_milliamp = 1000, |
| 1011 | .charge_millivolt = 4200, |
| 1012 | |
| 1013 | .vbat_low = 3600, |
| 1014 | .vbat_crit = 3400, |
| 1015 | .vbat_charge_start = 4100, |
| 1016 | .vbat_charge_stop = 4200, |
| 1017 | .vbat_charge_restart = 4000, |
| 1018 | |
| 1019 | .vcharge_min = 3200, |
| 1020 | .vcharge_max = 5500, |
| 1021 | |
| 1022 | .tbat_low = 197, |
| 1023 | .tbat_high = 78, |
| 1024 | .tbat_restart = 100, |
| 1025 | |
| 1026 | .batmon_interval = 0, |
| 1027 | |
| 1028 | .battery_low = em_x270_battery_low, |
| 1029 | .battery_critical = em_x270_battery_critical, |
| 1030 | }; |
| 1031 | |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 1032 | #define DA9030_SUBDEV(_name, _id, _pdata) \ |
| 1033 | { \ |
| 1034 | .name = "da903x-" #_name, \ |
| 1035 | .id = DA9030_ID_##_id, \ |
| 1036 | .platform_data = _pdata, \ |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 1037 | } |
Mike Rapoport | 432adf1 | 2009-02-02 08:57:52 +0200 | [diff] [blame] | 1038 | |
| 1039 | #define DA9030_LDO(num) DA9030_SUBDEV(regulator, LDO##num, &ldo##num##_data) |
| 1040 | |
| 1041 | struct da903x_subdev_info em_x270_da9030_subdevs[] = { |
| 1042 | DA9030_LDO(3), |
| 1043 | DA9030_LDO(5), |
| 1044 | DA9030_LDO(10), |
| 1045 | DA9030_LDO(12), |
| 1046 | DA9030_LDO(19), |
| 1047 | |
| 1048 | DA9030_SUBDEV(led, LED_PC, &em_x270_led_info), |
| 1049 | DA9030_SUBDEV(backlight, WLED, &em_x270_led_info), |
Mike Rapoport | 9f055c4 | 2009-02-02 08:57:53 +0200 | [diff] [blame] | 1050 | DA9030_SUBDEV(battery, BAT, &em_x270_batterty_info), |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 1051 | }; |
| 1052 | |
| 1053 | static struct da903x_platform_data em_x270_da9030_info = { |
| 1054 | .num_subdevs = ARRAY_SIZE(em_x270_da9030_subdevs), |
| 1055 | .subdevs = em_x270_da9030_subdevs, |
| 1056 | }; |
| 1057 | |
| 1058 | static struct i2c_board_info em_x270_i2c_pmic_info = { |
| 1059 | I2C_BOARD_INFO("da9030", 0x49), |
| 1060 | .irq = IRQ_GPIO(0), |
| 1061 | .platform_data = &em_x270_da9030_info, |
| 1062 | }; |
| 1063 | |
| 1064 | static struct i2c_pxa_platform_data em_x270_pwr_i2c_info = { |
| 1065 | .use_pio = 1, |
| 1066 | }; |
| 1067 | |
| 1068 | static void __init em_x270_init_da9030(void) |
| 1069 | { |
| 1070 | pxa27x_set_i2c_power_info(&em_x270_pwr_i2c_info); |
| 1071 | i2c_register_board_info(1, &em_x270_i2c_pmic_info, 1); |
| 1072 | } |
| 1073 | |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 1074 | static struct pca953x_platform_data exeda_gpio_ext_pdata = { |
| 1075 | .gpio_base = 128, |
| 1076 | }; |
| 1077 | |
| 1078 | static struct i2c_board_info exeda_i2c_info[] = { |
| 1079 | { |
| 1080 | I2C_BOARD_INFO("pca9555", 0x21), |
| 1081 | .platform_data = &exeda_gpio_ext_pdata, |
| 1082 | }, |
| 1083 | }; |
| 1084 | |
| 1085 | static struct i2c_pxa_platform_data em_x270_i2c_info = { |
| 1086 | .fast_mode = 1, |
| 1087 | }; |
| 1088 | |
| 1089 | static void __init em_x270_init_i2c(void) |
| 1090 | { |
| 1091 | pxa_set_i2c_info(&em_x270_i2c_info); |
| 1092 | |
| 1093 | if (machine_is_exeda()) |
| 1094 | i2c_register_board_info(0, ARRAY_AND_SIZE(exeda_i2c_info)); |
| 1095 | } |
| 1096 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 1097 | static void __init em_x270_module_init(void) |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 1098 | { |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 1099 | pr_info("%s\n", __func__); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 1100 | pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config)); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 1101 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 1102 | mmc_cd = GPIO13_MMC_CD; |
| 1103 | nand_rb = GPIO56_NAND_RB; |
| 1104 | dm9000_flags = DM9000_PLATF_32BITONLY; |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 1105 | cam_reset = GPIO93_CAM_RESET; |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 1106 | } |
| 1107 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 1108 | static void __init em_x270_exeda_init(void) |
| 1109 | { |
| 1110 | pr_info("%s\n", __func__); |
| 1111 | pxa2xx_mfp_config(ARRAY_AND_SIZE(exeda_pin_config)); |
| 1112 | |
| 1113 | mmc_cd = GPIO114_MMC_CD; |
| 1114 | nand_rb = GPIO20_NAND_RB; |
| 1115 | dm9000_flags = DM9000_PLATF_16BITONLY; |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 1116 | cam_reset = GPIO130_CAM_RESET; |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 1117 | } |
| 1118 | |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 1119 | static void __init em_x270_init(void) |
| 1120 | { |
| 1121 | pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
| 1122 | |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 1123 | if (machine_is_em_x270()) |
| 1124 | em_x270_module_init(); |
| 1125 | else if (machine_is_exeda()) |
| 1126 | em_x270_exeda_init(); |
| 1127 | else |
| 1128 | panic("Unsupported machine: %d\n", machine_arch_type); |
Mike Rapoport | 4a697e8 | 2009-02-02 08:57:54 +0200 | [diff] [blame] | 1129 | |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 1130 | em_x270_init_da9030(); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 1131 | em_x270_init_dm9000(); |
| 1132 | em_x270_init_rtc(); |
| 1133 | em_x270_init_nand(); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 1134 | em_x270_init_nor(); |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 1135 | em_x270_init_lcd(); |
| 1136 | em_x270_init_mmc(); |
| 1137 | em_x270_init_ohci(); |
| 1138 | em_x270_init_keypad(); |
| 1139 | em_x270_init_gpio_keys(); |
| 1140 | em_x270_init_ac97(); |
Mike Rapoport | 28c8804 | 2008-12-03 09:38:10 +0200 | [diff] [blame] | 1141 | em_x270_init_spi(); |
Mike Rapoport | 76e3fc3 | 2009-05-12 16:31:13 +0300 | [diff] [blame^] | 1142 | em_x270_init_i2c(); |
| 1143 | em_x270_init_camera(); |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 1144 | } |
| 1145 | |
Mike Rapoport | 3c85bce | 2008-06-16 08:16:46 +0100 | [diff] [blame] | 1146 | MACHINE_START(EM_X270, "Compulab EM-X270") |
Mike Rapoport | 3d50527 | 2007-07-18 11:31:46 +0100 | [diff] [blame] | 1147 | .boot_params = 0xa0000100, |
| 1148 | .phys_io = 0x40000000, |
| 1149 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 1150 | .map_io = pxa_map_io, |
| 1151 | .init_irq = pxa27x_init_irq, |
| 1152 | .timer = &pxa_timer, |
| 1153 | .init_machine = em_x270_init, |
| 1154 | MACHINE_END |
Mike Rapoport | 7f14a78 | 2009-02-02 08:57:55 +0200 | [diff] [blame] | 1155 | |
| 1156 | MACHINE_START(EXEDA, "Compulab eXeda") |
| 1157 | .boot_params = 0xa0000100, |
| 1158 | .phys_io = 0x40000000, |
| 1159 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 1160 | .map_io = pxa_map_io, |
| 1161 | .init_irq = pxa27x_init_irq, |
| 1162 | .timer = &pxa_timer, |
| 1163 | .init_machine = em_x270_init, |
| 1164 | MACHINE_END |