/* * linux/arch/arm/mach-pxa/zylonite.c * * Support for the PXA3xx Development Platform (aka Zylonite) * * Copyright (C) 2006 Marvell International Ltd. * * 2007-09-04: eric miao * rewrite to align with latest kernel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "devices.h" #include "generic.h" int gpio_eth_irq; int gpio_debug_led1; int gpio_debug_led2; int wm9713_irq; int lcd_id; int lcd_orientation; struct platform_device pxa_device_wm9713_audio = { .name = "wm9713-codec", .id = -1, }; static void __init zylonite_init_wm9713_audio(void) { platform_device_register(&pxa_device_wm9713_audio); } static struct resource smc91x_resources[] = { [0] = { .start = ZYLONITE_ETH_PHYS + 0x300, .end = ZYLONITE_ETH_PHYS + 0xfffff, .flags = IORESOURCE_MEM, }, [1] = { .start = -1, /* for run-time assignment */ .end = -1, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, } }; static struct smc91x_platdata zylonite_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, .dev = { .platform_data = &zylonite_smc91x_info, }, }; #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) static struct gpio_led zylonite_debug_leds[] = { [0] = { .name = "zylonite:yellow:1", .default_trigger = "heartbeat", }, [1] = { .name = "zylonite:yellow:2", .default_trigger = "default-on", }, }; static struct gpio_led_platform_data zylonite_debug_leds_info = { .leds = zylonite_debug_leds, .num_leds = ARRAY_SIZE(zylonite_debug_leds), }; static struct platform_device zylonite_device_leds = { .name = "leds-gpio", .id = -1, .dev = { .platform_data = &zylonite_debug_leds_info, } }; static void __init zylonite_init_leds(void) { zylonite_debug_leds[0].gpio = gpio_debug_led1; zylonite_debug_leds[1].gpio = gpio_debug_led2; platform_device_register(&zylonite_device_leds); } #else static inline void zylonite_init_leds(void) {} #endif #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) static struct platform_pwm_backlight_data zylonite_backlight_data = { .pwm_id = 3, .max_brightness = 100, .dft_brightness = 100, .pwm_period_ns = 10000, }; static struct platform_device zylonite_backlight_device = { .name = "pwm-backlight", .dev = { .parent = &pxa27x_device_pwm1.dev, .platform_data = &zylonite_backlight_data, }, }; static struct pxafb_mode_info toshiba_ltm035a776c_mode = { .pixclock = 110000, .xres = 240, .yres = 320, .bpp = 16, .hsync_len = 4, .left_margin = 6, .right_margin = 4, .vsync_len = 2, .upper_margin = 2, .lower_margin = 3, .sync = FB_SYNC_VERT_HIGH_ACT, }; static struct pxafb_mode_info toshiba_ltm04c380k_mode = { .pixclock = 50000, .xres = 640, .yres = 480, .bpp = 16, .hsync_len = 1, .left_margin = 0x9f, .right_margin = 1, .vsync_len = 44, .upper_margin = 0, .lower_margin = 0, .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, }; static struct pxafb_mach_info zylonite_toshiba_lcd_info = { .num_modes = 1, .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, }; static struct pxafb_mode_info sharp_ls037_modes[] = { [0] = { .pixclock = 158000, .xres = 240, .yres = 320, .bpp = 16, .hsync_len = 4, .left_margin = 39, .right_margin = 39, .vsync_len = 1, .upper_margin = 2, .lower_margin = 3, .sync = 0, }, [1] = { .pixclock = 39700, .xres = 480, .yres = 640, .bpp = 16, .hsync_len = 8, .left_margin = 81, .right_margin = 81, .vsync_len = 1, .upper_margin = 2, .lower_margin = 7, .sync = 0, }, }; static struct pxafb_mach_info zylonite_sharp_lcd_info = { .modes = sharp_ls037_modes, .num_modes = 2, .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, }; static void __init zylonite_init_lcd(void) { platform_device_register(&zylonite_backlight_device); if (lcd_id & 0x20) { pxa_set_fb_info(NULL, &zylonite_sharp_lcd_info); return; } /* legacy LCD panels, it would be handy here if LCD panel type can * be decided at run-time */ if (1) zylonite_toshiba_lcd_info.modes = &toshiba_ltm035a776c_mode; else zylonite_toshiba_lcd_info.modes = &toshiba_ltm04c380k_mode;