diff options
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/pnav10.c')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 8806f1230f2d..20507e92a3a4 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/usb_isp1362.h> | 38 | #include <linux/usb_isp1362.h> |
39 | #endif | 39 | #endif |
40 | #include <linux/irq.h> | 40 | #include <linux/irq.h> |
41 | #include <asm/dma.h> | ||
41 | #include <asm/bfin5xx_spi.h> | 42 | #include <asm/bfin5xx_spi.h> |
42 | #include <linux/usb_sl811.h> | 43 | #include <linux/usb_sl811.h> |
43 | 44 | ||
@@ -130,15 +131,13 @@ static struct resource sl811_hcd_resources[] = { | |||
130 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | 131 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
131 | void sl811_port_power(struct device *dev, int is_on) | 132 | void sl811_port_power(struct device *dev, int is_on) |
132 | { | 133 | { |
133 | unsigned short mask = (1 << CONFIG_USB_SL811_BFIN_GPIO_VBUS); | 134 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
134 | 135 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS); | |
135 | bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask); | ||
136 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask); | ||
137 | 136 | ||
138 | if (is_on) | 137 | if (is_on) |
139 | bfin_write_FIO_FLAG_S(mask); | 138 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1); |
140 | else | 139 | else |
141 | bfin_write_FIO_FLAG_C(mask); | 140 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0); |
142 | } | 141 | } |
143 | #endif | 142 | #endif |
144 | 143 | ||
@@ -323,7 +322,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
323 | /* the modalias must be the same as spi device driver name */ | 322 | /* the modalias must be the same as spi device driver name */ |
324 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 323 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
325 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 324 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
326 | .bus_num = 1, /* Framework bus number */ | 325 | .bus_num = 0, /* Framework bus number */ |
327 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 326 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
328 | .platform_data = &bfin_spi_flash_data, | 327 | .platform_data = &bfin_spi_flash_data, |
329 | .controller_data = &spi_flash_chip_info, | 328 | .controller_data = &spi_flash_chip_info, |
@@ -336,7 +335,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
336 | { | 335 | { |
337 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 336 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
338 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 337 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
339 | .bus_num = 1, /* Framework bus number */ | 338 | .bus_num = 0, /* Framework bus number */ |
340 | .chip_select = 1, /* Framework chip select. */ | 339 | .chip_select = 1, /* Framework chip select. */ |
341 | .platform_data = NULL, /* No spi_driver specific config */ | 340 | .platform_data = NULL, /* No spi_driver specific config */ |
342 | .controller_data = &spi_adc_chip_info, | 341 | .controller_data = &spi_adc_chip_info, |
@@ -348,7 +347,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
348 | { | 347 | { |
349 | .modalias = "ad1836-spi", | 348 | .modalias = "ad1836-spi", |
350 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 349 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
351 | .bus_num = 1, | 350 | .bus_num = 0, |
352 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 351 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
353 | .controller_data = &ad1836_spi_chip_info, | 352 | .controller_data = &ad1836_spi_chip_info, |
354 | }, | 353 | }, |
@@ -357,7 +356,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
357 | { | 356 | { |
358 | .modalias = "ad9960-spi", | 357 | .modalias = "ad9960-spi", |
359 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | 358 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
360 | .bus_num = 1, | 359 | .bus_num = 0, |
361 | .chip_select = 1, | 360 | .chip_select = 1, |
362 | .controller_data = &ad9960_spi_chip_info, | 361 | .controller_data = &ad9960_spi_chip_info, |
363 | }, | 362 | }, |
@@ -366,7 +365,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
366 | { | 365 | { |
367 | .modalias = "spi_mmc_dummy", | 366 | .modalias = "spi_mmc_dummy", |
368 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 367 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
369 | .bus_num = 1, | 368 | .bus_num = 0, |
370 | .chip_select = 7, | 369 | .chip_select = 7, |
371 | .platform_data = NULL, | 370 | .platform_data = NULL, |
372 | .controller_data = &spi_mmc_chip_info, | 371 | .controller_data = &spi_mmc_chip_info, |
@@ -375,7 +374,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
375 | { | 374 | { |
376 | .modalias = "spi_mmc", | 375 | .modalias = "spi_mmc", |
377 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 376 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
378 | .bus_num = 1, | 377 | .bus_num = 0, |
379 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 378 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
380 | .platform_data = NULL, | 379 | .platform_data = NULL, |
381 | .controller_data = &spi_mmc_chip_info, | 380 | .controller_data = &spi_mmc_chip_info, |
@@ -396,24 +395,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
396 | 395 | ||
397 | }; | 396 | }; |
398 | 397 | ||
398 | /* SPI (0) */ | ||
399 | static struct resource bfin_spi0_resource[] = { | ||
400 | [0] = { | ||
401 | .start = SPI0_REGBASE, | ||
402 | .end = SPI0_REGBASE + 0xFF, | ||
403 | .flags = IORESOURCE_MEM, | ||
404 | }, | ||
405 | [1] = { | ||
406 | .start = CH_SPI, | ||
407 | .end = CH_SPI, | ||
408 | .flags = IORESOURCE_IRQ, | ||
409 | } | ||
410 | }; | ||
411 | |||
399 | /* SPI controller data */ | 412 | /* SPI controller data */ |
400 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 413 | static struct bfin5xx_spi_master bfin_spi0_info = { |
401 | .num_chipselect = 8, | 414 | .num_chipselect = 8, |
402 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 415 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
403 | }; | 416 | }; |
404 | 417 | ||
405 | static struct platform_device spi_bfin_master_device = { | 418 | static struct platform_device bfin_spi0_device = { |
406 | .name = "bfin-spi-master", | 419 | .name = "bfin-spi", |
407 | .id = 1, /* Bus number */ | 420 | .id = 0, /* Bus number */ |
421 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
422 | .resource = bfin_spi0_resource, | ||
408 | .dev = { | 423 | .dev = { |
409 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 424 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
410 | }, | 425 | }, |
411 | }; | 426 | }; |
412 | #endif /* spi master and devices */ | 427 | #endif /* spi master and devices */ |
413 | 428 | ||
414 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 429 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
415 | static struct platform_device bfin_fb_device = { | 430 | static struct platform_device bfin_fb_device = { |
416 | .name = "bf537-fb", | 431 | .name = "bf537-lq035", |
417 | }; | 432 | }; |
418 | #endif | 433 | #endif |
419 | 434 | ||
@@ -469,7 +484,7 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
469 | #endif | 484 | #endif |
470 | 485 | ||
471 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 486 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
472 | &spi_bfin_master_device, | 487 | &bfin_spi0_device, |
473 | #endif | 488 | #endif |
474 | 489 | ||
475 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 490 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |