static void __init zylonite_init(void) { pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); /* board-processor specific initialization */ zylonite_pxa300_init(); zylonite_pxa320_init(); /* * Note: We depend that the bootloader set * the correct value to MSC register for SMC91x. */ smc91x_resources[1].start = PXA_GPIO_TO_IRQ(gpio_eth_irq); smc91x_resources[1].end = PXA_GPIO_TO_IRQ(gpio_eth_irq); platform_device_register(&smc91x_device); pxa_set_ac97_info(NULL); zylonite_init_lcd(); zylonite_init_mmc(); zylonite_init_keypad(); zylonite_init_nand(); zylonite_init_leds(); zylonite_init_ohci(); zylonite_init_wm9713_audio(); }
static int sharpsl_pm_remove(struct platform_device *pdev) { suspend_set_ops(NULL); device_remove_file(&pdev->dev, &dev_attr_battery_percentage); device_remove_file(&pdev->dev, &dev_attr_battery_voltage); led_trigger_unregister_simple(sharpsl_charge_led_trigger); free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); if (sharpsl_pm.machinfo->gpio_fatal) free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); if (sharpsl_pm.machinfo->batfull_irq) free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); gpio_free(sharpsl_pm.machinfo->gpio_batlock); gpio_free(sharpsl_pm.machinfo->gpio_batfull); gpio_free(sharpsl_pm.machinfo->gpio_acin); if (sharpsl_pm.machinfo->exit) sharpsl_pm.machinfo->exit(); del_timer_sync(&sharpsl_pm.chrg_full_timer); del_timer_sync(&sharpsl_pm.ac_timer); return 0; }
static void __init lpd270_init_irq(void) { int irq; pxa27x_init_irq(); __raw_writew(0, LPD270_INT_MASK); __raw_writew(0, LPD270_INT_STATUS); for (irq = LPD270_IRQ(2); irq <= LPD270_IRQ(4); irq++) { irq_set_chip_and_handler(irq, &lpd270_irq_chip, handle_level_irq); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler); irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING); }
static void __init mainstone_init_irq(void) { int irq; pxa27x_init_irq(); /* setup extra Mainstone irqs */ for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) { irq_set_chip_and_handler(irq, &mainstone_irq_chip, handle_level_irq); if (irq == MAINSTONE_IRQ(10) || irq == MAINSTONE_IRQ(14)) set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN); else set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } set_irq_flags(MAINSTONE_IRQ(8), 0); set_irq_flags(MAINSTONE_IRQ(12), 0); MST_INTMSKENA = 0; MST_INTSETCLR = 0; irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), mainstone_irq_handler); irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING); }
/* * The card detect interrupt isn't debounced so we delay it by 250ms * to give the card a chance to fully insert / eject. */ static int stargate2_mci_init(struct device *dev, irq_handler_t stargate2_detect_int, void *data) { int err; err = gpio_request(SG2_SD_POWER_ENABLE, "SG2_sd_power_enable"); if (err) { printk(KERN_ERR "Can't get the gpio for SD power control"); goto return_err; } gpio_direction_output(SG2_SD_POWER_ENABLE, 0); err = gpio_request(SG2_GPIO_nSD_DETECT, "SG2_sd_detect"); if (err) { printk(KERN_ERR "Can't get the sd detect gpio"); goto free_power_en; } gpio_direction_input(SG2_GPIO_nSD_DETECT); err = request_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT), stargate2_detect_int, IRQ_TYPE_EDGE_BOTH, "MMC card detect", data); if (err) { printk(KERN_ERR "can't request MMC card detect IRQ\n"); goto free_nsd_detect; } return 0; free_nsd_detect: gpio_free(SG2_GPIO_nSD_DETECT); free_power_en: gpio_free(SG2_SD_POWER_ENABLE); return_err: return err; }
{ gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL); gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL); gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0); gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0); } /* TMIO controller uses the same resources on all e-series machines. */ struct resource eseries_tmio_resources[] = { [0] = { .start = PXA_CS4_PHYS, .end = PXA_CS4_PHYS + 0x1fffff, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ), .flags = IORESOURCE_IRQ, }, }; /* Some e-series hardware cannot control the 32K clock */ static void clk_32k_dummy(struct clk *clk) { } static const struct clkops clk_32k_dummy_ops = { .enable = clk_32k_dummy, .disable = clk_32k_dummy, };
.gpio_cs = CORGI_GPIO_LCDCON_CS, }; static struct pxa2xx_spi_chip corgi_max1111_chip = { .gpio_cs = CORGI_GPIO_MAX1111_CS, }; static struct spi_board_info corgi_spi_devices[] = { { .modalias = "ads7846", .max_speed_hz = 1200000, .bus_num = 1, .chip_select = 0, .platform_data = &corgi_ads7846_info, .controller_data= &corgi_ads7846_chip, .irq = PXA_GPIO_TO_IRQ(CORGI_GPIO_TP_INT), }, { .modalias = "corgi-lcd", .max_speed_hz = 50000, .bus_num = 1, .chip_select = 1, .platform_data = &corgi_lcdcon_info, .controller_data= &corgi_lcdcon_chip, }, { .modalias = "max1111", .max_speed_hz = 450000, .bus_num = 1, .chip_select = 2, .controller_data= &corgi_max1111_chip, }, };
.end = 0x4020001f, .flags = IORESOURCE_MEM, }, { .start = 0x40700000, .end = 0x4070001f, .flags = IORESOURCE_MEM, }, }; static struct plat_serial8250_port serial_platform_data[] = { /* External UARTs */ /* FIXME: Shared IRQs on COM1-COM4 will not work properly on v1i1 hardware. */ { /* COM1 */ .mapbase = 0x10000000, .irq = PXA_GPIO_TO_IRQ(ZEUS_UARTA_GPIO), .irqflags = IRQF_TRIGGER_RISING, .uartclk = 14745600, .regshift = 1, .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, .iotype = UPIO_MEM, }, { /* COM2 */ .mapbase = 0x10800000, .irq = PXA_GPIO_TO_IRQ(ZEUS_UARTB_GPIO), .irqflags = IRQF_TRIGGER_RISING, .uartclk = 14745600, .regshift = 1, .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, .iotype = UPIO_MEM, },
GPIO35_GPIO | MFP_LPM_PULL_LOW, GPIO36_GPIO | MFP_LPM_DRIVE_HIGH, }; /* * SMSC LAN9220 Ethernet */ static struct resource smc91x_resources[] = { { .start = PXA3xx_CS2_PHYS, .end = PXA3xx_CS2_PHYS + 0xfffff, .flags = IORESOURCE_MEM, }, { .start = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ), .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, } }; static struct smsc911x_platform_config raumfeld_smsc911x_config = { .phy_interface = PHY_INTERFACE_MODE_MII, .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, }; static struct platform_device smc91x_device = { .name = "smsc911x", .id = -1,
/* GPIOD: input GPIOs, CF */ ASIC3_GPIOD11_nCIOIS16, ASIC3_GPIOD12_nCWAIT, ASIC3_GPIOD15_nPIOW, }; static struct resource asic3_resources[] = { /* GPIO part */ [0] = { .start = ASIC3_PHYS, .end = ASIC3_PHYS + ASIC3_MAP_SIZE_16BIT - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ), .flags = IORESOURCE_IRQ, }, /* SD part */ [2] = { .start = ASIC3_SD_PHYS, .end = ASIC3_SD_PHYS + ASIC3_MAP_SIZE_16BIT - 1, .flags = IORESOURCE_MEM, }, [3] = { .start = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ), .flags = IORESOURCE_IRQ, }, };
GPIO107_UART3_CTS, GPIO108_UART3_RTS, GPIO109_UART3_TXD, GPIO110_UART3_RXD, }; static struct resource smc91x_resources[] = { [0] = { .start = (LITTLETON_ETH_PHYS + 0x300), .end = (LITTLETON_ETH_PHYS + 0xfffff), .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, } }; static struct smc91x_platdata littleton_smc91x_info = { .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_USE_DMA, }; static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources,
.touch = &evb3_touch, .backlight = &evb3_backlight[0], .led = &evb3_led[0], .companion_addr = 0x10, .irq_mode = 0, .irq_base = IRQ_BOARD_START, .i2c_port = GI2C_PORT, }; static struct i2c_board_info evb3_i2c_info[] = { { .type = "88PM860x", .addr = 0x34, .platform_data = &evb3_pm8607_info, .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO83)), }, }; static void __init evb3_init_i2c(void) { pxa_set_i2c_info(NULL); i2c_register_board_info(0, ARRAY_AND_SIZE(evb3_i2c_info)); } #else static inline void evb3_init_i2c(void) {} #endif static void __init evb3_init(void) { /* initialize MFP configurations */
{ gpio_set_value(GPIO9_CHARGE_EN, (flags == PDA_POWER_CHARGE_USB)); } static struct pda_power_pdata power_pdata = { .is_ac_online = is_ac_connected, .is_usb_online = is_usb_connected, .set_charge = mioa701_set_charge, .supplied_to = supplicants, .num_supplicants = ARRAY_SIZE(supplicants), }; static struct resource power_resources[] = { [0] = { .name = "ac", .start = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT), .end = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE, }, [1] = { .name = "usb", .start = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT), .end = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE, }, }; static struct platform_device power_dev = { .name = "pda-power",
DF_IO12_ND_IO12, DF_IO13_ND_IO13, DF_IO14_ND_IO14, DF_IO15_ND_IO15, }; #define SAAR_ETH_PHYS (0x14000000) static struct resource smc91x_resources[] = { [0] = { .start = (SAAR_ETH_PHYS + 0x300), .end = (SAAR_ETH_PHYS + 0xfffff), .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO97)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO97)), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, } }; static struct smc91x_platdata saar_smc91x_info = { .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_USE_DMA, }; static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, .dev = {
.gpio_pendown = GPIO58_HX4700_TSC2046_nPENIRQ, }; static struct pxa2xx_spi_chip tsc2046_chip = { .tx_threshold = 1, .rx_threshold = 2, .timeout = 64, .gpio_cs = GPIO88_HX4700_TSC2046_CS, }; static struct spi_board_info tsc2046_board_info[] __initdata = { { .modalias = "ads7846", .bus_num = 2, .max_speed_hz = 2600000, /* 100 kHz sample rate */ .irq = PXA_GPIO_TO_IRQ(GPIO58_HX4700_TSC2046_nPENIRQ), .platform_data = &tsc2046_info, .controller_data = &tsc2046_chip, }, }; static struct pxa2xx_spi_master pxa_ssp2_master_info = { .num_chipselect = 1, .clock_enable = CKEN_SSP2, .enable_dma = 1, }; /* * External power */
/* * EGPIO (Xilinx CPLD) * * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input */ static struct resource egpio_resources[] = { [0] = { .start = PXA_CS3_PHYS, .end = PXA_CS3_PHYS + 0x20 - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ), .flags = IORESOURCE_IRQ, }, }; static struct htc_egpio_chip egpio_chips[] = { [0] = { .reg_start = 0, .gpio_base = MAGICIAN_EGPIO(0, 0), .num_gpios = 24, .direction = HTC_EGPIO_OUTPUT, .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */ }, [1] = { .reg_start = 4,
.virtual = UNCACHED_PHYS_0, .pfn = __phys_to_pfn(0x00000000), .length = UNCACHED_PHYS_0_SIZE, .type = MT_DEVICE }, }; void __init pxa25x_map_io(void) { pxa_map_io(); iotable_init(ARRAY_AND_SIZE(pxa25x_io_desc)); pxa25x_get_clk_frequency_khz(1); } static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = { .irq_base = PXA_GPIO_TO_IRQ(0), .gpio_set_wake = gpio_set_wake, }; static struct platform_device *pxa25x_devices[] __initdata = { &pxa25x_device_udc, &pxa_device_pmu, &pxa_device_i2s, &sa1100_device_rtc, &pxa25x_device_ssp, &pxa25x_device_nssp, &pxa25x_device_assp, &pxa25x_device_pwm0, &pxa25x_device_pwm1, &pxa_device_asoc_platform, };
}; static struct spi_board_info em_x270_spi_devices[] __initdata = { { .modalias = "tdo24m", .max_speed_hz = 1000000, .bus_num = 1, .chip_select = 0, .controller_data = &em_x270_tdo24m_chip, .platform_data = &em_x270_tdo24m_pdata, }, { .modalias = "libertas_spi", .max_speed_hz = 13000000, .bus_num = 2, .irq = PXA_GPIO_TO_IRQ(116), .chip_select = 0, .controller_data = &em_x270_libertas_chip, .platform_data = &em_x270_libertas_pdata, }, }; static void __init em_x270_init_spi(void) { pxa2xx_set_spi_info(1, &em_x270_spi_info); pxa2xx_set_spi_info(2, &em_x270_spi_2_info); spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices)); } #else static inline void em_x270_init_spi(void) {} #endif
static struct pxa2xx_spi_chip cc2420_info = { .tx_threshold = 8, .rx_threshold = 8, .dma_burst_size = 8, .timeout = 235, .gpio_cs = 39, }; static struct spi_board_info spi_board_info[] __initdata = { { .modalias = "lis3l02dq", .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */ .bus_num = 1, .chip_select = 0, .controller_data = &staccel_chip_info, .irq = PXA_GPIO_TO_IRQ(96), }, { .modalias = "cc2420", .max_speed_hz = 6500000, .bus_num = 3, .chip_select = 0, .controller_data = &cc2420_info, }, }; static void sg2_udc_command(int cmd) { switch (cmd) { case PXA2XX_UDC_CMD_CONNECT: UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE; break;
.gpio_cs = SPITZ_GPIO_LCDCON_CS, }; static struct pxa2xx_spi_chip spitz_max1111_chip = { .gpio_cs = SPITZ_GPIO_MAX1111_CS, }; static struct spi_board_info spitz_spi_devices[] = { { .modalias = "ads7846", .max_speed_hz = 1200000, .bus_num = 2, .chip_select = 0, .platform_data = &spitz_ads7846_info, .controller_data = &spitz_ads7846_chip, .irq = PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT), }, { .modalias = "corgi-lcd", .max_speed_hz = 50000, .bus_num = 2, .chip_select = 1, .platform_data = &spitz_lcdcon_info, .controller_data = &spitz_lcdcon_chip, }, { .modalias = "max1111", .max_speed_hz = 450000, .bus_num = 2, .chip_select = 2, .controller_data = &spitz_max1111_chip, }, };
static void stargate2_mci_exit(struct device *dev, void *data) { free_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT), data); gpio_free(SG2_SD_POWER_ENABLE); gpio_free(SG2_GPIO_nSD_DETECT); }
/* * Asix AX88796 Ethernet */ static struct ax_plat_data colibri_asix_platdata = { .flags = 0, /* defined later */ .wordlength = 2, }; static struct resource colibri_asix_resource[] = { [0] = { .start = PXA3xx_CS2_PHYS, .end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO), .end = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO), .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, } }; static struct platform_device asix_device = { .name = "ax88796", .id = 0, .num_resources = ARRAY_SIZE(colibri_asix_resource), .resource = colibri_asix_resource, .dev = { .platform_data = &colibri_asix_platdata } };
#endif #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) static struct resource colibri_pxa270_dm9000_resources[] = { { .start = PXA_CS2_PHYS, .end = PXA_CS2_PHYS + 3, .flags = IORESOURCE_MEM, }, { .start = PXA_CS2_PHYS + 4, .end = PXA_CS2_PHYS + 4 + 500, .flags = IORESOURCE_MEM, }, { .start = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ), .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, }, }; static struct platform_device colibri_pxa270_dm9000_device = { .name = "dm9000", .id = -1, .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources), .resource = colibri_pxa270_dm9000_resources, }; static void __init colibri_pxa270_eth_init(void) { platform_device_register(&colibri_pxa270_dm9000_device);
GPIO6_MMC_CLK, GPIO8_MMC_CS0, /* Ethernet */ GPIO33_nCS_5, /* Ethernet CS */ GPIO4_GPIO, /* Ethernet IRQ */ }; static struct resource smc91x_resources[] = { [0] = { .start = (IDP_ETH_PHYS + 0x300), .end = (IDP_ETH_PHYS + 0xfffff), .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(4), .end = PXA_GPIO_TO_IRQ(4), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, } }; static struct smc91x_platdata smc91x_platdata = { .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT | SMC91X_USE_DMA | SMC91X_NOWAIT, }; static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources,
.rx_threshold = 1, .tx_threshold = 1, .timeout = 64, .gpio_cs = GPIO88_ZIPITZ2_LCD_CS, }; static const struct lms283gf05_pdata lms283_pdata = { .reset_gpio = GPIO19_ZIPITZ2_LCD_RESET, }; static struct spi_board_info spi_board_info[] __initdata = { { .modalias = "libertas_spi", .platform_data = &z2_lbs_pdata, .controller_data = &z2_lbs_chip_info, .irq = PXA_GPIO_TO_IRQ(GPIO36_ZIPITZ2_WIFI_IRQ), .max_speed_hz = 13000000, .bus_num = 1, .chip_select = 0, }, { .modalias = "lms283gf05", .controller_data = &lms283_chip_info, .platform_data = &lms283_pdata, .max_speed_hz = 400000, .bus_num = 2, .chip_select = 0, }, }; static struct pxa2xx_spi_master pxa_ssp1_master_info = {
}; #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) static struct resource dm9000_resources[] = { [0] = { .start = CM_X300_ETH_PHYS, .end = CM_X300_ETH_PHYS + 0x3, .flags = IORESOURCE_MEM, }, [1] = { .start = CM_X300_ETH_PHYS + 0x4, .end = CM_X300_ETH_PHYS + 0x4 + 500, .flags = IORESOURCE_MEM, }, [2] = { .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, } }; static struct dm9000_plat_data cm_x300_dm9000_platdata = { .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, }; static struct platform_device dm9000_device = { .name = "dm9000", .id = 0, .num_resources = ARRAY_SIZE(dm9000_resources), .resource = dm9000_resources, .dev = {
static int __devinit sharpsl_pm_probe(struct platform_device *pdev) { int ret; if (!pdev->dev.platform_data) return -EINVAL; sharpsl_pm.dev = &pdev->dev; sharpsl_pm.machinfo = pdev->dev.platform_data; sharpsl_pm.charge_mode = CHRG_OFF; sharpsl_pm.flags = 0; init_timer(&sharpsl_pm.ac_timer); sharpsl_pm.ac_timer.function = sharpsl_ac_timer; init_timer(&sharpsl_pm.chrg_full_timer); sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer; led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger); sharpsl_pm.machinfo->init(); gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN"); gpio_direction_input(sharpsl_pm.machinfo->gpio_acin); gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full"); gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull); gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock"); gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); /* Register interrupt handlers */ if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin)); } if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock)); } if (sharpsl_pm.machinfo->gpio_fatal) { if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal)); } } if (sharpsl_pm.machinfo->batfull_irq) { /* Register interrupt handler. */ if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) { dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull)); } } ret = device_create_file(&pdev->dev, &dev_attr_battery_percentage); ret |= device_create_file(&pdev->dev, &dev_attr_battery_voltage); if (ret != 0) dev_warn(&pdev->dev, "Failed to register attributes (%d)\n", ret); apm_get_power_status = sharpsl_apm_get_power_status; #ifdef CONFIG_PM suspend_set_ops(&sharpsl_pm_ops); #endif mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); return 0; }
"backup-battery", "jacket-battery", }; static struct pda_power_pdata tosa_power_data = { .init = tosa_power_init, .is_ac_online = tosa_power_ac_online, .exit = tosa_power_exit, .supplied_to = tosa_ac_supplied_to, .num_supplicants = ARRAY_SIZE(tosa_ac_supplied_to), }; static struct resource tosa_power_resource[] = { { .name = "ac", .start = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN), .end = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE, }, }; static struct platform_device tosa_power_device = { .name = "pda-power", .id = -1, .dev.platform_data = &tosa_power_data, .resource = tosa_power_resource, .num_resources = ARRAY_SIZE(tosa_power_resource), };
static struct platform_device poodle_audio_device = { .name = "poodle-audio", .id = -1, }; /* LoCoMo device */ static struct resource locomo_resources[] = { [0] = { .start = 0x10000000, .end = 0x10001fff, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_GPIO_TO_IRQ(10), .end = PXA_GPIO_TO_IRQ(10), .flags = IORESOURCE_IRQ, }, }; static struct locomo_platform_data locomo_info = { .irq_base = IRQ_BOARD_START, }; struct platform_device poodle_locomo_device = { .name = "locomo", .id = 0, .num_resources = ARRAY_SIZE(locomo_resources), .resource = locomo_resources, .dev = {
* Ethernet ******************************************************************************/ #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) static struct resource vpac270_dm9000_resources[] = { [0] = { .start = PXA_CS2_PHYS + 0x300, .end = PXA_CS2_PHYS + 0x303, .flags = IORESOURCE_MEM, }, [1] = { .start = PXA_CS2_PHYS + 0x304, .end = PXA_CS2_PHYS + 0x343, .flags = IORESOURCE_MEM, }, [2] = { .start = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, }, }; static struct dm9000_plat_data vpac270_dm9000_platdata = { .flags = DM9000_PLATF_32BITONLY, }; static struct platform_device vpac270_dm9000_device = { .name = "dm9000", .id = -1, .num_resources = ARRAY_SIZE(vpac270_dm9000_resources), .resource = vpac270_dm9000_resources, .dev = {