0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From fabd181287bd52afc523f10c27a7fd3a10969aa7 Mon Sep 17 00:00:00 2001
  2. From: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
  3. Date: Thu, 14 Apr 2016 00:57:33 +0100
  4. Subject: [PATCH 239/381] Modify IQAudIO DAC+ ASoC driver to set card/dai
  5. config from dt
  6. Add the ability to set the card name, dai name and dai stream name, from
  7. dt config.
  8. Signed-off-by: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
  9. ---
  10. sound/soc/bcm/iqaudio-dac.c | 13 ++++++++++---
  11. 1 file changed, 10 insertions(+), 3 deletions(-)
  12. --- a/sound/soc/bcm/iqaudio-dac.c
  13. +++ b/sound/soc/bcm/iqaudio-dac.c
  14. @@ -61,8 +61,6 @@ static struct snd_soc_ops snd_rpi_iqaudi
  15. static struct snd_soc_dai_link snd_rpi_iqaudio_dac_dai[] = {
  16. {
  17. - .name = "IQaudIO DAC",
  18. - .stream_name = "IQaudIO DAC HiFi",
  19. .cpu_dai_name = "bcm2708-i2s.0",
  20. .codec_dai_name = "pcm512x-hifi",
  21. .platform_name = "bcm2708-i2s.0",
  22. @@ -76,7 +74,6 @@ static struct snd_soc_dai_link snd_rpi_i
  23. /* audio machine driver */
  24. static struct snd_soc_card snd_rpi_iqaudio_dac = {
  25. - .name = "IQaudIODAC",
  26. .owner = THIS_MODULE,
  27. .dai_link = snd_rpi_iqaudio_dac_dai,
  28. .num_links = ARRAY_SIZE(snd_rpi_iqaudio_dac_dai),
  29. @@ -90,6 +87,7 @@ static int snd_rpi_iqaudio_dac_probe(str
  30. if (pdev->dev.of_node) {
  31. struct device_node *i2s_node;
  32. + struct snd_soc_card *card = &snd_rpi_iqaudio_dac;
  33. struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0];
  34. i2s_node = of_parse_phandle(pdev->dev.of_node,
  35. "i2s-controller", 0);
  36. @@ -103,6 +101,15 @@ static int snd_rpi_iqaudio_dac_probe(str
  37. digital_gain_0db_limit = !of_property_read_bool(pdev->dev.of_node,
  38. "iqaudio,24db_digital_gain");
  39. + if (of_property_read_string(pdev->dev.of_node, "card_name",
  40. + &card->name))
  41. + card->name = "IQaudIODAC";
  42. + if (of_property_read_string(pdev->dev.of_node, "dai_name",
  43. + &dai->name))
  44. + dai->name = "IQaudIO DAC";
  45. + if (of_property_read_string(pdev->dev.of_node, "dai_stream_name",
  46. + &dai->stream_name))
  47. + dai->stream_name = "IQaudIO DAC HiFi";
  48. }
  49. ret = snd_soc_register_card(&snd_rpi_iqaudio_dac);