From a2ed4065159d87d88f2bdc5a3a53e96b76f5a198 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 3 Jul 2008 11:24:32 +0100 Subject: [PATCH] [ARM] JIVE: Add SPI bus definitions for LCD controller Add the definitions for the VGG2432A4 intelligent LCD display conneected via an GPIO-based SPI bus on the Logitech Jive. Signed-of-by: Ben Dooks --- arch/arm/mach-s3c2412/mach-jive.c | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index b528ed9377..ad6b942a2a 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c @@ -20,6 +20,8 @@ #include #include +#include + #include #include @@ -34,6 +36,7 @@ #include #include #include +#include #include #include @@ -346,12 +349,48 @@ struct s3c2410fb_mach_info jive_lcd_config = { S3C2410_GPDCON_MASK(14) | S3C2410_GPDCON_MASK(15)), }; +/* LCD SPI support */ + +static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) +{ + s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1); +} + +static struct s3c2410_spigpio_info jive_lcd_spi = { + .bus_num = 1, + .pin_clk = S3C2410_GPG8, + .pin_mosi = S3C2410_GPB8, + .chip_select = jive_lcd_spi_chipselect, +}; + +static struct platform_device jive_device_lcdspi = { + .name = "s3c24xx-spi-gpio", + .id = 1, + .num_resources = 0, + .dev.platform_data = &jive_lcd_spi, +}; + +/* JIVE SPI devices. */ + + +static struct spi_board_info __initdata jive_spi_devs[] = { + [0] = { + .modalias = "VGG2432A4", + .bus_num = 1, + .chip_select = 0, + .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */ + .max_speed_hz = 100000, + }, +}; + + static struct platform_device *jive_devices[] __initdata = { &s3c_device_usb, &s3c_device_rtc, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_lcd, + &jive_device_lcdspi, &s3c_device_nand, &s3c_device_usbgadget, }; @@ -502,6 +541,20 @@ static void __init jive_machine_init(void) s3c_device_nand.dev.platform_data = &jive_nand_info; + /* initialise the spi */ + + s3c2410_gpio_setpin(S3C2410_GPG13, 0); + s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); + + s3c2410_gpio_setpin(S3C2410_GPB7, 1); + s3c2410_gpio_cfgpin(S3C2410_GPB7, S3C2410_GPIO_OUTPUT); + + s3c2410_gpio_setpin(S3C2410_GPB6, 0); + s3c2410_gpio_cfgpin(S3C2410_GPB6, S3C2410_GPIO_OUTPUT); + + s3c2410_gpio_setpin(S3C2410_GPG8, 1); + s3c2410_gpio_cfgpin(S3C2410_GPG8, S3C2410_GPIO_OUTPUT); + /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */ @@ -512,6 +565,8 @@ static void __init jive_machine_init(void) s3c24xx_udc_set_platdata(&jive_udc_cfg); s3c24xx_fb_set_platdata(&jive_lcd_config); + spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs)); + platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); } -- 2.39.5