OSDN Git Service

ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP
[uclinux-h8/linux.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         .gpio_power             = -1,
245         .gpio_card_detect       = GPIO53_VPAC270_SD_DETECT_N,
246         .gpio_card_ro           = GPIO52_VPAC270_SD_READONLY,
247         .detect_delay_ms        = 200,
248 };
249
250 static struct gpiod_lookup_table vpac270_mci_gpio_table = {
251         .dev_id = "pxa2xx-mci.0",
252         .table = {
253                 GPIO_LOOKUP("gpio-pxa", GPIO53_VPAC270_SD_DETECT_N,
254                             "cd", GPIO_ACTIVE_LOW),
255                 GPIO_LOOKUP("gpio-pxa", GPIO52_VPAC270_SD_READONLY,
256                             "wp", GPIO_ACTIVE_LOW),
257                 { },
258         },
259 };
260
261 static void __init vpac270_mmc_init(void)
262 {
263         gpiod_add_lookup_table(&vpac270_mci_gpio_table);
264         pxa_set_mci_info(&vpac270_mci_platform_data);
265 }
266 #else
267 static inline void vpac270_mmc_init(void) {}
268 #endif
269
270 /******************************************************************************
271  * GPIO keys
272  ******************************************************************************/
273 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
274 static struct gpio_keys_button vpac270_pxa_buttons[] = {
275         {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
276 };
277
278 static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
279         .buttons        = vpac270_pxa_buttons,
280         .nbuttons       = ARRAY_SIZE(vpac270_pxa_buttons),
281 };
282
283 static struct platform_device vpac270_pxa_keys = {
284         .name   = "gpio-keys",
285         .id     = -1,
286         .dev    = {
287                 .platform_data = &vpac270_pxa_keys_data,
288         },
289 };
290
291 static void __init vpac270_keys_init(void)
292 {
293         platform_device_register(&vpac270_pxa_keys);
294 }
295 #else
296 static inline void vpac270_keys_init(void) {}
297 #endif
298
299 /******************************************************************************
300  * LED
301  ******************************************************************************/
302 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
303 struct gpio_led vpac270_gpio_leds[] = {
304 {
305         .name                   = "vpac270:orange:user",
306         .default_trigger        = "none",
307         .gpio                   = GPIO15_VPAC270_LED_ORANGE,
308         .active_low             = 1,
309 }
310 };
311
312 static struct gpio_led_platform_data vpac270_gpio_led_info = {
313         .leds           = vpac270_gpio_leds,
314         .num_leds       = ARRAY_SIZE(vpac270_gpio_leds),
315 };
316
317 static struct platform_device vpac270_leds = {
318         .name   = "leds-gpio",
319         .id     = -1,
320         .dev    = {
321                 .platform_data  = &vpac270_gpio_led_info,
322         }
323 };
324
325 static void __init vpac270_leds_init(void)
326 {
327         platform_device_register(&vpac270_leds);
328 }
329 #else
330 static inline void vpac270_leds_init(void) {}
331 #endif
332
333 /******************************************************************************
334  * USB Host
335  ******************************************************************************/
336 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
337 static int vpac270_ohci_init(struct device *dev)
338 {
339         UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
340         return 0;
341 }
342
343 static struct pxaohci_platform_data vpac270_ohci_info = {
344         .port_mode      = PMM_PERPORT_MODE,
345         .flags          = ENABLE_PORT1 | ENABLE_PORT2 |
346                         POWER_CONTROL_LOW | POWER_SENSE_LOW,
347         .init           = vpac270_ohci_init,
348 };
349
350 static void __init vpac270_uhc_init(void)
351 {
352         pxa_set_ohci_info(&vpac270_ohci_info);
353 }
354 #else
355 static inline void vpac270_uhc_init(void) {}
356 #endif
357
358 /******************************************************************************
359  * USB Gadget
360  ******************************************************************************/
361 #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
362 static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
363         .gpio_vbus              = GPIO41_VPAC270_UDC_DETECT,
364         .gpio_pullup            = -1,
365 };
366
367 static struct platform_device vpac270_gpio_vbus = {
368         .name   = "gpio-vbus",
369         .id     = -1,
370         .dev    = {
371                 .platform_data  = &vpac270_gpio_vbus_info,
372         },
373 };
374
375 static void vpac270_udc_command(int cmd)
376 {
377         if (cmd == PXA2XX_UDC_CMD_CONNECT)
378                 UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
379         else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
380                 UP2OCR = UP2OCR_HXOE;
381 }
382
383 static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
384         .udc_command            = vpac270_udc_command,
385         .gpio_pullup            = -1,
386 };
387
388 static void __init vpac270_udc_init(void)
389 {
390         pxa_set_udc_info(&vpac270_udc_info);
391         platform_device_register(&vpac270_gpio_vbus);
392 }
393 #else
394 static inline void vpac270_udc_init(void) {}
395 #endif
396
397 /******************************************************************************
398  * Ethernet
399  ******************************************************************************/
400 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
401 static struct resource vpac270_dm9000_resources[] = {
402         [0] = {
403                 .start  = PXA_CS2_PHYS + 0x300,
404                 .end    = PXA_CS2_PHYS + 0x303,
405                 .flags  = IORESOURCE_MEM,
406         },
407         [1] = {
408                 .start  = PXA_CS2_PHYS + 0x304,
409                 .end    = PXA_CS2_PHYS + 0x343,
410                 .flags  = IORESOURCE_MEM,
411         },
412         [2] = {
413                 .start  = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
414                 .end    = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
415                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
416         },
417 };
418
419 static struct dm9000_plat_data vpac270_dm9000_platdata = {
420         .flags          = DM9000_PLATF_32BITONLY,
421 };
422
423 static struct platform_device vpac270_dm9000_device = {
424         .name           = "dm9000",
425         .id             = -1,
426         .num_resources  = ARRAY_SIZE(vpac270_dm9000_resources),
427         .resource       = vpac270_dm9000_resources,
428         .dev            = {
429                 .platform_data = &vpac270_dm9000_platdata,
430         }
431 };
432
433 static void __init vpac270_eth_init(void)
434 {
435         platform_device_register(&vpac270_dm9000_device);
436 }
437 #else
438 static inline void vpac270_eth_init(void) {}
439 #endif
440
441 /******************************************************************************
442  * Audio and Touchscreen
443  ******************************************************************************/
444 #if     defined(CONFIG_TOUCHSCREEN_UCB1400) || \
445         defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
446 static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
447         .reset_gpio     = 95,
448 };
449
450 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
451         .irq            = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
452 };
453
454 static struct platform_device vpac270_ucb1400_device = {
455         .name           = "ucb1400_core",
456         .id             = -1,
457         .dev            = {
458                 .platform_data = &vpac270_ucb1400_pdata,
459         },
460 };
461
462 static void __init vpac270_ts_init(void)
463 {
464         pxa_set_ac97_info(&vpac270_ac97_pdata);
465         platform_device_register(&vpac270_ucb1400_device);
466 }
467 #else
468 static inline void vpac270_ts_init(void) {}
469 #endif
470
471 /******************************************************************************
472  * RTC
473  ******************************************************************************/
474 #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
475 static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
476         {
477                 I2C_BOARD_INFO("ds1339", 0x68),
478         },
479 };
480
481 static void __init vpac270_rtc_init(void)
482 {
483         i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
484 }
485 #else
486 static inline void vpac270_rtc_init(void) {}
487 #endif
488
489 /******************************************************************************
490  * Framebuffer
491  ******************************************************************************/
492 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
493 static struct pxafb_mode_info vpac270_lcd_modes[] = {
494 {
495         .pixclock       = 57692,
496         .xres           = 640,
497         .yres           = 480,
498         .bpp            = 32,
499         .depth          = 18,
500
501         .left_margin    = 144,
502         .right_margin   = 32,
503         .upper_margin   = 13,
504         .lower_margin   = 30,
505
506         .hsync_len      = 32,
507         .vsync_len      = 2,
508
509         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
510 }, {    /* CRT 640x480 */
511         .pixclock       = 35000,
512         .xres           = 640,
513         .yres           = 480,
514         .bpp            = 16,
515         .depth          = 16,
516
517         .left_margin    = 96,
518         .right_margin   = 48,
519         .upper_margin   = 33,
520         .lower_margin   = 10,
521
522         .hsync_len      = 48,
523         .vsync_len      = 1,
524
525         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
526 }, {    /* CRT 800x600 H=30kHz V=48HZ */
527         .pixclock       = 25000,
528         .xres           = 800,
529         .yres           = 600,
530         .bpp            = 16,
531         .depth          = 16,
532
533         .left_margin    = 50,
534         .right_margin   = 1,
535         .upper_margin   = 21,
536         .lower_margin   = 12,
537
538         .hsync_len      = 8,
539         .vsync_len      = 1,
540
541         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
542 }, {    /* CRT 1024x768 H=40kHz V=50Hz */
543         .pixclock       = 15000,
544         .xres           = 1024,
545         .yres           = 768,
546         .bpp            = 16,
547         .depth          = 16,
548
549         .left_margin    = 220,
550         .right_margin   = 8,
551         .upper_margin   = 33,
552         .lower_margin   = 2,
553
554         .hsync_len      = 48,
555         .vsync_len      = 1,
556
557         .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
558 }
559 };
560
561 static struct pxafb_mach_info vpac270_lcd_screen = {
562         .modes          = vpac270_lcd_modes,
563         .num_modes      = ARRAY_SIZE(vpac270_lcd_modes),
564         .lcd_conn       = LCD_COLOR_TFT_18BPP,
565 };
566
567 static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
568 {
569         gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
570 }
571
572 static void __init vpac270_lcd_init(void)
573 {
574         int ret;
575
576         ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
577         if (ret) {
578                 pr_err("Requesting BKL-ON GPIO failed!\n");
579                 goto err;
580         }
581
582         ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
583         if (ret) {
584                 pr_err("Setting BKL-ON GPIO direction failed!\n");
585                 goto err2;
586         }
587
588         vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
589         pxa_set_fb_info(NULL, &vpac270_lcd_screen);
590         return;
591
592 err2:
593         gpio_free(GPIO81_VPAC270_BKL_ON);
594 err:
595         return;
596 }
597 #else
598 static inline void vpac270_lcd_init(void) {}
599 #endif
600
601 /******************************************************************************
602  * PATA IDE
603  ******************************************************************************/
604 #if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
605 static struct pata_pxa_pdata vpac270_pata_pdata = {
606         .reg_shift      = 1,
607         .dma_dreq       = 1,
608         .irq_flags      = IRQF_TRIGGER_RISING,
609 };
610
611 static struct resource vpac270_ide_resources[] = {
612         [0] = { /* I/O Base address */
613                .start   = PXA_CS3_PHYS + 0x120,
614                .end     = PXA_CS3_PHYS + 0x13f,
615                .flags   = IORESOURCE_MEM
616         },
617         [1] = { /* CTL Base address */
618                .start   = PXA_CS3_PHYS + 0x15c,
619                .end     = PXA_CS3_PHYS + 0x15f,
620                .flags   = IORESOURCE_MEM
621         },
622         [2] = { /* DMA Base address */
623                .start   = PXA_CS3_PHYS + 0x20,
624                .end     = PXA_CS3_PHYS + 0x2f,
625                .flags   = IORESOURCE_DMA
626         },
627         [3] = { /* IDE IRQ pin */
628                .start   = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
629                .end     = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
630                .flags   = IORESOURCE_IRQ
631         }
632 };
633
634 static struct platform_device vpac270_ide_device = {
635         .name           = "pata_pxa",
636         .num_resources  = ARRAY_SIZE(vpac270_ide_resources),
637         .resource       = vpac270_ide_resources,
638         .dev            = {
639                 .platform_data  = &vpac270_pata_pdata,
640                 .coherent_dma_mask      = 0xffffffff,
641         }
642 };
643
644 static void __init vpac270_ide_init(void)
645 {
646         platform_device_register(&vpac270_ide_device);
647 }
648 #else
649 static inline void vpac270_ide_init(void) {}
650 #endif
651
652 /******************************************************************************
653  * Core power regulator
654  ******************************************************************************/
655 #if defined(CONFIG_REGULATOR_MAX1586) || \
656     defined(CONFIG_REGULATOR_MAX1586_MODULE)
657 static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
658         REGULATOR_SUPPLY("vcc_core", NULL),
659 };
660
661 static struct regulator_init_data vpac270_max1587a_v3_info = {
662         .constraints = {
663                 .name           = "vcc_core range",
664                 .min_uV         = 900000,
665                 .max_uV         = 1705000,
666                 .always_on      = 1,
667                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
668         },
669         .consumer_supplies      = vpac270_max1587a_consumers,
670         .num_consumer_supplies  = ARRAY_SIZE(vpac270_max1587a_consumers),
671 };
672
673 static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
674         {
675                 .name           = "vcc_core",
676                 .id             = MAX1586_V3,
677                 .platform_data  = &vpac270_max1587a_v3_info,
678         }
679 };
680
681 static struct max1586_platform_data vpac270_max1587a_info = {
682         .subdevs     = vpac270_max1587a_subdevs,
683         .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
684         .v3_gain     = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
685 };
686
687 static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
688         {
689                 I2C_BOARD_INFO("max1586", 0x14),
690                 .platform_data  = &vpac270_max1587a_info,
691         },
692 };
693
694 static void __init vpac270_pmic_init(void)
695 {
696         i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
697 }
698 #else
699 static inline void vpac270_pmic_init(void) {}
700 #endif
701
702
703 /******************************************************************************
704  * Machine init
705  ******************************************************************************/
706 static void __init vpac270_init(void)
707 {
708         pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
709
710         pxa_set_ffuart_info(NULL);
711         pxa_set_btuart_info(NULL);
712         pxa_set_stuart_info(NULL);
713         pxa_set_i2c_info(NULL);
714         pxa27x_set_i2c_power_info(NULL);
715
716         vpac270_pmic_init();
717         vpac270_lcd_init();
718         vpac270_mmc_init();
719         vpac270_nor_init();
720         vpac270_onenand_init();
721         vpac270_leds_init();
722         vpac270_keys_init();
723         vpac270_uhc_init();
724         vpac270_udc_init();
725         vpac270_eth_init();
726         vpac270_ts_init();
727         vpac270_rtc_init();
728         vpac270_ide_init();
729
730         regulator_has_full_constraints();
731 }
732
733 MACHINE_START(VPAC270, "Voipac PXA270")
734         .atag_offset    = 0x100,
735         .map_io         = pxa27x_map_io,
736         .nr_irqs        = PXA_NR_IRQS,
737         .init_irq       = pxa27x_init_irq,
738         .handle_irq     = pxa27x_handle_irq,
739         .init_time      = pxa_timer_init,
740         .init_machine   = vpac270_init,
741         .restart        = pxa_restart,
742 MACHINE_END