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