Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Blackfin: boards: update ASoC resources after machine driver overhaul

Now that the Blackfin machine drivers have been updated to the
multicomponent support, update the resources to match. The pin
settings are now a board issue and removed from the driver.

Signed-off-by: Scott Jiang <scott.jiang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

authored by

Scott Jiang and committed by
Mike Frysinger
6f53dbbb f9691bb9

+273 -17
+4
arch/blackfin/include/asm/bfin_sport.h
··· 100 100 }; 101 101 #undef __BFP 102 102 103 + struct bfin_snd_platform_data { 104 + const unsigned short *pin_req; 105 + }; 106 + 103 107 #define bfin_read_sport_rx32(base) \ 104 108 ({ \ 105 109 struct sport_register *__mmrs = (void *)base; \
+72 -2
arch/blackfin/mach-bf527/boards/ezkit.c
··· 26 26 #include <asm/portmux.h> 27 27 #include <asm/dpmc.h> 28 28 #include <linux/spi/ad7877.h> 29 + #include <asm/bfin_sport.h> 29 30 30 31 /* 31 32 * Name the Board for the /proc/cpuinfo ··· 527 526 }; 528 527 #endif 529 528 529 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 530 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 531 + 532 + static const u16 bfin_snd_pin[][7] = { 533 + {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 534 + P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0, 0}, 535 + {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, 536 + P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_TFS, 0}, 537 + }; 538 + 539 + static struct bfin_snd_platform_data bfin_snd_data[] = { 540 + { 541 + .pin_req = &bfin_snd_pin[0][0], 542 + }, 543 + { 544 + .pin_req = &bfin_snd_pin[1][0], 545 + }, 546 + }; 547 + 548 + #define BFIN_SND_RES(x) \ 549 + [x] = { \ 550 + { \ 551 + .start = SPORT##x##_TCR1, \ 552 + .end = SPORT##x##_TCR1, \ 553 + .flags = IORESOURCE_MEM \ 554 + }, \ 555 + { \ 556 + .start = CH_SPORT##x##_RX, \ 557 + .end = CH_SPORT##x##_RX, \ 558 + .flags = IORESOURCE_DMA, \ 559 + }, \ 560 + { \ 561 + .start = CH_SPORT##x##_TX, \ 562 + .end = CH_SPORT##x##_TX, \ 563 + .flags = IORESOURCE_DMA, \ 564 + }, \ 565 + { \ 566 + .start = IRQ_SPORT##x##_ERROR, \ 567 + .end = IRQ_SPORT##x##_ERROR, \ 568 + .flags = IORESOURCE_IRQ, \ 569 + } \ 570 + } 571 + 572 + static struct resource bfin_snd_resources[][4] = { 573 + BFIN_SND_RES(0), 574 + BFIN_SND_RES(1), 575 + }; 576 + 577 + static struct platform_device bfin_pcm = { 578 + .name = "bfin-pcm-audio", 579 + .id = -1, 580 + }; 581 + #endif 582 + 530 583 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 531 584 static struct platform_device bfin_i2s = { 532 585 .name = "bfin-i2s", 533 586 .id = CONFIG_SND_BF5XX_SPORT_NUM, 534 - /* TODO: add platform data here */ 587 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 588 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 589 + .dev = { 590 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 591 + }, 535 592 }; 536 593 #endif 537 594 ··· 597 538 static struct platform_device bfin_tdm = { 598 539 .name = "bfin-tdm", 599 540 .id = CONFIG_SND_BF5XX_SPORT_NUM, 600 - /* TODO: add platform data here */ 541 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 542 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 543 + .dev = { 544 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 545 + }, 601 546 }; 602 547 #endif 603 548 ··· 646 583 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 647 584 .bus_num = 0, 648 585 .chip_select = 4, 586 + .platform_data = "ad1836", 649 587 .controller_data = &ad1836_spi_chip_info, 588 + .mode = SPI_MODE_3, 650 589 }, 651 590 #endif 652 591 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) ··· 1274 1209 1275 1210 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1276 1211 &ezkit_flash_device, 1212 + #endif 1213 + 1214 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1215 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 1216 + &bfin_pcm, 1277 1217 #endif 1278 1218 1279 1219 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+97 -9
arch/blackfin/mach-bf537/boards/stamp.c
··· 35 35 #include <asm/reboot.h> 36 36 #include <asm/portmux.h> 37 37 #include <asm/dpmc.h> 38 + #include <asm/bfin_sport.h> 38 39 #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE 39 40 #include <linux/regulator/fixed.h> 40 41 #endif ··· 2586 2585 }, 2587 2586 }; 2588 2587 2589 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2588 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 2589 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 2590 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2591 + 2592 + #define SPORT_REQ(x) \ 2593 + [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 2594 + P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} 2595 + 2596 + static const u16 bfin_snd_pin[][7] = { 2597 + SPORT_REQ(0), 2598 + SPORT_REQ(1), 2599 + }; 2600 + 2601 + static struct bfin_snd_platform_data bfin_snd_data[] = { 2602 + { 2603 + .pin_req = &bfin_snd_pin[0][0], 2604 + }, 2605 + { 2606 + .pin_req = &bfin_snd_pin[1][0], 2607 + }, 2608 + }; 2609 + 2610 + #define BFIN_SND_RES(x) \ 2611 + [x] = { \ 2612 + { \ 2613 + .start = SPORT##x##_TCR1, \ 2614 + .end = SPORT##x##_TCR1, \ 2615 + .flags = IORESOURCE_MEM \ 2616 + }, \ 2617 + { \ 2618 + .start = CH_SPORT##x##_RX, \ 2619 + .end = CH_SPORT##x##_RX, \ 2620 + .flags = IORESOURCE_DMA, \ 2621 + }, \ 2622 + { \ 2623 + .start = CH_SPORT##x##_TX, \ 2624 + .end = CH_SPORT##x##_TX, \ 2625 + .flags = IORESOURCE_DMA, \ 2626 + }, \ 2627 + { \ 2628 + .start = IRQ_SPORT##x##_ERROR, \ 2629 + .end = IRQ_SPORT##x##_ERROR, \ 2630 + .flags = IORESOURCE_IRQ, \ 2631 + } \ 2632 + } 2633 + 2634 + static struct resource bfin_snd_resources[][4] = { 2635 + BFIN_SND_RES(0), 2636 + BFIN_SND_RES(1), 2637 + }; 2638 + 2639 + static struct platform_device bfin_pcm = { 2640 + .name = "bfin-pcm-audio", 2641 + .id = -1, 2642 + }; 2643 + #endif 2644 + 2645 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 2646 + static struct platform_device bfin_ad73311_codec_device = { 2647 + .name = "ad73311", 2648 + .id = -1, 2649 + }; 2650 + #endif 2651 + 2652 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2590 2653 static struct platform_device bfin_i2s = { 2591 2654 .name = "bfin-i2s", 2592 2655 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2593 - /* TODO: add platform data here */ 2656 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2657 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2658 + .dev = { 2659 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2660 + }, 2594 2661 }; 2595 2662 #endif 2596 2663 2597 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2664 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 2598 2665 static struct platform_device bfin_tdm = { 2599 2666 .name = "bfin-tdm", 2600 2667 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2601 - /* TODO: add platform data here */ 2668 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2669 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2670 + .dev = { 2671 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2672 + }, 2602 2673 }; 2603 2674 #endif 2604 2675 2605 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2676 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2606 2677 static struct platform_device bfin_ac97 = { 2607 2678 .name = "bfin-ac97", 2608 2679 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2609 - /* TODO: add platform data here */ 2680 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 2681 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 2682 + .dev = { 2683 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 2684 + }, 2610 2685 }; 2611 2686 #endif 2612 2687 ··· 2873 2796 &stamp_flash_device, 2874 2797 #endif 2875 2798 2876 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2799 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 2800 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 2801 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2802 + &bfin_pcm, 2803 + #endif 2804 + 2805 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 2806 + &bfin_ad73311_codec_device, 2807 + #endif 2808 + 2809 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2877 2810 &bfin_i2s, 2878 2811 #endif 2879 2812 2880 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2813 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 2881 2814 &bfin_tdm, 2882 2815 #endif 2883 2816 2884 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2817 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2885 2818 &bfin_ac97, 2886 2819 #endif 2820 + 2887 2821 #if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) 2888 2822 #if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ 2889 2823 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
+100 -6
arch/blackfin/mach-bf548/boards/ezkit.c
··· 22 22 #include <asm/gpio.h> 23 23 #include <asm/nand.h> 24 24 #include <asm/dpmc.h> 25 + #include <asm/bfin_sport.h> 25 26 #include <asm/portmux.h> 26 27 #include <asm/bfin_sdh.h> 27 28 #include <mach/bf54x_keys.h> ··· 1321 1320 }, 1322 1321 }; 1323 1322 1324 - #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 1323 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1324 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 1325 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1326 + 1327 + #define SPORT_REQ(x) \ 1328 + [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 1329 + P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} 1330 + 1331 + static const u16 bfin_snd_pin[][7] = { 1332 + SPORT_REQ(0), 1333 + SPORT_REQ(1), 1334 + }; 1335 + 1336 + static struct bfin_snd_platform_data bfin_snd_data[] = { 1337 + { 1338 + .pin_req = &bfin_snd_pin[0][0], 1339 + }, 1340 + { 1341 + .pin_req = &bfin_snd_pin[1][0], 1342 + }, 1343 + }; 1344 + 1345 + #define BFIN_SND_RES(x) \ 1346 + [x] = { \ 1347 + { \ 1348 + .start = SPORT##x##_TCR1, \ 1349 + .end = SPORT##x##_TCR1, \ 1350 + .flags = IORESOURCE_MEM \ 1351 + }, \ 1352 + { \ 1353 + .start = CH_SPORT##x##_RX, \ 1354 + .end = CH_SPORT##x##_RX, \ 1355 + .flags = IORESOURCE_DMA, \ 1356 + }, \ 1357 + { \ 1358 + .start = CH_SPORT##x##_TX, \ 1359 + .end = CH_SPORT##x##_TX, \ 1360 + .flags = IORESOURCE_DMA, \ 1361 + }, \ 1362 + { \ 1363 + .start = IRQ_SPORT##x##_ERROR, \ 1364 + .end = IRQ_SPORT##x##_ERROR, \ 1365 + .flags = IORESOURCE_IRQ, \ 1366 + } \ 1367 + } 1368 + 1369 + static struct resource bfin_snd_resources[][4] = { 1370 + BFIN_SND_RES(0), 1371 + BFIN_SND_RES(1), 1372 + }; 1373 + 1374 + static struct platform_device bfin_pcm = { 1375 + .name = "bfin-pcm-audio", 1376 + .id = -1, 1377 + }; 1378 + #endif 1379 + 1380 + #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 1381 + static struct platform_device bfin_ad73311_codec_device = { 1382 + .name = "ad73311", 1383 + .id = -1, 1384 + }; 1385 + #endif 1386 + 1387 + #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 1388 + static struct platform_device bfin_ad1980_codec_device = { 1389 + .name = "ad1980", 1390 + .id = -1, 1391 + }; 1392 + #endif 1393 + 1394 + #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 1325 1395 static struct platform_device bfin_i2s = { 1326 1396 .name = "bfin-i2s", 1327 1397 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1328 - /* TODO: add platform data here */ 1398 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1399 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1400 + .dev = { 1401 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1402 + }, 1329 1403 }; 1330 1404 #endif 1331 1405 1332 - #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 1406 + #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) 1333 1407 static struct platform_device bfin_tdm = { 1334 1408 .name = "bfin-tdm", 1335 1409 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1336 - /* TODO: add platform data here */ 1410 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1411 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1412 + .dev = { 1413 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1414 + }, 1337 1415 }; 1338 1416 #endif 1339 1417 1340 - #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1418 + #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 1341 1419 static struct platform_device bfin_ac97 = { 1342 1420 .name = "bfin-ac97", 1343 1421 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1344 - /* TODO: add platform data here */ 1422 + .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), 1423 + .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], 1424 + .dev = { 1425 + .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], 1426 + }, 1345 1427 }; 1346 1428 #endif 1347 1429 ··· 1540 1456 1541 1457 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1542 1458 &ezkit_flash_device, 1459 + #endif 1460 + 1461 + #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1462 + defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ 1463 + defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1464 + &bfin_pcm, 1465 + #endif 1466 + 1467 + #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 1468 + &bfin_ad1980_codec_device, 1543 1469 #endif 1544 1470 1545 1471 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)