diff options
Diffstat (limited to 'arch/arm/mach-s3c2442/mach-gta02.c')
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 0fb385bd9cd..8fa94ef405a 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -38,6 +38,7 @@ #include <linux/platform_device.h> #include <linux/serial_core.h> #include <linux/spi/spi.h> +#include <linux/spi/spi_gpio.h> #include <linux/mmc/host.h> @@ -87,6 +88,9 @@ #include <plat/gpio-cfg.h> #include <plat/iic.h> +#include <linux/glamofb.h> +#include <linux/mfd/glamo.h> + static struct pcf50633 *gta02_pcf; /* @@ -149,6 +153,124 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = { }, }; +/* + * we crank down SD Card clock dynamically when GPS is powered + */ + +static int gta02_glamo_mci_use_slow(void) +{ + return gta02_pm_gps_is_on(); +} + +static void gta02_glamo_external_reset(int level) +{ + s3c2410_gpio_setpin(GTA02_GPIO_3D_RESET, level); + s3c2410_gpio_cfgpin(GTA02_GPIO_3D_RESET, S3C2410_GPIO_OUTPUT); +} + +struct spi_gpio_platform_data spigpio_platform_data = { + .sck = GTA02_GPIO_GLAMO(10), + .mosi = GTA02_GPIO_GLAMO(11), + .miso = GTA02_GPIO_GLAMO(5), + .num_chipselect = 1, +}; + +static struct platform_device spigpio_device = { + .name = "spi_gpio", + .id = 2, + .dev = { + .platform_data = &spigpio_platform_data, + }, +}; + +static void gta02_glamo_registered(struct device *dev) +{ + spigpio_device.dev.parent = dev; + platform_device_register(&spigpio_device); +} + +static struct fb_videomode gta02_glamo_modes[] = { + { + .name = "480x640", + .xres = 480, + .yres = 640, + .pixclock = 40816, + .left_margin = 8, + .right_margin = 16, + .upper_margin = 2, + .lower_margin = 16, + .hsync_len = 8, + .vsync_len = 2, + .vmode = FB_VMODE_NONINTERLACED, + }, { + .name = "240x320", + .xres = 240, + .yres = 320, + .pixclock = 40816, + .left_margin = 8, + .right_margin = 16, + .upper_margin = 2, + .lower_margin = 16, + .hsync_len = 8, + .vsync_len = 2, + .vmode = FB_VMODE_NONINTERLACED, + } +}; + + +static struct glamo_fb_platform_data gta02_glamo_fb_pdata = { + .width = 43, + .height = 58, + + .num_modes = ARRAY_SIZE(gta02_glamo_modes), + .modes = gta02_glamo_modes, +}; + +static struct glamo_mmc_platform_data gta02_glamo_mmc_pdata = { + .glamo_mmc_use_slow = gta02_glamo_mci_use_slow, +}; + +static struct glamo_gpio_platform_data gta02_glamo_gpio_pdata = { + .base = GTA02_GPIO_GLAMO_BASE, + .registered = gta02_glamo_registered, +}; + +static struct glamo_platform_data gta02_glamo_pdata = { + .fb_data = >a02_glamo_fb_pdata, + .mmc_data = >a02_glamo_mmc_pdata, + .gpio_data = >a02_glamo_gpio_pdata, + + .osci_clock_rate = 32768, + + .glamo_external_reset = gta02_glamo_external_reset, +}; + +static struct resource gta02_glamo_resources[] = { + [0] = { + .start = S3C2410_CS1, + .end = S3C2410_CS1 + 0x1000000 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = GTA02_IRQ_3D, + .end = GTA02_IRQ_3D, + .flags = IORESOURCE_IRQ, + }, + [2] = { + .start = GTA02_GPIO_3D_RESET, + .end = GTA02_GPIO_3D_RESET, + }, +}; + +static struct platform_device gta02_glamo_dev = { + .name = "glamo3362", + .num_resources = ARRAY_SIZE(gta02_glamo_resources), + .resource = gta02_glamo_resources, + .dev = { + .platform_data = >a02_glamo_pdata, + }, +}; + #ifdef CONFIG_CHARGER_PCF50633 /* * On GTA02 the 1A charger features a 48K resistor to 0V on the ID pin. @@ -577,6 +699,7 @@ static struct platform_device *gta02_devices[] __initdata = { static struct platform_device *gta02_devices_pmu_children[] = { >a02_bl_dev, + >a02_glamo_dev, }; |