diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-07-03 06:24:32 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-07-03 11:51:25 -0400 |
commit | a2ed4065159d87d88f2bdc5a3a53e96b76f5a198 (patch) | |
tree | 6c3db17b028e817cae88aeb4977249aa903e2240 /arch/arm/mach-s3c2412/mach-jive.c | |
parent | 0f99263cda230415a48163fe9c30447173f73ff1 (diff) |
[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 <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2412/mach-jive.c')
-rw-r--r-- | arch/arm/mach-s3c2412/mach-jive.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index b528ed93773c..ad6b942a2a8f 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | 22 | ||
23 | #include <linux/spi/spi.h> | ||
24 | |||
23 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
25 | 27 | ||
@@ -34,6 +36,7 @@ | |||
34 | #include <asm/arch/regs-gpio.h> | 36 | #include <asm/arch/regs-gpio.h> |
35 | #include <asm/arch/regs-mem.h> | 37 | #include <asm/arch/regs-mem.h> |
36 | #include <asm/arch/regs-lcd.h> | 38 | #include <asm/arch/regs-lcd.h> |
39 | #include <asm/arch/spi-gpio.h> | ||
37 | #include <asm/arch/fb.h> | 40 | #include <asm/arch/fb.h> |
38 | 41 | ||
39 | #include <asm/mach-types.h> | 42 | #include <asm/mach-types.h> |
@@ -346,12 +349,48 @@ struct s3c2410fb_mach_info jive_lcd_config = { | |||
346 | S3C2410_GPDCON_MASK(14) | S3C2410_GPDCON_MASK(15)), | 349 | S3C2410_GPDCON_MASK(14) | S3C2410_GPDCON_MASK(15)), |
347 | }; | 350 | }; |
348 | 351 | ||
352 | /* LCD SPI support */ | ||
353 | |||
354 | static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) | ||
355 | { | ||
356 | s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1); | ||
357 | } | ||
358 | |||
359 | static struct s3c2410_spigpio_info jive_lcd_spi = { | ||
360 | .bus_num = 1, | ||
361 | .pin_clk = S3C2410_GPG8, | ||
362 | .pin_mosi = S3C2410_GPB8, | ||
363 | .chip_select = jive_lcd_spi_chipselect, | ||
364 | }; | ||
365 | |||
366 | static struct platform_device jive_device_lcdspi = { | ||
367 | .name = "s3c24xx-spi-gpio", | ||
368 | .id = 1, | ||
369 | .num_resources = 0, | ||
370 | .dev.platform_data = &jive_lcd_spi, | ||
371 | }; | ||
372 | |||
373 | /* JIVE SPI devices. */ | ||
374 | |||
375 | |||
376 | static struct spi_board_info __initdata jive_spi_devs[] = { | ||
377 | [0] = { | ||
378 | .modalias = "VGG2432A4", | ||
379 | .bus_num = 1, | ||
380 | .chip_select = 0, | ||
381 | .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */ | ||
382 | .max_speed_hz = 100000, | ||
383 | }, | ||
384 | }; | ||
385 | |||
386 | |||
349 | static struct platform_device *jive_devices[] __initdata = { | 387 | static struct platform_device *jive_devices[] __initdata = { |
350 | &s3c_device_usb, | 388 | &s3c_device_usb, |
351 | &s3c_device_rtc, | 389 | &s3c_device_rtc, |
352 | &s3c_device_wdt, | 390 | &s3c_device_wdt, |
353 | &s3c_device_i2c, | 391 | &s3c_device_i2c, |
354 | &s3c_device_lcd, | 392 | &s3c_device_lcd, |
393 | &jive_device_lcdspi, | ||
355 | &s3c_device_nand, | 394 | &s3c_device_nand, |
356 | &s3c_device_usbgadget, | 395 | &s3c_device_usbgadget, |
357 | }; | 396 | }; |
@@ -502,6 +541,20 @@ static void __init jive_machine_init(void) | |||
502 | 541 | ||
503 | s3c_device_nand.dev.platform_data = &jive_nand_info; | 542 | s3c_device_nand.dev.platform_data = &jive_nand_info; |
504 | 543 | ||
544 | /* initialise the spi */ | ||
545 | |||
546 | s3c2410_gpio_setpin(S3C2410_GPG13, 0); | ||
547 | s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); | ||
548 | |||
549 | s3c2410_gpio_setpin(S3C2410_GPB7, 1); | ||
550 | s3c2410_gpio_cfgpin(S3C2410_GPB7, S3C2410_GPIO_OUTPUT); | ||
551 | |||
552 | s3c2410_gpio_setpin(S3C2410_GPB6, 0); | ||
553 | s3c2410_gpio_cfgpin(S3C2410_GPB6, S3C2410_GPIO_OUTPUT); | ||
554 | |||
555 | s3c2410_gpio_setpin(S3C2410_GPG8, 1); | ||
556 | s3c2410_gpio_cfgpin(S3C2410_GPG8, S3C2410_GPIO_OUTPUT); | ||
557 | |||
505 | /* Turn off suspend on both USB ports, and switch the | 558 | /* Turn off suspend on both USB ports, and switch the |
506 | * selectable USB port to USB device mode. */ | 559 | * selectable USB port to USB device mode. */ |
507 | 560 | ||
@@ -512,6 +565,8 @@ static void __init jive_machine_init(void) | |||
512 | s3c24xx_udc_set_platdata(&jive_udc_cfg); | 565 | s3c24xx_udc_set_platdata(&jive_udc_cfg); |
513 | s3c24xx_fb_set_platdata(&jive_lcd_config); | 566 | s3c24xx_fb_set_platdata(&jive_lcd_config); |
514 | 567 | ||
568 | spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs)); | ||
569 | |||
515 | platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); | 570 | platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); |
516 | } | 571 | } |
517 | 572 | ||