diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-03-20 00:54:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-03-21 10:51:03 -0400 |
commit | e59289cda8dec0153fa396864c8ba8092ec3b80d (patch) | |
tree | c819d352f0ce0b92c8bf2ee53887ac53e13da3d5 /sound/soc/generic | |
parent | 0580dde59438686d60762b6da9229ebec693b94f (diff) |
ASoC: simple_card_utils: share common priv for simple-card/audio-graph
Historically, simple-card/simple-scu-card/audio-graph/audio-graph-scu
are similar but different generic sound card.
simple-scu-card which was for DPCM was merged into simple-card, and
audio-graph-scu which was for DPCM was merged into audio-graph.
simple-card is for non OF graph sound card, and
audio-graph is for OF graph sound card.
And, small detail difference (= function parameter, naming, etc)
between simple-card/audio-graph has been unified.
So today, the difference between simple-card/audio-graph are
just using OF graph style, or not.
In other words, there should no difference other than OF graph sytle.
simple-card/audio-graph are using own priv today , but we can merge it.
This patch merge it at simple_card_utils.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card.c | 96 | ||||
-rw-r--r-- | sound/soc/generic/simple-card.c | 57 |
2 files changed, 53 insertions, 100 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 2a95355540d1..656ca49ba727 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c | |||
@@ -20,25 +20,6 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <sound/simple_card_utils.h> | 21 | #include <sound/simple_card_utils.h> |
22 | 22 | ||
23 | struct graph_priv { | ||
24 | struct snd_soc_card snd_card; | ||
25 | struct graph_dai_props { | ||
26 | struct asoc_simple_dai *cpu_dai; | ||
27 | struct asoc_simple_dai *codec_dai; | ||
28 | struct snd_soc_dai_link_component codecs; /* single codec */ | ||
29 | struct snd_soc_dai_link_component platforms; | ||
30 | struct asoc_simple_card_data adata; | ||
31 | struct snd_soc_codec_conf *codec_conf; | ||
32 | unsigned int mclk_fs; | ||
33 | } *dai_props; | ||
34 | struct asoc_simple_jack hp_jack; | ||
35 | struct asoc_simple_jack mic_jack; | ||
36 | struct snd_soc_dai_link *dai_link; | ||
37 | struct asoc_simple_dai *dais; | ||
38 | struct snd_soc_codec_conf *codec_conf; | ||
39 | struct gpio_desc *pa_gpio; | ||
40 | }; | ||
41 | |||
42 | struct link_info { | 23 | struct link_info { |
43 | int dais; /* number of dai */ | 24 | int dais; /* number of dai */ |
44 | int link; /* number of link */ | 25 | int link; /* number of link */ |
@@ -46,11 +27,6 @@ struct link_info { | |||
46 | int cpu; /* turn for CPU / Codec */ | 27 | int cpu; /* turn for CPU / Codec */ |
47 | }; | 28 | }; |
48 | 29 | ||
49 | #define graph_priv_to_card(priv) (&(priv)->snd_card) | ||
50 | #define graph_priv_to_props(priv, i) ((priv)->dai_props + (i)) | ||
51 | #define graph_priv_to_dev(priv) (graph_priv_to_card(priv)->dev) | ||
52 | #define graph_priv_to_link(priv, i) (graph_priv_to_card(priv)->dai_link + (i)) | ||
53 | |||
54 | #define PREFIX "audio-graph-card," | 30 | #define PREFIX "audio-graph-card," |
55 | 31 | ||
56 | static int graph_outdrv_event(struct snd_soc_dapm_widget *w, | 32 | static int graph_outdrv_event(struct snd_soc_dapm_widget *w, |
@@ -58,7 +34,7 @@ static int graph_outdrv_event(struct snd_soc_dapm_widget *w, | |||
58 | int event) | 34 | int event) |
59 | { | 35 | { |
60 | struct snd_soc_dapm_context *dapm = w->dapm; | 36 | struct snd_soc_dapm_context *dapm = w->dapm; |
61 | struct graph_priv *priv = snd_soc_card_get_drvdata(dapm->card); | 37 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(dapm->card); |
62 | 38 | ||
63 | switch (event) { | 39 | switch (event) { |
64 | case SND_SOC_DAPM_POST_PMU: | 40 | case SND_SOC_DAPM_POST_PMU: |
@@ -83,8 +59,8 @@ static const struct snd_soc_dapm_widget graph_dapm_widgets[] = { | |||
83 | static int graph_startup(struct snd_pcm_substream *substream) | 59 | static int graph_startup(struct snd_pcm_substream *substream) |
84 | { | 60 | { |
85 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 61 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
86 | struct graph_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 62 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
87 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num); | 63 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
88 | int ret; | 64 | int ret; |
89 | 65 | ||
90 | ret = asoc_simple_card_clk_enable(dai_props->cpu_dai); | 66 | ret = asoc_simple_card_clk_enable(dai_props->cpu_dai); |
@@ -101,8 +77,8 @@ static int graph_startup(struct snd_pcm_substream *substream) | |||
101 | static void graph_shutdown(struct snd_pcm_substream *substream) | 77 | static void graph_shutdown(struct snd_pcm_substream *substream) |
102 | { | 78 | { |
103 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 79 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
104 | struct graph_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 80 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
105 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num); | 81 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
106 | 82 | ||
107 | asoc_simple_card_clk_disable(dai_props->cpu_dai); | 83 | asoc_simple_card_clk_disable(dai_props->cpu_dai); |
108 | 84 | ||
@@ -115,8 +91,8 @@ static int graph_hw_params(struct snd_pcm_substream *substream, | |||
115 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 91 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
116 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | 92 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
117 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 93 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
118 | struct graph_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 94 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
119 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num); | 95 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
120 | unsigned int mclk, mclk_fs = 0; | 96 | unsigned int mclk, mclk_fs = 0; |
121 | int ret = 0; | 97 | int ret = 0; |
122 | 98 | ||
@@ -148,8 +124,8 @@ static const struct snd_soc_ops graph_ops = { | |||
148 | 124 | ||
149 | static int graph_dai_init(struct snd_soc_pcm_runtime *rtd) | 125 | static int graph_dai_init(struct snd_soc_pcm_runtime *rtd) |
150 | { | 126 | { |
151 | struct graph_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 127 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
152 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num); | 128 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
153 | int ret = 0; | 129 | int ret = 0; |
154 | 130 | ||
155 | ret = asoc_simple_card_init_dai(rtd->codec_dai, | 131 | ret = asoc_simple_card_init_dai(rtd->codec_dai, |
@@ -168,8 +144,8 @@ static int graph_dai_init(struct snd_soc_pcm_runtime *rtd) | |||
168 | static int graph_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, | 144 | static int graph_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
169 | struct snd_pcm_hw_params *params) | 145 | struct snd_pcm_hw_params *params) |
170 | { | 146 | { |
171 | struct graph_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 147 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
172 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num); | 148 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
173 | 149 | ||
174 | asoc_simple_card_convert_fixup(&dai_props->adata, params); | 150 | asoc_simple_card_convert_fixup(&dai_props->adata, params); |
175 | 151 | ||
@@ -198,7 +174,7 @@ static void graph_parse_convert(struct device *dev, | |||
198 | 174 | ||
199 | static void graph_parse_mclk_fs(struct device_node *top, | 175 | static void graph_parse_mclk_fs(struct device_node *top, |
200 | struct device_node *ep, | 176 | struct device_node *ep, |
201 | struct graph_dai_props *props) | 177 | struct simple_dai_props *props) |
202 | { | 178 | { |
203 | struct device_node *port = of_get_parent(ep); | 179 | struct device_node *port = of_get_parent(ep); |
204 | struct device_node *ports = of_get_parent(port); | 180 | struct device_node *ports = of_get_parent(port); |
@@ -214,15 +190,15 @@ static void graph_parse_mclk_fs(struct device_node *top, | |||
214 | of_node_put(node); | 190 | of_node_put(node); |
215 | } | 191 | } |
216 | 192 | ||
217 | static int graph_dai_link_of_dpcm(struct graph_priv *priv, | 193 | static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, |
218 | struct device_node *cpu_ep, | 194 | struct device_node *cpu_ep, |
219 | struct device_node *codec_ep, | 195 | struct device_node *codec_ep, |
220 | struct link_info *li, | 196 | struct link_info *li, |
221 | int dup_codec) | 197 | int dup_codec) |
222 | { | 198 | { |
223 | struct device *dev = graph_priv_to_dev(priv); | 199 | struct device *dev = simple_priv_to_dev(priv); |
224 | struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, li->link); | 200 | struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); |
225 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, li->link); | 201 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); |
226 | struct device_node *top = dev->of_node; | 202 | struct device_node *top = dev->of_node; |
227 | struct device_node *ep = li->cpu ? cpu_ep : codec_ep; | 203 | struct device_node *ep = li->cpu ? cpu_ep : codec_ep; |
228 | struct device_node *port; | 204 | struct device_node *port; |
@@ -344,14 +320,14 @@ static int graph_dai_link_of_dpcm(struct graph_priv *priv, | |||
344 | return 0; | 320 | return 0; |
345 | } | 321 | } |
346 | 322 | ||
347 | static int graph_dai_link_of(struct graph_priv *priv, | 323 | static int graph_dai_link_of(struct asoc_simple_priv *priv, |
348 | struct device_node *cpu_ep, | 324 | struct device_node *cpu_ep, |
349 | struct device_node *codec_ep, | 325 | struct device_node *codec_ep, |
350 | struct link_info *li) | 326 | struct link_info *li) |
351 | { | 327 | { |
352 | struct device *dev = graph_priv_to_dev(priv); | 328 | struct device *dev = simple_priv_to_dev(priv); |
353 | struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, li->link); | 329 | struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); |
354 | struct graph_dai_props *dai_props = graph_priv_to_props(priv, li->link); | 330 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); |
355 | struct device_node *top = dev->of_node; | 331 | struct device_node *top = dev->of_node; |
356 | struct asoc_simple_dai *cpu_dai; | 332 | struct asoc_simple_dai *cpu_dai; |
357 | struct asoc_simple_dai *codec_dai; | 333 | struct asoc_simple_dai *codec_dai; |
@@ -420,19 +396,19 @@ static int graph_dai_link_of(struct graph_priv *priv, | |||
420 | return 0; | 396 | return 0; |
421 | } | 397 | } |
422 | 398 | ||
423 | static int graph_for_each_link(struct graph_priv *priv, | 399 | static int graph_for_each_link(struct asoc_simple_priv *priv, |
424 | struct link_info *li, | 400 | struct link_info *li, |
425 | int (*func_noml)(struct graph_priv *priv, | 401 | int (*func_noml)(struct asoc_simple_priv *priv, |
426 | struct device_node *cpu_ep, | 402 | struct device_node *cpu_ep, |
427 | struct device_node *codec_ep, | 403 | struct device_node *codec_ep, |
428 | struct link_info *li), | 404 | struct link_info *li), |
429 | int (*func_dpcm)(struct graph_priv *priv, | 405 | int (*func_dpcm)(struct asoc_simple_priv *priv, |
430 | struct device_node *cpu_ep, | 406 | struct device_node *cpu_ep, |
431 | struct device_node *codec_ep, | 407 | struct device_node *codec_ep, |
432 | struct link_info *li, int dup_codec)) | 408 | struct link_info *li, int dup_codec)) |
433 | { | 409 | { |
434 | struct of_phandle_iterator it; | 410 | struct of_phandle_iterator it; |
435 | struct device *dev = graph_priv_to_dev(priv); | 411 | struct device *dev = simple_priv_to_dev(priv); |
436 | struct device_node *node = dev->of_node; | 412 | struct device_node *node = dev->of_node; |
437 | struct device_node *cpu_port; | 413 | struct device_node *cpu_port; |
438 | struct device_node *cpu_ep; | 414 | struct device_node *cpu_ep; |
@@ -488,9 +464,9 @@ static int graph_for_each_link(struct graph_priv *priv, | |||
488 | return 0; | 464 | return 0; |
489 | } | 465 | } |
490 | 466 | ||
491 | static int graph_parse_of(struct graph_priv *priv) | 467 | static int graph_parse_of(struct asoc_simple_priv *priv) |
492 | { | 468 | { |
493 | struct snd_soc_card *card = graph_priv_to_card(priv); | 469 | struct snd_soc_card *card = simple_priv_to_card(priv); |
494 | struct link_info li; | 470 | struct link_info li; |
495 | int ret; | 471 | int ret; |
496 | 472 | ||
@@ -526,12 +502,12 @@ static int graph_parse_of(struct graph_priv *priv) | |||
526 | return asoc_simple_card_parse_card_name(card, NULL); | 502 | return asoc_simple_card_parse_card_name(card, NULL); |
527 | } | 503 | } |
528 | 504 | ||
529 | static int graph_count_noml(struct graph_priv *priv, | 505 | static int graph_count_noml(struct asoc_simple_priv *priv, |
530 | struct device_node *cpu_ep, | 506 | struct device_node *cpu_ep, |
531 | struct device_node *codec_ep, | 507 | struct device_node *codec_ep, |
532 | struct link_info *li) | 508 | struct link_info *li) |
533 | { | 509 | { |
534 | struct device *dev = graph_priv_to_dev(priv); | 510 | struct device *dev = simple_priv_to_dev(priv); |
535 | 511 | ||
536 | li->link += 1; /* 1xCPU-Codec */ | 512 | li->link += 1; /* 1xCPU-Codec */ |
537 | li->dais += 2; /* 1xCPU + 1xCodec */ | 513 | li->dais += 2; /* 1xCPU + 1xCodec */ |
@@ -541,13 +517,13 @@ static int graph_count_noml(struct graph_priv *priv, | |||
541 | return 0; | 517 | return 0; |
542 | } | 518 | } |
543 | 519 | ||
544 | static int graph_count_dpcm(struct graph_priv *priv, | 520 | static int graph_count_dpcm(struct asoc_simple_priv *priv, |
545 | struct device_node *cpu_ep, | 521 | struct device_node *cpu_ep, |
546 | struct device_node *codec_ep, | 522 | struct device_node *codec_ep, |
547 | struct link_info *li, | 523 | struct link_info *li, |
548 | int dup_codec) | 524 | int dup_codec) |
549 | { | 525 | { |
550 | struct device *dev = graph_priv_to_dev(priv); | 526 | struct device *dev = simple_priv_to_dev(priv); |
551 | 527 | ||
552 | li->link++; /* 1xCPU-dummy */ | 528 | li->link++; /* 1xCPU-dummy */ |
553 | li->dais++; /* 1xCPU */ | 529 | li->dais++; /* 1xCPU */ |
@@ -563,10 +539,10 @@ static int graph_count_dpcm(struct graph_priv *priv, | |||
563 | return 0; | 539 | return 0; |
564 | } | 540 | } |
565 | 541 | ||
566 | static void graph_get_dais_count(struct graph_priv *priv, | 542 | static void graph_get_dais_count(struct asoc_simple_priv *priv, |
567 | struct link_info *li) | 543 | struct link_info *li) |
568 | { | 544 | { |
569 | struct device *dev = graph_priv_to_dev(priv); | 545 | struct device *dev = simple_priv_to_dev(priv); |
570 | 546 | ||
571 | /* | 547 | /* |
572 | * link_num : number of links. | 548 | * link_num : number of links. |
@@ -623,7 +599,7 @@ static void graph_get_dais_count(struct graph_priv *priv, | |||
623 | 599 | ||
624 | static int graph_card_probe(struct snd_soc_card *card) | 600 | static int graph_card_probe(struct snd_soc_card *card) |
625 | { | 601 | { |
626 | struct graph_priv *priv = snd_soc_card_get_drvdata(card); | 602 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); |
627 | int ret; | 603 | int ret; |
628 | 604 | ||
629 | ret = asoc_simple_card_init_hp(card, &priv->hp_jack, NULL); | 605 | ret = asoc_simple_card_init_hp(card, &priv->hp_jack, NULL); |
@@ -639,9 +615,9 @@ static int graph_card_probe(struct snd_soc_card *card) | |||
639 | 615 | ||
640 | static int graph_probe(struct platform_device *pdev) | 616 | static int graph_probe(struct platform_device *pdev) |
641 | { | 617 | { |
642 | struct graph_priv *priv; | 618 | struct asoc_simple_priv *priv; |
643 | struct snd_soc_dai_link *dai_link; | 619 | struct snd_soc_dai_link *dai_link; |
644 | struct graph_dai_props *dai_props; | 620 | struct simple_dai_props *dai_props; |
645 | struct asoc_simple_dai *dais; | 621 | struct asoc_simple_dai *dais; |
646 | struct device *dev = &pdev->dev; | 622 | struct device *dev = &pdev->dev; |
647 | struct snd_soc_card *card; | 623 | struct snd_soc_card *card; |
@@ -654,7 +630,7 @@ static int graph_probe(struct platform_device *pdev) | |||
654 | if (!priv) | 630 | if (!priv) |
655 | return -ENOMEM; | 631 | return -ENOMEM; |
656 | 632 | ||
657 | card = graph_priv_to_card(priv); | 633 | card = simple_priv_to_card(priv); |
658 | card->owner = THIS_MODULE; | 634 | card->owner = THIS_MODULE; |
659 | card->dev = dev; | 635 | card->dev = dev; |
660 | card->dapm_widgets = graph_dapm_widgets; | 636 | card->dapm_widgets = graph_dapm_widgets; |
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 77899624787e..628c19a3aaff 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -15,24 +15,6 @@ | |||
15 | #include <sound/soc-dai.h> | 15 | #include <sound/soc-dai.h> |
16 | #include <sound/soc.h> | 16 | #include <sound/soc.h> |
17 | 17 | ||
18 | struct simple_priv { | ||
19 | struct snd_soc_card snd_card; | ||
20 | struct simple_dai_props { | ||
21 | struct asoc_simple_dai *cpu_dai; | ||
22 | struct asoc_simple_dai *codec_dai; | ||
23 | struct snd_soc_dai_link_component codecs; /* single codec */ | ||
24 | struct snd_soc_dai_link_component platforms; | ||
25 | struct asoc_simple_card_data adata; | ||
26 | struct snd_soc_codec_conf *codec_conf; | ||
27 | unsigned int mclk_fs; | ||
28 | } *dai_props; | ||
29 | struct asoc_simple_jack hp_jack; | ||
30 | struct asoc_simple_jack mic_jack; | ||
31 | struct snd_soc_dai_link *dai_link; | ||
32 | struct asoc_simple_dai *dais; | ||
33 | struct snd_soc_codec_conf *codec_conf; | ||
34 | }; | ||
35 | |||
36 | struct link_info { | 18 | struct link_info { |
37 | int dais; /* number of dai */ | 19 | int dais; /* number of dai */ |
38 | int link; /* number of link */ | 20 | int link; /* number of link */ |
@@ -40,11 +22,6 @@ struct link_info { | |||
40 | int cpu; /* turn for CPU / Codec */ | 22 | int cpu; /* turn for CPU / Codec */ |
41 | }; | 23 | }; |
42 | 24 | ||
43 | #define simple_priv_to_card(priv) (&(priv)->snd_card) | ||
44 | #define simple_priv_to_props(priv, i) ((priv)->dai_props + (i)) | ||
45 | #define simple_priv_to_dev(priv) (simple_priv_to_card(priv)->dev) | ||
46 | #define simple_priv_to_link(priv, i) (simple_priv_to_card(priv)->dai_link + (i)) | ||
47 | |||
48 | #define DAI "sound-dai" | 25 | #define DAI "sound-dai" |
49 | #define CELL "#sound-dai-cells" | 26 | #define CELL "#sound-dai-cells" |
50 | #define PREFIX "simple-audio-card," | 27 | #define PREFIX "simple-audio-card," |
@@ -52,7 +29,7 @@ struct link_info { | |||
52 | static int simple_startup(struct snd_pcm_substream *substream) | 29 | static int simple_startup(struct snd_pcm_substream *substream) |
53 | { | 30 | { |
54 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 31 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
55 | struct simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 32 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
56 | struct simple_dai_props *dai_props = | 33 | struct simple_dai_props *dai_props = |
57 | simple_priv_to_props(priv, rtd->num); | 34 | simple_priv_to_props(priv, rtd->num); |
58 | int ret; | 35 | int ret; |
@@ -71,7 +48,7 @@ static int simple_startup(struct snd_pcm_substream *substream) | |||
71 | static void simple_shutdown(struct snd_pcm_substream *substream) | 48 | static void simple_shutdown(struct snd_pcm_substream *substream) |
72 | { | 49 | { |
73 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 50 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
74 | struct simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 51 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
75 | struct simple_dai_props *dai_props = | 52 | struct simple_dai_props *dai_props = |
76 | simple_priv_to_props(priv, rtd->num); | 53 | simple_priv_to_props(priv, rtd->num); |
77 | 54 | ||
@@ -101,7 +78,7 @@ static int simple_hw_params(struct snd_pcm_substream *substream, | |||
101 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 78 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
102 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | 79 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
103 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 80 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
104 | struct simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 81 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
105 | struct simple_dai_props *dai_props = | 82 | struct simple_dai_props *dai_props = |
106 | simple_priv_to_props(priv, rtd->num); | 83 | simple_priv_to_props(priv, rtd->num); |
107 | unsigned int mclk, mclk_fs = 0; | 84 | unsigned int mclk, mclk_fs = 0; |
@@ -144,7 +121,7 @@ static const struct snd_soc_ops simple_ops = { | |||
144 | 121 | ||
145 | static int simple_dai_init(struct snd_soc_pcm_runtime *rtd) | 122 | static int simple_dai_init(struct snd_soc_pcm_runtime *rtd) |
146 | { | 123 | { |
147 | struct simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 124 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
148 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); | 125 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
149 | int ret; | 126 | int ret; |
150 | 127 | ||
@@ -164,7 +141,7 @@ static int simple_dai_init(struct snd_soc_pcm_runtime *rtd) | |||
164 | static int simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, | 141 | static int simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
165 | struct snd_pcm_hw_params *params) | 142 | struct snd_pcm_hw_params *params) |
166 | { | 143 | { |
167 | struct simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); | 144 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); |
168 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); | 145 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); |
169 | 146 | ||
170 | asoc_simple_card_convert_fixup(&dai_props->adata, params); | 147 | asoc_simple_card_convert_fixup(&dai_props->adata, params); |
@@ -207,7 +184,7 @@ static void simple_parse_mclk_fs(struct device_node *top, | |||
207 | of_node_put(node); | 184 | of_node_put(node); |
208 | } | 185 | } |
209 | 186 | ||
210 | static int simple_dai_link_of_dpcm(struct simple_priv *priv, | 187 | static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, |
211 | struct device_node *np, | 188 | struct device_node *np, |
212 | struct device_node *codec, | 189 | struct device_node *codec, |
213 | struct link_info *li, | 190 | struct link_info *li, |
@@ -336,7 +313,7 @@ static int simple_dai_link_of_dpcm(struct simple_priv *priv, | |||
336 | return 0; | 313 | return 0; |
337 | } | 314 | } |
338 | 315 | ||
339 | static int simple_dai_link_of(struct simple_priv *priv, | 316 | static int simple_dai_link_of(struct asoc_simple_priv *priv, |
340 | struct device_node *np, | 317 | struct device_node *np, |
341 | struct device_node *codec, | 318 | struct device_node *codec, |
342 | struct link_info *li, | 319 | struct link_info *li, |
@@ -438,13 +415,13 @@ dai_link_of_err: | |||
438 | return ret; | 415 | return ret; |
439 | } | 416 | } |
440 | 417 | ||
441 | static int simple_for_each_link(struct simple_priv *priv, | 418 | static int simple_for_each_link(struct asoc_simple_priv *priv, |
442 | struct link_info *li, | 419 | struct link_info *li, |
443 | int (*func_noml)(struct simple_priv *priv, | 420 | int (*func_noml)(struct asoc_simple_priv *priv, |
444 | struct device_node *np, | 421 | struct device_node *np, |
445 | struct device_node *codec, | 422 | struct device_node *codec, |
446 | struct link_info *li, bool is_top), | 423 | struct link_info *li, bool is_top), |
447 | int (*func_dpcm)(struct simple_priv *priv, | 424 | int (*func_dpcm)(struct asoc_simple_priv *priv, |
448 | struct device_node *np, | 425 | struct device_node *np, |
449 | struct device_node *codec, | 426 | struct device_node *codec, |
450 | struct link_info *li, bool is_top)) | 427 | struct link_info *li, bool is_top)) |
@@ -513,7 +490,7 @@ static int simple_for_each_link(struct simple_priv *priv, | |||
513 | } | 490 | } |
514 | 491 | ||
515 | static int simple_parse_aux_devs(struct device_node *node, | 492 | static int simple_parse_aux_devs(struct device_node *node, |
516 | struct simple_priv *priv) | 493 | struct asoc_simple_priv *priv) |
517 | { | 494 | { |
518 | struct device *dev = simple_priv_to_dev(priv); | 495 | struct device *dev = simple_priv_to_dev(priv); |
519 | struct device_node *aux_node; | 496 | struct device_node *aux_node; |
@@ -543,7 +520,7 @@ static int simple_parse_aux_devs(struct device_node *node, | |||
543 | return 0; | 520 | return 0; |
544 | } | 521 | } |
545 | 522 | ||
546 | static int simple_parse_of(struct simple_priv *priv) | 523 | static int simple_parse_of(struct asoc_simple_priv *priv) |
547 | { | 524 | { |
548 | struct device *dev = simple_priv_to_dev(priv); | 525 | struct device *dev = simple_priv_to_dev(priv); |
549 | struct device_node *top = dev->of_node; | 526 | struct device_node *top = dev->of_node; |
@@ -593,7 +570,7 @@ static int simple_parse_of(struct simple_priv *priv) | |||
593 | return ret; | 570 | return ret; |
594 | } | 571 | } |
595 | 572 | ||
596 | static int simple_count_noml(struct simple_priv *priv, | 573 | static int simple_count_noml(struct asoc_simple_priv *priv, |
597 | struct device_node *np, | 574 | struct device_node *np, |
598 | struct device_node *codec, | 575 | struct device_node *codec, |
599 | struct link_info *li, bool is_top) | 576 | struct link_info *li, bool is_top) |
@@ -605,7 +582,7 @@ static int simple_count_noml(struct simple_priv *priv, | |||
605 | return 0; | 582 | return 0; |
606 | } | 583 | } |
607 | 584 | ||
608 | static int simple_count_dpcm(struct simple_priv *priv, | 585 | static int simple_count_dpcm(struct asoc_simple_priv *priv, |
609 | struct device_node *np, | 586 | struct device_node *np, |
610 | struct device_node *codec, | 587 | struct device_node *codec, |
611 | struct link_info *li, bool is_top) | 588 | struct link_info *li, bool is_top) |
@@ -618,7 +595,7 @@ static int simple_count_dpcm(struct simple_priv *priv, | |||
618 | return 0; | 595 | return 0; |
619 | } | 596 | } |
620 | 597 | ||
621 | static void simple_get_dais_count(struct simple_priv *priv, | 598 | static void simple_get_dais_count(struct asoc_simple_priv *priv, |
622 | struct link_info *li) | 599 | struct link_info *li) |
623 | { | 600 | { |
624 | struct device *dev = simple_priv_to_dev(priv); | 601 | struct device *dev = simple_priv_to_dev(priv); |
@@ -687,7 +664,7 @@ static void simple_get_dais_count(struct simple_priv *priv, | |||
687 | 664 | ||
688 | static int simple_soc_probe(struct snd_soc_card *card) | 665 | static int simple_soc_probe(struct snd_soc_card *card) |
689 | { | 666 | { |
690 | struct simple_priv *priv = snd_soc_card_get_drvdata(card); | 667 | struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); |
691 | int ret; | 668 | int ret; |
692 | 669 | ||
693 | ret = asoc_simple_card_init_hp(card, &priv->hp_jack, PREFIX); | 670 | ret = asoc_simple_card_init_hp(card, &priv->hp_jack, PREFIX); |
@@ -703,7 +680,7 @@ static int simple_soc_probe(struct snd_soc_card *card) | |||
703 | 680 | ||
704 | static int simple_probe(struct platform_device *pdev) | 681 | static int simple_probe(struct platform_device *pdev) |
705 | { | 682 | { |
706 | struct simple_priv *priv; | 683 | struct asoc_simple_priv *priv; |
707 | struct snd_soc_dai_link *dai_link; | 684 | struct snd_soc_dai_link *dai_link; |
708 | struct simple_dai_props *dai_props; | 685 | struct simple_dai_props *dai_props; |
709 | struct asoc_simple_dai *dais; | 686 | struct asoc_simple_dai *dais; |