ACPI: Make AC and battery drivers available on !X86
[sfrench/cifs-2.6.git] / arch / arm / mach-pxa / vpac270.c
1 /*
2  * Hardware definitions for Voipac PXA270
3  *
4  * Copyright (C) 2010
5  * Marek Vasut <marek.vasut@gmail.com>
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
13 #include <linux/platform_device.h>
14 #include <linux/delay.h>
15 #include <linux/irq.h>
16 #include <linux/gpio_keys.h>
17 #include <linux/input.h>
18 #include <linux/leds.h>
19 #include <linux/gpio.h>
20 #include <linux/gpio/machine.h>
21 #include <linux/usb/gpio_vbus.h>
22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/mtd/physmap.h>
25 #include <linux/mtd/onenand.h>
26 #include <linux/dm9000.h>
27 #include <linux/ucb1400.h>
28 #include <linux/ata_platform.h>
29 #include <linux/regulator/machine.h>
30 #include <linux/regulator/max1586.h>
31 #include <linux/platform_data/i2c-pxa.h>
32
33 #include <asm/mach-types.h>
34 #include <asm/mach/arch.h>
35
36 #include "pxa27x.h"
37 #include <mach/audio.h>
38 #include <mach/vpac270.h>
39 #include <linux/platform_data/mmc-pxamci.h>
40 #include <linux/platform_data/video-pxafb.h>
41 #include <linux/platform_data/usb-ohci-pxa27x.h>
42 #include "pxa27x-udc.h"
43 #include "udc.h"
44 #include <linux/platform_data/ata-pxa.h>
45
46 #include "generic.h"
47 #include "devices.h"
48
49 /******************************************************************************
50  * Pin configuration
51  ******************************************************************************/
52 static unsigned long vpac270_pin_config[] __initdata = {
53         /* MMC */
54         GPIO32_MMC_CLK,
55         GPIO92_MMC_DAT_0,
56         GPIO109_MMC_DAT_1,
57         GPIO110_MMC_DAT_2,
58         GPIO111_MMC_DAT_3,
59         GPIO112_MMC_CMD,
60         GPIO53_GPIO,    /* SD detect */
61         GPIO52_GPIO,    /* SD r/o switch */
62
63         /* GPIO KEYS */
64         GPIO1_GPIO,     /* USER BTN */
65
66         /* LEDs */
67         GPIO15_GPIO,    /* orange led */
68
69         /* FFUART */
70         GPIO34_FFUART_RXD,
71         GPIO39_FFUART_TXD,
72         GPIO27_FFUART_RTS,
73         GPIO100_FFUART_CTS,
74         GPIO33_FFUART_DSR,
75         GPIO40_FFUART_DTR,
76         GPIO10_FFUART_DCD,
77         GPIO38_FFUART_RI,
78
79         /* LCD */
80         GPIO58_LCD_LDD_0,
81         GPIO59_LCD_LDD_1,
82         GPIO60_LCD_LDD_2,
83         GPIO61_LCD_LDD_3,
84         GPIO62_LCD_LDD_4,
85         GPIO63_LCD_LDD_5,
86         GPIO64_LCD_LDD_6,
87         GPIO65_LCD_LDD_7,
88         GPIO66_LCD_LDD_8,
89         GPIO67_LCD_LDD_9,
90         GPIO68_LCD_LDD_10,
91         GPIO69_LCD_LDD_11,
92         GPIO70_LCD_LDD_12,
93         GPIO71_LCD_LDD_13,
94         GPIO72_LCD_LDD_14,
95         GPIO73_LCD_LDD_15,
96         GPIO86_LCD_LDD_16,
97         GPIO87_LCD_LDD_17,
98         GPIO74_LCD_FCLK,
99         GPIO75_LCD_LCLK,
100         GPIO76_LCD_PCLK,
101         GPIO77_LCD_BIAS,
102
103         /* PCMCIA */
104         GPIO48_nPOE,
105         GPIO49_nPWE,
106         GPIO50_nPIOR,
107         GPIO51_nPIOW,
108         GPIO85_nPCE_1,
109         GPIO54_nPCE_2,
110         GPIO55_nPREG,
111         GPIO57_nIOIS16,
112         GPIO56_nPWAIT,
113         GPIO104_PSKTSEL,
114         GPIO84_GPIO,    /* PCMCIA CD */
115         GPIO35_GPIO,    /* PCMCIA RDY */
116         GPIO107_GPIO,   /* PCMCIA PPEN */
117         GPIO11_GPIO,    /* PCMCIA RESET */
118         GPIO17_GPIO,    /* CF CD */
119         GPIO12_GPIO,    /* CF RDY */
120         GPIO16_GPIO,    /* CF RESET */
121
122         /* UHC */
123         GPIO88_USBH1_PWR,
124         GPIO89_USBH1_PEN,
125         GPIO119_USBH2_PWR,
126         GPIO120_USBH2_PEN,
127
128         /* UDC */
129         GPIO41_GPIO,
130
131         /* Ethernet */
132         GPIO114_GPIO,   /* IRQ */
133
134         /* AC97 */
135         GPIO28_AC97_BITCLK,
136         GPIO29_AC97_SDATA_IN_0,
137         GPIO30_AC97_SDATA_OUT,
138         GPIO31_AC97_SYNC,
139         GPIO95_AC97_nRESET,
140         GPIO98_AC97_SYSCLK,
141         GPIO113_GPIO,   /* TS IRQ */
142
143         /* I2C */
144         GPIO117_I2C_SCL,
145         GPIO118_I2C_SDA,
146
147         /* IDE */
148         GPIO36_GPIO,    /* IDE IRQ */
149         GPIO80_DREQ_1,
150 };
151
152 /******************************************************************************
153  * NOR Flash
154  ******************************************************************************/
155 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
156 static struct mtd_partition vpac270_nor_partitions[] = {
157         {
158                 .name           = "Flash",
159                 .offset         = 0x00000000,
160                 .size           = MTDPART_SIZ_FULL,
161         }
162 };
163
164 static struct physmap_flash_data vpac270_flash_data[] = {
165         {
166                 .width          = 2,    /* bankwidth in bytes */
167                 .parts          = vpac270_nor_partitions,
168                 .nr_parts       = ARRAY_SIZE(vpac270_nor_partitions)
169         }
170 };
171
172 static struct resource vpac270_flash_resource = {
173         .start  = PXA_CS0_PHYS,
174         .end    = PXA_CS0_PHYS + SZ_64M - 1,
175         .flags  = IORESOURCE_MEM,
176 };
177
178 static struct platform_device vpac270_flash = {
179         .name           = "physmap-flash",
180         .id             = 0,
181         .resource       = &vpac270_flash_resource,
182         .num_resources  = 1,
183         .dev            = {
184                 .platform_data = vpac270_flash_data,
185         },
186 };
187 static void __init vpac270_nor_init(void)
188 {
189         platform_device_register(&vpac270_flash);
190 }
191 #else
192 static inline void vpac270_nor_init(void) {}
193 #endif
194
195 /******************************************************************************
196  * OneNAND Flash
197  ******************************************************************************/
198 #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
199 static struct mtd_partition vpac270_onenand_partitions[] = {
200         {
201                 .name           = "Flash",
202                 .offset         = 0x00000000,
203                 .size           = MTDPART_SIZ_FULL,
204         }
205 };
206
207 static struct onenand_platform_data vpac270_onenand_info = {
208         .parts          = vpac270_onenand_partitions,
209         .nr_parts       = ARRAY_SIZE(vpac270_onenand_partitions),
210 };
211
212 static struct resource vpac270_onenand_resources[] = {
213         [0] = {
214                 .start  = PXA_CS0_PHYS,
215                 .end    = PXA_CS0_PHYS + SZ_1M,
216                 .flags  = IORESOURCE_MEM,
217         },
218 };
219
220 static struct platform_device vpac270_onenand = {
221         .name           = "onenand-flash",
222         .id             = -1,
223         .resource       = vpac270_onenand_resources,
224         .num_resources  = ARRAY_SIZE(vpac270_onenand_resources),
225         .dev            = {
226                 .platform_data  = &vpac270_onenand_info,
227         },
228 };
229
230 static void __init vpac270_onenand_init(void)
231 {
232         platform_device_register(&vpac270_onenand);
233 }
234 #else
235 static void __init vpac270_onenand_init(void) {}
236 #endif
237
238 /******************************************************************************
239  * SD/MMC card controller
240  ******************************************************************************/
241 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
242 static struct pxamci_platform_data vpac270_mci_platform_data = {
243         .ocr_mask               = MMC_VDD_32_33 | MMC_VDD_33_34,
244         .detect_delay_ms        = 200,
245 };
246
247 static struct gpiod_lookup_table vpac270_mci_gpio_table = {
248         .dev_id = "pxa2xx-mci.0",
249         .table = {
250                 GPIO_LOOKUP("gpio-pxa", GPIO53_VPAC270_SD_DETECT_N,
251                             "cd", GPIO_ACTIVE_LOW),
252                 GPIO_LOOKUP("gpio-pxa", GPIO52_VPAC270_SD_READONLY,
253                             "wp", GPIO_ACTIVE_LOW),
254                 { },
255         },
256 };
257
258 static void __init vpac270_mmc_init(void)
259 {
260         gpiod_add_lookup_table(&vpac270_mci_gpio_table);
261         pxa_set_mci_info(&vpac270_mci_platform_data);
262 }
263 #else
264 static inline void vpac270_mmc_init(void) {}
265 #endif
266
267 /******************************************************************************
268  * GPIO keys
269  ******************************************************************************/
270 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
271 static struct gpio_keys_button vpac270_pxa_buttons[] = {
272         {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
273 };
274
275 static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
276         .buttons        = vpac270_pxa_buttons,
277         .nbuttons       = ARRAY_SIZE(vpac270_pxa_buttons),
278 };
279
280 static struct platform_device vpac270_pxa_keys = {
281         .name   = "gpio-keys",
282         .id     = -1,
283         .dev    = {
284                 .platform_data = &vpac270_pxa_keys_data,
285         },
286 };
287
288 static void __init vpac270_keys_init(void)
289 {
290         platform_device_register(&vpac270_pxa_keys);
291 }
292 #else
293 static inline void vpac270_keys_init(void) {}
294 #endif
295
296 /******************************************************************************
297  * LED
298  ******************************************************************************/
299 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
300 struct gpio_led vpac270_gpio_leds[] = {
301 {
302         .name                   = "vpac270:orange:user",
303         .default_trigger        = "none",
304         .gpio                   = GPIO15_VPAC270_LED_ORANGE,
305         .active_low             = 1,
306 }
307 };
308
309 static struct gpio_led_platform_data vpac270_gpio_led_info = {
310         .leds           = vpac270_gpio_leds,
311         .num_leds       = ARRAY_SIZE(vpac270_gpio_leds),
312 };
313
314 static struct platform_device vpac270_leds = {
315         .name   = "leds-gpio",
316         .id     = -1,
317         .dev    = {
318                 .platform_data  = &vpac270_gpio_led_info,
319         }
320 };
321
322 static void __init vpac270_leds_init(void)
323 {
324         platform_device_register(&vpac270_leds);
325 }
326 #else
327 static inline void vpac270_leds_init(void) {}
328 #endif
329
330 /******************************************************************************
331  * USB Host
332  ******************************************************************************/
333 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
334 static int vpac270_ohci_init(struct device *dev)
335 {
336         UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
337         return 0;
338 }
339
340 static struct pxaohci_platform_data vpac270_ohci_info = {
341         .port_mode      = PMM_PERPORT_MODE,
342         .flags          = ENABLE_PORT1 | ENABLE_PORT2 |
343                         POWER_CONTROL_LOW | POWER_SENSE_LOW,
344         .init           = vpac270_ohci_init,
345 };
346
347 static void __init vpac270_uhc_init(void)
348 {
349         pxa_set_ohci_info(&vpac270_ohci_info);
350 }
351 #else
352 static inline void vpac270_uhc_init(void) {}
353 #endif
354
355 /******************************************************************************
356  * USB Gadget
357  ******************************************************************************/
358 #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
359 static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
360         .gpio_vbus              = GPIO41_VPAC270_UDC_DETECT,
361         .gpio_pullup            = -1,
362 };
363
364 static struct platform_device vpac270_gpio_vbus = {
365         .name   = "gpio-vbus",
366         .id     = -1,
367         .dev    = {
368                 .platform_data  = &vpac270_gpio_vbus_info,
369         },
370 };
371
372 static void vpac270_udc_command(int cmd)
373 {
374         if (cmd == PXA2XX_UDC_CMD_CONNECT)
375                 UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
376         else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
377                 UP2OCR = UP2OCR_HXOE;
378 }
379
380 static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
381         .udc_command            = vpac270_udc_command,
382         .gpio_pullup            = -1,
383 };
384
385 static void __init vpac270_udc_init(void)
386 {
387         pxa_set_udc_info(&vpac270_udc_info);
388         platform_device_register(&vpac270_gpio_vbus);
389 }
390 #else
391 static inline void vpac270_udc_init(void) {}
392 #endif
393
394 /******************************************************************************
395  * Ethernet
396  ******************************************************************************/
397 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
398 static struct resource vpac270_dm9000_resources[] = {
399         [0] = {
400                 .start  = PXA_CS2_PHYS + 0x300,
401                 .end    = PXA_CS2_PHYS + 0x303,
402                 .flags  = IORESOURCE_MEM,
403         },
404         [1] = {
405                 .start  = PXA_CS2_PHYS + 0x304,
406                 .end    = PXA_CS2_PHYS + 0x343,
407                 .flags  = IORESOURCE_MEM,
408         },
409         [2] = {
410                 .start  = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
411                 .end    = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
412                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
413         },
414 };
415
416 static struct dm9000_plat_data vpac270_dm9000_platdata = {
417         .flags          = DM9000_PLATF_32BITONLY,
418 };
419
420 static struct platform_device vpac270_dm9000_device = {
421         .name           = "dm9000",
422         .id             = -1,
423         .num_resources  = ARRAY_SIZE(vpac270_dm9000_resources),
424         .resource       = vpac270_dm9000_resources,
425         .dev            = {
426                 .platform_data = &vpac270_dm9000_platdata,
427         }
428 };
429
430 static void __init vpac270_eth_init(void)
431 {
432         platform_device_register(&vpac270_dm9000_device);
433 }
434 #else
435 static inline void vpac270_eth_init(void) {}
436 #endif
437
438 /******************************************************************************
439  * Audio and Touchscreen
440  ******************************************************************************/
441 #if     defined(CONFIG_TOUCHSCREEN_UCB1400) || \
442         defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
443 static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
444         .reset_gpio     = 95,
445 };
446
447 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
448         .irq            = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
449 };
450
451 static struct platform_device vpac270_ucb1400_device = {
452         .name           = "ucb1400_core",
453         .id             = -1,
454         .dev            = {
455                 .platform_data = &vpac270_ucb1400_pdata,
456         },
457 };
458
459 static void __init vpac270_ts_init(void)
460 {
461         pxa_set_ac97_info(&vpac270_ac97_pdata);
462         platform_device_register(&vpac270_ucb1400_device);
463 }
464 #else
465 static inline void vpac270_ts_init(void) {}
466 #endif
467
468 /******************************************************************************
469  * RTC
470  ******************************************************************************/
471 #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
472 static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
473         {
474                 I2C_BOARD_INFO("ds1339", 0x68),
475         },
476 };
477
478 static void __init vpac270_rtc_init(void)
479 {
480         i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
481 }
482 #else
483 static inline void vpac270_rtc_init(void) {}
484 #endif
485
486 /******************************************************************************
487  * Framebuffer
488  ******************************************************************************/
489 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
490 static struct pxafb_mode_info vpac270_lcd_modes[] = {
491 {
492         .pixclock       = 57692,
493         .xres           = 640,
494         .yres           = 480,
495         .bpp            = 32,
496         .depth          = 18,
497
498         .left_margin    = 144,
499         .right_margin   = 32,
500         .upper_margin   = 13,
501         .lower_margin   = 30,
502
503         .hsync_len      = 32,
504         .vsync_len      = 2,
505
506         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
507 }, {    /* CRT 640x480 */
508         .pixclock       = 35000,
509         .xres           = 640,
510         .yres           = 480,
511         .bpp            = 16,
512         .depth          = 16,
513
514         .left_margin    = 96,
515         .right_margin   = 48,
516         .upper_margin   = 33,
517         .lower_margin   = 10,
518
519         .hsync_len      = 48,
520         .vsync_len      = 1,
521
522         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
523 }, {    /* CRT 800x600 H=30kHz V=48HZ */
524         .pixclock       = 25000,
525         .xres           = 800,
526         .yres           = 600,
527         .bpp            = 16,
528         .depth          = 16,
529
530         .left_margin    = 50,
531         .right_margin   = 1,
532         .upper_margin   = 21,
533         .lower_margin   = 12,
534
535         .hsync_len      = 8,
536         .vsync_len      = 1,
537
538         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
539 }, {    /* CRT 1024x768 H=40kHz V=50Hz */
540         .pixclock       = 15000,
541         .xres           = 1024,
542         .yres           = 768,
543         .bpp            = 16,
544         .depth          = 16,
545
546         .left_margin    = 220,
547         .right_margin   = 8,
548         .upper_margin   = 33,
549         .lower_margin   = 2,
550
551         .hsync_len      = 48,
552         .vsync_len      = 1,
553
554         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
555 }
556 };
557
558 static struct pxafb_mach_info vpac270_lcd_screen = {
559         .modes          = vpac270_lcd_modes,
560         .num_modes      = ARRAY_SIZE(vpac270_lcd_modes),
561         .lcd_conn       = LCD_COLOR_TFT_18BPP,
562 };
563
564 static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
565 {
566         gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
567 }
568
569 static void __init vpac270_lcd_init(void)
570 {
571         int ret;
572
573         ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
574         if (ret) {
575                 pr_err("Requesting BKL-ON GPIO failed!\n");
576                 goto err;
577         }
578
579         ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
580         if (ret) {
581                 pr_err("Setting BKL-ON GPIO direction failed!\n");
582                 goto err2;
583         }
584
585         vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
586         pxa_set_fb_info(NULL, &vpac270_lcd_screen);
587         return;
588
589 err2:
590         gpio_free(GPIO81_VPAC270_BKL_ON);
591 err:
592         return;
593 }
594 #else
595 static inline void vpac270_lcd_init(void) {}
596 #endif
597
598 /******************************************************************************
599  * PATA IDE
600  ******************************************************************************/
601 #if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
602 static struct pata_pxa_pdata vpac270_pata_pdata = {
603         .reg_shift      = 1,
604         .dma_dreq       = 1,
605         .irq_flags      = IRQF_TRIGGER_RISING,
606 };
607
608 static struct resource vpac270_ide_resources[] = {
609         [0] = { /* I/O Base address */
610                .start   = PXA_CS3_PHYS + 0x120,
611                .end     = PXA_CS3_PHYS + 0x13f,
612                .flags   = IORESOURCE_MEM
613         },
614         [1] = { /* CTL Base address */
615                .start   = PXA_CS3_PHYS + 0x15c,
616                .end     = PXA_CS3_PHYS + 0x15f,
617                .flags   = IORESOURCE_MEM
618         },
619         [2] = { /* DMA Base address */
620                .start   = PXA_CS3_PHYS + 0x20,
621                .end     = PXA_CS3_PHYS + 0x2f,
622                .flags   = IORESOURCE_DMA
623         },
624         [3] = { /* IDE IRQ pin */
625                .start   = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
626                .end     = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
627                .flags   = IORESOURCE_IRQ
628         }
629 };
630
631 static struct platform_device vpac270_ide_device = {
632         .name           = "pata_pxa",
633         .num_resources  = ARRAY_SIZE(vpac270_ide_resources),
634         .resource       = vpac270_ide_resources,
635         .dev            = {
636                 .platform_data  = &vpac270_pata_pdata,
637                 .coherent_dma_mask      = 0xffffffff,
638         }
639 };
640
641 static void __init vpac270_ide_init(void)
642 {
643         platform_device_register(&vpac270_ide_device);
644 }
645 #else
646 static inline void vpac270_ide_init(void) {}
647 #endif
648
649 /******************************************************************************
650  * Core power regulator
651  ******************************************************************************/
652 #if defined(CONFIG_REGULATOR_MAX1586) || \
653     defined(CONFIG_REGULATOR_MAX1586_MODULE)
654 static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
655         REGULATOR_SUPPLY("vcc_core", NULL),
656 };
657
658 static struct regulator_init_data vpac270_max1587a_v3_info = {
659         .constraints = {
660                 .name           = "vcc_core range",
661                 .min_uV         = 900000,
662                 .max_uV         = 1705000,
663                 .always_on      = 1,
664                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
665         },
666         .consumer_supplies      = vpac270_max1587a_consumers,
667         .num_consumer_supplies  = ARRAY_SIZE(vpac270_max1587a_consumers),
668 };
669
670 static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
671         {
672                 .name           = "vcc_core",
673                 .id             = MAX1586_V3,
674                 .platform_data  = &vpac270_max1587a_v3_info,
675         }
676 };
677
678 static struct max1586_platform_data vpac270_max1587a_info = {
679         .subdevs     = vpac270_max1587a_subdevs,
680         .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
681         .v3_gain     = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
682 };
683
684 static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
685         {
686                 I2C_BOARD_INFO("max1586", 0x14),
687                 .platform_data  = &vpac270_max1587a_info,
688         },
689 };
690
691 static void __init vpac270_pmic_init(void)
692 {
693         i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
694 }
695 #else
696 static inline void vpac270_pmic_init(void) {}
697 #endif
698
699
700 /******************************************************************************
701  * Machine init
702  ******************************************************************************/
703 static void __init vpac270_init(void)
704 {
705         pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
706
707         pxa_set_ffuart_info(NULL);
708         pxa_set_btuart_info(NULL);
709         pxa_set_stuart_info(NULL);
710         pxa_set_i2c_info(NULL);
711         pxa27x_set_i2c_power_info(NULL);
712
713         vpac270_pmic_init();
714         vpac270_lcd_init();
715         vpac270_mmc_init();
716         vpac270_nor_init();
717         vpac270_onenand_init();
718         vpac270_leds_init();
719         vpac270_keys_init();
720         vpac270_uhc_init();
721         vpac270_udc_init();
722         vpac270_eth_init();
723         vpac270_ts_init();
724         vpac270_rtc_init();
725         vpac270_ide_init();
726
727         regulator_has_full_constraints();
728 }
729
730 MACHINE_START(VPAC270, "Voipac PXA270")
731         .atag_offset    = 0x100,
732         .map_io         = pxa27x_map_io,
733         .nr_irqs        = PXA_NR_IRQS,
734         .init_irq       = pxa27x_init_irq,
735         .handle_irq     = pxa27x_handle_irq,
736         .init_time      = pxa_timer_init,
737         .init_machine   = vpac270_init,
738         .restart        = pxa_restart,
739 MACHINE_END