aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2412/mach-jive.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-06-28 08:49:13 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-07-04 12:51:58 -0400
commit932036ce03f6c853a17005bced1e82b23f6378c0 (patch)
tree44b091a8d695e9d57ff5c94d138ae0f6627f7f7a /arch/arm/mach-s3c2412/mach-jive.c
parenta2274cedc4b33a29be6583cd757bdc0b436851ec (diff)
mach-jive: convert to spi_gpio
Rather than the deprecated spi_s3c24xx_gpio driver. Compile tested only. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-s3c2412/mach-jive.c')
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 85dcaeb9e62f..5eeb47580b0c 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -25,6 +25,7 @@
25#include <video/ili9320.h> 25#include <video/ili9320.h>
26 26
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/spi_gpio.h>
28 29
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -38,7 +39,6 @@
38#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
39#include <mach/regs-mem.h> 40#include <mach/regs-mem.h>
40#include <mach/regs-lcd.h> 41#include <mach/regs-lcd.h>
41#include <mach/spi-gpio.h>
42#include <mach/fb.h> 42#include <mach/fb.h>
43 43
44#include <asm/mach-types.h> 44#include <asm/mach-types.h>
@@ -389,45 +389,30 @@ static struct ili9320_platdata jive_lcm_config = {
389 389
390/* LCD SPI support */ 390/* LCD SPI support */
391 391
392static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) 392static struct spi_gpio_platform_data jive_lcd_spi = {
393{ 393 .sck = S3C2410_GPG(8),
394 gpio_set_value(S3C2410_GPB(7), cs ? 0 : 1); 394 .mosi = S3C2410_GPB(8),
395} 395 .miso = SPI_GPIO_NO_MISO,
396
397static struct s3c2410_spigpio_info jive_lcd_spi = {
398 .bus_num = 1,
399 .pin_clk = S3C2410_GPG(8),
400 .pin_mosi = S3C2410_GPB(8),
401 .num_chipselect = 1,
402 .chip_select = jive_lcd_spi_chipselect,
403}; 396};
404 397
405static struct platform_device jive_device_lcdspi = { 398static struct platform_device jive_device_lcdspi = {
406 .name = "spi_s3c24xx_gpio", 399 .name = "spi-gpio",
407 .id = 1, 400 .id = 1,
408 .num_resources = 0,
409 .dev.platform_data = &jive_lcd_spi, 401 .dev.platform_data = &jive_lcd_spi,
410}; 402};
411 403
412/* WM8750 audio code SPI definition */
413 404
414static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs) 405/* WM8750 audio code SPI definition */
415{
416 gpio_set_value(S3C2410_GPH(10), cs ? 0 : 1);
417}
418 406
419static struct s3c2410_spigpio_info jive_wm8750_spi = { 407static struct spi_gpio_platform_data jive_wm8750_spi = {
420 .bus_num = 2, 408 .sck = S3C2410_GPB(4),
421 .pin_clk = S3C2410_GPB(4), 409 .mosi = S3C2410_GPB(9),
422 .pin_mosi = S3C2410_GPB(9), 410 .miso = SPI_GPIO_NO_MISO,
423 .num_chipselect = 1,
424 .chip_select = jive_wm8750_chipselect,
425}; 411};
426 412
427static struct platform_device jive_device_wm8750 = { 413static struct platform_device jive_device_wm8750 = {
428 .name = "spi_s3c24xx_gpio", 414 .name = "spi-gpio",
429 .id = 2, 415 .id = 2,
430 .num_resources = 0,
431 .dev.platform_data = &jive_wm8750_spi, 416 .dev.platform_data = &jive_wm8750_spi,
432}; 417};
433 418
@@ -441,12 +426,14 @@ static struct spi_board_info __initdata jive_spi_devs[] = {
441 .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */ 426 .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */
442 .max_speed_hz = 100000, 427 .max_speed_hz = 100000,
443 .platform_data = &jive_lcm_config, 428 .platform_data = &jive_lcm_config,
429 .controller_data = (void *)S3C2410_GPB(7),
444 }, { 430 }, {
445 .modalias = "WM8750", 431 .modalias = "WM8750",
446 .bus_num = 2, 432 .bus_num = 2,
447 .chip_select = 0, 433 .chip_select = 0,
448 .mode = SPI_MODE_0, /* CPOL=0, CPHA=0 */ 434 .mode = SPI_MODE_0, /* CPOL=0, CPHA=0 */
449 .max_speed_hz = 100000, 435 .max_speed_hz = 100000,
436 .controller_data = (void *)S3C2410_GPH(10),
450 }, 437 },
451}; 438};
452 439