brcm2708: update linux 4.4 patches to latest version
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-4.4 / 0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch
1 From e26827db219f8221e20aba5e7f564d61b4fa2be3 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/423] Modify IQAudIO DAC+ ASoC driver to set card/dai
5 config from dt
6
7 Add the ability to set the card name, dai name and dai stream name, from
8 dt config.
9
10 Signed-off-by: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
11 ---
12 sound/soc/bcm/iqaudio-dac.c | 13 ++++++++++---
13 1 file changed, 10 insertions(+), 3 deletions(-)
14
15 --- a/sound/soc/bcm/iqaudio-dac.c
16 +++ b/sound/soc/bcm/iqaudio-dac.c
17 @@ -61,8 +61,6 @@ static struct snd_soc_ops snd_rpi_iqaudi
18
19 static struct snd_soc_dai_link snd_rpi_iqaudio_dac_dai[] = {
20 {
21 - .name = "IQaudIO DAC",
22 - .stream_name = "IQaudIO DAC HiFi",
23 .cpu_dai_name = "bcm2708-i2s.0",
24 .codec_dai_name = "pcm512x-hifi",
25 .platform_name = "bcm2708-i2s.0",
26 @@ -76,7 +74,6 @@ static struct snd_soc_dai_link snd_rpi_i
27
28 /* audio machine driver */
29 static struct snd_soc_card snd_rpi_iqaudio_dac = {
30 - .name = "IQaudIODAC",
31 .owner = THIS_MODULE,
32 .dai_link = snd_rpi_iqaudio_dac_dai,
33 .num_links = ARRAY_SIZE(snd_rpi_iqaudio_dac_dai),
34 @@ -90,6 +87,7 @@ static int snd_rpi_iqaudio_dac_probe(str
35
36 if (pdev->dev.of_node) {
37 struct device_node *i2s_node;
38 + struct snd_soc_card *card = &snd_rpi_iqaudio_dac;
39 struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0];
40 i2s_node = of_parse_phandle(pdev->dev.of_node,
41 "i2s-controller", 0);
42 @@ -103,6 +101,15 @@ static int snd_rpi_iqaudio_dac_probe(str
43
44 digital_gain_0db_limit = !of_property_read_bool(pdev->dev.of_node,
45 "iqaudio,24db_digital_gain");
46 + if (of_property_read_string(pdev->dev.of_node, "card_name",
47 + &card->name))
48 + card->name = "IQaudIODAC";
49 + if (of_property_read_string(pdev->dev.of_node, "dai_name",
50 + &dai->name))
51 + dai->name = "IQaudIO DAC";
52 + if (of_property_read_string(pdev->dev.of_node, "dai_stream_name",
53 + &dai->stream_name))
54 + dai->stream_name = "IQaudIO DAC HiFi";
55 }
56
57 ret = snd_soc_register_card(&snd_rpi_iqaudio_dac);