Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Hardware definitions for Voipac PXA270
0004  *
0005  * Copyright (C) 2010
0006  * Marek Vasut <marek.vasut@gmail.com>
0007  */
0008 
0009 #include <linux/platform_device.h>
0010 #include <linux/delay.h>
0011 #include <linux/irq.h>
0012 #include <linux/gpio_keys.h>
0013 #include <linux/input.h>
0014 #include <linux/leds.h>
0015 #include <linux/gpio.h>
0016 #include <linux/gpio/machine.h>
0017 #include <linux/mtd/mtd.h>
0018 #include <linux/mtd/partitions.h>
0019 #include <linux/mtd/physmap.h>
0020 #include <linux/mtd/onenand.h>
0021 #include <linux/dm9000.h>
0022 #include <linux/ucb1400.h>
0023 #include <linux/ata_platform.h>
0024 #include <linux/regulator/machine.h>
0025 #include <linux/regulator/max1586.h>
0026 #include <linux/platform_data/i2c-pxa.h>
0027 
0028 #include <asm/mach-types.h>
0029 #include <asm/mach/arch.h>
0030 
0031 #include "pxa27x.h"
0032 #include <linux/platform_data/asoc-pxa.h>
0033 #include "vpac270.h"
0034 #include <linux/platform_data/mmc-pxamci.h>
0035 #include <linux/platform_data/video-pxafb.h>
0036 #include <linux/platform_data/usb-ohci-pxa27x.h>
0037 #include "pxa27x-udc.h"
0038 #include "udc.h"
0039 #include <linux/platform_data/ata-pxa.h>
0040 
0041 #include "generic.h"
0042 #include "devices.h"
0043 
0044 /******************************************************************************
0045  * Pin configuration
0046  ******************************************************************************/
0047 static unsigned long vpac270_pin_config[] __initdata = {
0048     /* MMC */
0049     GPIO32_MMC_CLK,
0050     GPIO92_MMC_DAT_0,
0051     GPIO109_MMC_DAT_1,
0052     GPIO110_MMC_DAT_2,
0053     GPIO111_MMC_DAT_3,
0054     GPIO112_MMC_CMD,
0055     GPIO53_GPIO,    /* SD detect */
0056     GPIO52_GPIO,    /* SD r/o switch */
0057 
0058     /* GPIO KEYS */
0059     GPIO1_GPIO, /* USER BTN */
0060 
0061     /* LEDs */
0062     GPIO15_GPIO,    /* orange led */
0063 
0064     /* FFUART */
0065     GPIO34_FFUART_RXD,
0066     GPIO39_FFUART_TXD,
0067     GPIO27_FFUART_RTS,
0068     GPIO100_FFUART_CTS,
0069     GPIO33_FFUART_DSR,
0070     GPIO40_FFUART_DTR,
0071     GPIO10_FFUART_DCD,
0072     GPIO38_FFUART_RI,
0073 
0074     /* LCD */
0075     GPIO58_LCD_LDD_0,
0076     GPIO59_LCD_LDD_1,
0077     GPIO60_LCD_LDD_2,
0078     GPIO61_LCD_LDD_3,
0079     GPIO62_LCD_LDD_4,
0080     GPIO63_LCD_LDD_5,
0081     GPIO64_LCD_LDD_6,
0082     GPIO65_LCD_LDD_7,
0083     GPIO66_LCD_LDD_8,
0084     GPIO67_LCD_LDD_9,
0085     GPIO68_LCD_LDD_10,
0086     GPIO69_LCD_LDD_11,
0087     GPIO70_LCD_LDD_12,
0088     GPIO71_LCD_LDD_13,
0089     GPIO72_LCD_LDD_14,
0090     GPIO73_LCD_LDD_15,
0091     GPIO86_LCD_LDD_16,
0092     GPIO87_LCD_LDD_17,
0093     GPIO74_LCD_FCLK,
0094     GPIO75_LCD_LCLK,
0095     GPIO76_LCD_PCLK,
0096     GPIO77_LCD_BIAS,
0097 
0098     /* PCMCIA */
0099     GPIO48_nPOE,
0100     GPIO49_nPWE,
0101     GPIO50_nPIOR,
0102     GPIO51_nPIOW,
0103     GPIO85_nPCE_1,
0104     GPIO54_nPCE_2,
0105     GPIO55_nPREG,
0106     GPIO57_nIOIS16,
0107     GPIO56_nPWAIT,
0108     GPIO104_PSKTSEL,
0109     GPIO84_GPIO,    /* PCMCIA CD */
0110     GPIO35_GPIO,    /* PCMCIA RDY */
0111     GPIO107_GPIO,   /* PCMCIA PPEN */
0112     GPIO11_GPIO,    /* PCMCIA RESET */
0113     GPIO17_GPIO,    /* CF CD */
0114     GPIO12_GPIO,    /* CF RDY */
0115     GPIO16_GPIO,    /* CF RESET */
0116 
0117     /* UHC */
0118     GPIO88_USBH1_PWR,
0119     GPIO89_USBH1_PEN,
0120     GPIO119_USBH2_PWR,
0121     GPIO120_USBH2_PEN,
0122 
0123     /* UDC */
0124     GPIO41_GPIO,
0125 
0126     /* Ethernet */
0127     GPIO114_GPIO,   /* IRQ */
0128 
0129     /* AC97 */
0130     GPIO28_AC97_BITCLK,
0131     GPIO29_AC97_SDATA_IN_0,
0132     GPIO30_AC97_SDATA_OUT,
0133     GPIO31_AC97_SYNC,
0134     GPIO95_AC97_nRESET,
0135     GPIO98_AC97_SYSCLK,
0136     GPIO113_GPIO,   /* TS IRQ */
0137 
0138     /* I2C */
0139     GPIO117_I2C_SCL,
0140     GPIO118_I2C_SDA,
0141 
0142     /* IDE */
0143     GPIO36_GPIO,    /* IDE IRQ */
0144     GPIO80_DREQ_1,
0145 };
0146 
0147 /******************************************************************************
0148  * NOR Flash
0149  ******************************************************************************/
0150 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
0151 static struct mtd_partition vpac270_nor_partitions[] = {
0152     {
0153         .name       = "Flash",
0154         .offset     = 0x00000000,
0155         .size       = MTDPART_SIZ_FULL,
0156     }
0157 };
0158 
0159 static struct physmap_flash_data vpac270_flash_data[] = {
0160     {
0161         .width      = 2,    /* bankwidth in bytes */
0162         .parts      = vpac270_nor_partitions,
0163         .nr_parts   = ARRAY_SIZE(vpac270_nor_partitions)
0164     }
0165 };
0166 
0167 static struct resource vpac270_flash_resource = {
0168     .start  = PXA_CS0_PHYS,
0169     .end    = PXA_CS0_PHYS + SZ_64M - 1,
0170     .flags  = IORESOURCE_MEM,
0171 };
0172 
0173 static struct platform_device vpac270_flash = {
0174     .name       = "physmap-flash",
0175     .id     = 0,
0176     .resource   = &vpac270_flash_resource,
0177     .num_resources  = 1,
0178     .dev        = {
0179         .platform_data = vpac270_flash_data,
0180     },
0181 };
0182 static void __init vpac270_nor_init(void)
0183 {
0184     platform_device_register(&vpac270_flash);
0185 }
0186 #else
0187 static inline void vpac270_nor_init(void) {}
0188 #endif
0189 
0190 /******************************************************************************
0191  * OneNAND Flash
0192  ******************************************************************************/
0193 #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
0194 static struct mtd_partition vpac270_onenand_partitions[] = {
0195     {
0196         .name       = "Flash",
0197         .offset     = 0x00000000,
0198         .size       = MTDPART_SIZ_FULL,
0199     }
0200 };
0201 
0202 static struct onenand_platform_data vpac270_onenand_info = {
0203     .parts      = vpac270_onenand_partitions,
0204     .nr_parts   = ARRAY_SIZE(vpac270_onenand_partitions),
0205 };
0206 
0207 static struct resource vpac270_onenand_resources[] = {
0208     [0] = {
0209         .start  = PXA_CS0_PHYS,
0210         .end    = PXA_CS0_PHYS + SZ_1M,
0211         .flags  = IORESOURCE_MEM,
0212     },
0213 };
0214 
0215 static struct platform_device vpac270_onenand = {
0216     .name       = "onenand-flash",
0217     .id     = -1,
0218     .resource   = vpac270_onenand_resources,
0219     .num_resources  = ARRAY_SIZE(vpac270_onenand_resources),
0220     .dev        = {
0221         .platform_data  = &vpac270_onenand_info,
0222     },
0223 };
0224 
0225 static void __init vpac270_onenand_init(void)
0226 {
0227     platform_device_register(&vpac270_onenand);
0228 }
0229 #else
0230 static void __init vpac270_onenand_init(void) {}
0231 #endif
0232 
0233 /******************************************************************************
0234  * SD/MMC card controller
0235  ******************************************************************************/
0236 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
0237 static struct pxamci_platform_data vpac270_mci_platform_data = {
0238     .ocr_mask       = MMC_VDD_32_33 | MMC_VDD_33_34,
0239     .detect_delay_ms    = 200,
0240 };
0241 
0242 static struct gpiod_lookup_table vpac270_mci_gpio_table = {
0243     .dev_id = "pxa2xx-mci.0",
0244     .table = {
0245         GPIO_LOOKUP("gpio-pxa", GPIO53_VPAC270_SD_DETECT_N,
0246                 "cd", GPIO_ACTIVE_LOW),
0247         GPIO_LOOKUP("gpio-pxa", GPIO52_VPAC270_SD_READONLY,
0248                 "wp", GPIO_ACTIVE_LOW),
0249         { },
0250     },
0251 };
0252 
0253 static void __init vpac270_mmc_init(void)
0254 {
0255     gpiod_add_lookup_table(&vpac270_mci_gpio_table);
0256     pxa_set_mci_info(&vpac270_mci_platform_data);
0257 }
0258 #else
0259 static inline void vpac270_mmc_init(void) {}
0260 #endif
0261 
0262 /******************************************************************************
0263  * GPIO keys
0264  ******************************************************************************/
0265 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
0266 static struct gpio_keys_button vpac270_pxa_buttons[] = {
0267     {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
0268 };
0269 
0270 static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
0271     .buttons    = vpac270_pxa_buttons,
0272     .nbuttons   = ARRAY_SIZE(vpac270_pxa_buttons),
0273 };
0274 
0275 static struct platform_device vpac270_pxa_keys = {
0276     .name   = "gpio-keys",
0277     .id = -1,
0278     .dev    = {
0279         .platform_data = &vpac270_pxa_keys_data,
0280     },
0281 };
0282 
0283 static void __init vpac270_keys_init(void)
0284 {
0285     platform_device_register(&vpac270_pxa_keys);
0286 }
0287 #else
0288 static inline void vpac270_keys_init(void) {}
0289 #endif
0290 
0291 /******************************************************************************
0292  * LED
0293  ******************************************************************************/
0294 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
0295 struct gpio_led vpac270_gpio_leds[] = {
0296 {
0297     .name           = "vpac270:orange:user",
0298     .default_trigger    = "none",
0299     .gpio           = GPIO15_VPAC270_LED_ORANGE,
0300     .active_low     = 1,
0301 }
0302 };
0303 
0304 static struct gpio_led_platform_data vpac270_gpio_led_info = {
0305     .leds       = vpac270_gpio_leds,
0306     .num_leds   = ARRAY_SIZE(vpac270_gpio_leds),
0307 };
0308 
0309 static struct platform_device vpac270_leds = {
0310     .name   = "leds-gpio",
0311     .id = -1,
0312     .dev    = {
0313         .platform_data  = &vpac270_gpio_led_info,
0314     }
0315 };
0316 
0317 static void __init vpac270_leds_init(void)
0318 {
0319     platform_device_register(&vpac270_leds);
0320 }
0321 #else
0322 static inline void vpac270_leds_init(void) {}
0323 #endif
0324 
0325 /******************************************************************************
0326  * USB Host
0327  ******************************************************************************/
0328 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
0329 static int vpac270_ohci_init(struct device *dev)
0330 {
0331     UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
0332     return 0;
0333 }
0334 
0335 static struct pxaohci_platform_data vpac270_ohci_info = {
0336     .port_mode  = PMM_PERPORT_MODE,
0337     .flags      = ENABLE_PORT1 | ENABLE_PORT2 |
0338             POWER_CONTROL_LOW | POWER_SENSE_LOW,
0339     .init       = vpac270_ohci_init,
0340 };
0341 
0342 static void __init vpac270_uhc_init(void)
0343 {
0344     pxa_set_ohci_info(&vpac270_ohci_info);
0345 }
0346 #else
0347 static inline void vpac270_uhc_init(void) {}
0348 #endif
0349 
0350 /******************************************************************************
0351  * USB Gadget
0352  ******************************************************************************/
0353 #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
0354 static struct gpiod_lookup_table vpac270_gpio_vbus_gpiod_table = {
0355     .dev_id = "gpio-vbus",
0356     .table = {
0357         GPIO_LOOKUP("gpio-pxa", GPIO41_VPAC270_UDC_DETECT,
0358                 "vbus", GPIO_ACTIVE_HIGH),
0359         { },
0360     },
0361 };
0362 
0363 static struct platform_device vpac270_gpio_vbus = {
0364     .name   = "gpio-vbus",
0365     .id = -1,
0366 };
0367 
0368 static void vpac270_udc_command(int cmd)
0369 {
0370     if (cmd == PXA2XX_UDC_CMD_CONNECT)
0371         UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
0372     else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
0373         UP2OCR = UP2OCR_HXOE;
0374 }
0375 
0376 static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
0377     .udc_command        = vpac270_udc_command,
0378     .gpio_pullup        = -1,
0379 };
0380 
0381 static void __init vpac270_udc_init(void)
0382 {
0383     pxa_set_udc_info(&vpac270_udc_info);
0384     gpiod_add_lookup_table(&vpac270_gpio_vbus_gpiod_table);
0385     platform_device_register(&vpac270_gpio_vbus);
0386 }
0387 #else
0388 static inline void vpac270_udc_init(void) {}
0389 #endif
0390 
0391 /******************************************************************************
0392  * Ethernet
0393  ******************************************************************************/
0394 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
0395 static struct resource vpac270_dm9000_resources[] = {
0396     [0] = {
0397         .start  = PXA_CS2_PHYS + 0x300,
0398         .end    = PXA_CS2_PHYS + 0x303,
0399         .flags  = IORESOURCE_MEM,
0400     },
0401     [1] = {
0402         .start  = PXA_CS2_PHYS + 0x304,
0403         .end    = PXA_CS2_PHYS + 0x343,
0404         .flags  = IORESOURCE_MEM,
0405     },
0406     [2] = {
0407         .start  = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
0408         .end    = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
0409         .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
0410     },
0411 };
0412 
0413 static struct dm9000_plat_data vpac270_dm9000_platdata = {
0414     .flags      = DM9000_PLATF_32BITONLY,
0415 };
0416 
0417 static struct platform_device vpac270_dm9000_device = {
0418     .name       = "dm9000",
0419     .id     = -1,
0420     .num_resources  = ARRAY_SIZE(vpac270_dm9000_resources),
0421     .resource   = vpac270_dm9000_resources,
0422     .dev        = {
0423         .platform_data = &vpac270_dm9000_platdata,
0424     }
0425 };
0426 
0427 static void __init vpac270_eth_init(void)
0428 {
0429     platform_device_register(&vpac270_dm9000_device);
0430 }
0431 #else
0432 static inline void vpac270_eth_init(void) {}
0433 #endif
0434 
0435 /******************************************************************************
0436  * Audio and Touchscreen
0437  ******************************************************************************/
0438 #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
0439     defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
0440 static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
0441     .reset_gpio = 95,
0442 };
0443 
0444 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
0445     .irq        = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
0446 };
0447 
0448 static struct platform_device vpac270_ucb1400_device = {
0449     .name       = "ucb1400_core",
0450     .id     = -1,
0451     .dev        = {
0452         .platform_data = &vpac270_ucb1400_pdata,
0453     },
0454 };
0455 
0456 static void __init vpac270_ts_init(void)
0457 {
0458     pxa_set_ac97_info(&vpac270_ac97_pdata);
0459     platform_device_register(&vpac270_ucb1400_device);
0460 }
0461 #else
0462 static inline void vpac270_ts_init(void) {}
0463 #endif
0464 
0465 /******************************************************************************
0466  * RTC
0467  ******************************************************************************/
0468 #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
0469 static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
0470     {
0471         I2C_BOARD_INFO("ds1339", 0x68),
0472     },
0473 };
0474 
0475 static void __init vpac270_rtc_init(void)
0476 {
0477     i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
0478 }
0479 #else
0480 static inline void vpac270_rtc_init(void) {}
0481 #endif
0482 
0483 /******************************************************************************
0484  * Framebuffer
0485  ******************************************************************************/
0486 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
0487 static struct pxafb_mode_info vpac270_lcd_modes[] = {
0488 {
0489     .pixclock   = 57692,
0490     .xres       = 640,
0491     .yres       = 480,
0492     .bpp        = 32,
0493     .depth      = 18,
0494 
0495     .left_margin    = 144,
0496     .right_margin   = 32,
0497     .upper_margin   = 13,
0498     .lower_margin   = 30,
0499 
0500     .hsync_len  = 32,
0501     .vsync_len  = 2,
0502 
0503     .sync       = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
0504 }, {    /* CRT 640x480 */
0505     .pixclock   = 35000,
0506     .xres       = 640,
0507     .yres       = 480,
0508     .bpp        = 16,
0509     .depth      = 16,
0510 
0511     .left_margin    = 96,
0512     .right_margin   = 48,
0513     .upper_margin   = 33,
0514     .lower_margin   = 10,
0515 
0516     .hsync_len  = 48,
0517     .vsync_len  = 1,
0518 
0519     .sync       = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
0520 }, {    /* CRT 800x600 H=30kHz V=48HZ */
0521     .pixclock   = 25000,
0522     .xres       = 800,
0523     .yres       = 600,
0524     .bpp        = 16,
0525     .depth      = 16,
0526 
0527     .left_margin    = 50,
0528     .right_margin   = 1,
0529     .upper_margin   = 21,
0530     .lower_margin   = 12,
0531 
0532     .hsync_len  = 8,
0533     .vsync_len  = 1,
0534 
0535     .sync       = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
0536 }, {    /* CRT 1024x768 H=40kHz V=50Hz */
0537     .pixclock   = 15000,
0538     .xres       = 1024,
0539     .yres       = 768,
0540     .bpp        = 16,
0541     .depth      = 16,
0542 
0543     .left_margin    = 220,
0544     .right_margin   = 8,
0545     .upper_margin   = 33,
0546     .lower_margin   = 2,
0547 
0548     .hsync_len  = 48,
0549     .vsync_len  = 1,
0550 
0551     .sync       = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
0552 }
0553 };
0554 
0555 static struct pxafb_mach_info vpac270_lcd_screen = {
0556     .modes      = vpac270_lcd_modes,
0557     .num_modes  = ARRAY_SIZE(vpac270_lcd_modes),
0558     .lcd_conn   = LCD_COLOR_TFT_18BPP,
0559 };
0560 
0561 static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
0562 {
0563     gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
0564 }
0565 
0566 static void __init vpac270_lcd_init(void)
0567 {
0568     int ret;
0569 
0570     ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
0571     if (ret) {
0572         pr_err("Requesting BKL-ON GPIO failed!\n");
0573         goto err;
0574     }
0575 
0576     ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
0577     if (ret) {
0578         pr_err("Setting BKL-ON GPIO direction failed!\n");
0579         goto err2;
0580     }
0581 
0582     vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
0583     pxa_set_fb_info(NULL, &vpac270_lcd_screen);
0584     return;
0585 
0586 err2:
0587     gpio_free(GPIO81_VPAC270_BKL_ON);
0588 err:
0589     return;
0590 }
0591 #else
0592 static inline void vpac270_lcd_init(void) {}
0593 #endif
0594 
0595 /******************************************************************************
0596  * PATA IDE
0597  ******************************************************************************/
0598 #if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
0599 static struct pata_pxa_pdata vpac270_pata_pdata = {
0600     .reg_shift  = 1,
0601     .dma_dreq   = 1,
0602     .irq_flags  = IRQF_TRIGGER_RISING,
0603 };
0604 
0605 static struct resource vpac270_ide_resources[] = {
0606     [0] = { /* I/O Base address */
0607            .start   = PXA_CS3_PHYS + 0x120,
0608            .end = PXA_CS3_PHYS + 0x13f,
0609            .flags   = IORESOURCE_MEM
0610     },
0611     [1] = { /* CTL Base address */
0612            .start   = PXA_CS3_PHYS + 0x15c,
0613            .end = PXA_CS3_PHYS + 0x15f,
0614            .flags   = IORESOURCE_MEM
0615     },
0616     [2] = { /* DMA Base address */
0617            .start   = PXA_CS3_PHYS + 0x20,
0618            .end = PXA_CS3_PHYS + 0x2f,
0619            .flags   = IORESOURCE_DMA
0620     },
0621     [3] = { /* IDE IRQ pin */
0622            .start   = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
0623            .end = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
0624            .flags   = IORESOURCE_IRQ
0625     }
0626 };
0627 
0628 static struct platform_device vpac270_ide_device = {
0629     .name       = "pata_pxa",
0630     .num_resources  = ARRAY_SIZE(vpac270_ide_resources),
0631     .resource   = vpac270_ide_resources,
0632     .dev        = {
0633         .platform_data  = &vpac270_pata_pdata,
0634         .coherent_dma_mask  = 0xffffffff,
0635     }
0636 };
0637 
0638 static void __init vpac270_ide_init(void)
0639 {
0640     platform_device_register(&vpac270_ide_device);
0641 }
0642 #else
0643 static inline void vpac270_ide_init(void) {}
0644 #endif
0645 
0646 /******************************************************************************
0647  * Core power regulator
0648  ******************************************************************************/
0649 #if defined(CONFIG_REGULATOR_MAX1586) || \
0650     defined(CONFIG_REGULATOR_MAX1586_MODULE)
0651 static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
0652     REGULATOR_SUPPLY("vcc_core", NULL),
0653 };
0654 
0655 static struct regulator_init_data vpac270_max1587a_v3_info = {
0656     .constraints = {
0657         .name       = "vcc_core range",
0658         .min_uV     = 900000,
0659         .max_uV     = 1705000,
0660         .always_on  = 1,
0661         .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
0662     },
0663     .consumer_supplies  = vpac270_max1587a_consumers,
0664     .num_consumer_supplies  = ARRAY_SIZE(vpac270_max1587a_consumers),
0665 };
0666 
0667 static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
0668     {
0669         .name       = "vcc_core",
0670         .id     = MAX1586_V3,
0671         .platform_data  = &vpac270_max1587a_v3_info,
0672     }
0673 };
0674 
0675 static struct max1586_platform_data vpac270_max1587a_info = {
0676     .subdevs     = vpac270_max1587a_subdevs,
0677     .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
0678     .v3_gain     = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
0679 };
0680 
0681 static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
0682     {
0683         I2C_BOARD_INFO("max1586", 0x14),
0684         .platform_data  = &vpac270_max1587a_info,
0685     },
0686 };
0687 
0688 static void __init vpac270_pmic_init(void)
0689 {
0690     i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
0691 }
0692 #else
0693 static inline void vpac270_pmic_init(void) {}
0694 #endif
0695 
0696 
0697 /******************************************************************************
0698  * Machine init
0699  ******************************************************************************/
0700 static void __init vpac270_init(void)
0701 {
0702     pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
0703 
0704     pxa_set_ffuart_info(NULL);
0705     pxa_set_btuart_info(NULL);
0706     pxa_set_stuart_info(NULL);
0707     pxa_set_i2c_info(NULL);
0708     pxa27x_set_i2c_power_info(NULL);
0709 
0710     vpac270_pmic_init();
0711     vpac270_lcd_init();
0712     vpac270_mmc_init();
0713     vpac270_nor_init();
0714     vpac270_onenand_init();
0715     vpac270_leds_init();
0716     vpac270_keys_init();
0717     vpac270_uhc_init();
0718     vpac270_udc_init();
0719     vpac270_eth_init();
0720     vpac270_ts_init();
0721     vpac270_rtc_init();
0722     vpac270_ide_init();
0723 
0724     regulator_has_full_constraints();
0725 }
0726 
0727 MACHINE_START(VPAC270, "Voipac PXA270")
0728     .atag_offset    = 0x100,
0729     .map_io     = pxa27x_map_io,
0730     .nr_irqs    = PXA_NR_IRQS,
0731     .init_irq   = pxa27x_init_irq,
0732     .handle_irq = pxa27x_handle_irq,
0733     .init_time  = pxa_timer_init,
0734     .init_machine   = vpac270_init,
0735     .restart    = pxa_restart,
0736 MACHINE_END