diff options
Diffstat (limited to 'arch/blackfin/mach-bf561/boards/ezkit.c')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 68 |
1 files changed, 59 insertions, 9 deletions
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 9b93e2f95791..ab7a487975fd 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/delay.h> | ||
17 | #include <asm/dma.h> | 18 | #include <asm/dma.h> |
18 | #include <asm/bfin5xx_spi.h> | 19 | #include <asm/bfin5xx_spi.h> |
19 | #include <asm/portmux.h> | 20 | #include <asm/portmux.h> |
@@ -74,7 +75,7 @@ static struct resource isp1362_hcd_resources[] = { | |||
74 | }, { | 75 | }, { |
75 | .start = IRQ_PF8, | 76 | .start = IRQ_PF8, |
76 | .end = IRQ_PF8, | 77 | .end = IRQ_PF8, |
77 | .flags = IORESOURCE_IRQ, | 78 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, |
78 | }, | 79 | }, |
79 | }; | 80 | }; |
80 | 81 | ||
@@ -274,8 +275,8 @@ static struct platform_device ezkit_flash_device = { | |||
274 | }; | 275 | }; |
275 | #endif | 276 | #endif |
276 | 277 | ||
277 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ | 278 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ |
278 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) | 279 | || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
279 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | 280 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
280 | .enable_dma = 0, | 281 | .enable_dma = 0, |
281 | .bits_per_word = 16, | 282 | .bits_per_word = 16, |
@@ -328,14 +329,16 @@ static struct platform_device bfin_spi0_device = { | |||
328 | #endif | 329 | #endif |
329 | 330 | ||
330 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | 331 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
331 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ | 332 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ |
332 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) | 333 | || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
333 | { | 334 | { |
334 | .modalias = "ad1836", | 335 | .modalias = "ad183x", |
335 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 336 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
336 | .bus_num = 0, | 337 | .bus_num = 0, |
337 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 338 | .chip_select = 4, |
339 | .platform_data = "ad1836", /* only includes chip name for the moment */ | ||
338 | .controller_data = &ad1836_spi_chip_info, | 340 | .controller_data = &ad1836_spi_chip_info, |
341 | .mode = SPI_MODE_3, | ||
339 | }, | 342 | }, |
340 | #endif | 343 | #endif |
341 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) | 344 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
@@ -377,8 +380,8 @@ static struct platform_device bfin_device_gpiokeys = { | |||
377 | #include <linux/i2c-gpio.h> | 380 | #include <linux/i2c-gpio.h> |
378 | 381 | ||
379 | static struct i2c_gpio_platform_data i2c_gpio_data = { | 382 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
380 | .sda_pin = 1, | 383 | .sda_pin = GPIO_PF1, |
381 | .scl_pin = 0, | 384 | .scl_pin = GPIO_PF0, |
382 | .sda_is_open_drain = 0, | 385 | .sda_is_open_drain = 0, |
383 | .scl_is_open_drain = 0, | 386 | .scl_is_open_drain = 0, |
384 | .udelay = 40, | 387 | .udelay = 40, |
@@ -420,6 +423,30 @@ static struct platform_device bfin_dpmc = { | |||
420 | }, | 423 | }, |
421 | }; | 424 | }; |
422 | 425 | ||
426 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) | ||
427 | static struct platform_device bfin_i2s = { | ||
428 | .name = "bfin-i2s", | ||
429 | .id = CONFIG_SND_BF5XX_SPORT_NUM, | ||
430 | /* TODO: add platform data here */ | ||
431 | }; | ||
432 | #endif | ||
433 | |||
434 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) | ||
435 | static struct platform_device bfin_tdm = { | ||
436 | .name = "bfin-tdm", | ||
437 | .id = CONFIG_SND_BF5XX_SPORT_NUM, | ||
438 | /* TODO: add platform data here */ | ||
439 | }; | ||
440 | #endif | ||
441 | |||
442 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) | ||
443 | static struct platform_device bfin_ac97 = { | ||
444 | .name = "bfin-ac97", | ||
445 | .id = CONFIG_SND_BF5XX_SPORT_NUM, | ||
446 | /* TODO: add platform data here */ | ||
447 | }; | ||
448 | #endif | ||
449 | |||
423 | static struct platform_device *ezkit_devices[] __initdata = { | 450 | static struct platform_device *ezkit_devices[] __initdata = { |
424 | 451 | ||
425 | &bfin_dpmc, | 452 | &bfin_dpmc, |
@@ -467,6 +494,18 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
467 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | 494 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
468 | &ezkit_flash_device, | 495 | &ezkit_flash_device, |
469 | #endif | 496 | #endif |
497 | |||
498 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) | ||
499 | &bfin_i2s, | ||
500 | #endif | ||
501 | |||
502 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) | ||
503 | &bfin_tdm, | ||
504 | #endif | ||
505 | |||
506 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) | ||
507 | &bfin_ac97, | ||
508 | #endif | ||
470 | }; | 509 | }; |
471 | 510 | ||
472 | static int __init ezkit_init(void) | 511 | static int __init ezkit_init(void) |
@@ -484,6 +523,17 @@ static int __init ezkit_init(void) | |||
484 | SSYNC(); | 523 | SSYNC(); |
485 | #endif | 524 | #endif |
486 | 525 | ||
526 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) | ||
527 | bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 15)); | ||
528 | bfin_write_FIO0_FLAG_S(1 << 15); | ||
529 | SSYNC(); | ||
530 | /* | ||
531 | * This initialization lasts for approximately 4500 MCLKs. | ||
532 | * MCLK = 12.288MHz | ||
533 | */ | ||
534 | udelay(400); | ||
535 | #endif | ||
536 | |||
487 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 537 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
488 | return 0; | 538 | return 0; |
489 | } | 539 | } |