diff options
author | Sameer Pujar <spujar@nvidia.com> | 2017-12-26 06:45:12 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-27 03:13:35 -0500 |
commit | d67bb8355b30fecd43acfe1e6d54521fec0b6b42 (patch) | |
tree | d6ca04417880c3eb648a2b481c6772957c88d227 /sound/pci/hda | |
parent | 89f7bf0a89db706f2bdc48f2030327dd10b06126 (diff) |
t19x: hda: parse card name from device tree
Galen requires a unique sound card to be registered for android audio.
This is to avoid conflicts with previous platform, since we maintain
an unified audio XML.
Bug 200375020
Change-Id: Ife37f72d2c179c8480cfaf059c334dcc6673906e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1626537
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_tegra.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 883e27c92..1a8262d1d 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c | |||
@@ -465,6 +465,7 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) | |||
465 | int err; | 465 | int err; |
466 | unsigned short gcap; | 466 | unsigned short gcap; |
467 | int irq_id = platform_get_irq(pdev, 0); | 467 | int irq_id = platform_get_irq(pdev, 0); |
468 | const char *card_name; | ||
468 | 469 | ||
469 | err = hda_tegra_init_chip(chip, pdev); | 470 | err = hda_tegra_init_chip(chip, pdev); |
470 | if (err) | 471 | if (err) |
@@ -524,8 +525,18 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) | |||
524 | return -ENODEV; | 525 | return -ENODEV; |
525 | } | 526 | } |
526 | 527 | ||
527 | strcpy(card->driver, "tegra-hda"); | 528 | |
528 | strcpy(card->shortname, "tegra-hda"); | 529 | /* xavier onwards, passing card name from DT */ |
530 | if (!of_property_read_string(pdev->dev.of_node, "hda,card-name", | ||
531 | &card_name)) { | ||
532 | strcpy(card->driver, card_name); | ||
533 | strcpy(card->shortname, card_name); | ||
534 | } else { | ||
535 | /* for platforms < xavier */ | ||
536 | strcpy(card->driver, "tegra-hda"); | ||
537 | strcpy(card->shortname, "tegra-hda"); | ||
538 | } | ||
539 | |||
529 | snprintf(card->longname, sizeof(card->longname), | 540 | snprintf(card->longname, sizeof(card->longname), |
530 | "%s at 0x%lx irq %i", | 541 | "%s at 0x%lx irq %i", |
531 | card->shortname, bus->addr, bus->irq); | 542 | card->shortname, bus->addr, bus->irq); |