Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / sound / soc / generic / audio-graph-card.c
blob16a04a67882829003aa7ee6a4fc2139b157e48a0
1 // SPDX-License-Identifier: GPL-2.0
2 //
3 // ASoC audio graph sound card support
4 //
5 // Copyright (C) 2016 Renesas Solutions Corp.
6 // Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7 //
8 // based on ${LINUX}/sound/soc/generic/simple-card.c
10 #include <linux/clk.h>
11 #include <linux/device.h>
12 #include <linux/gpio.h>
13 #include <linux/gpio/consumer.h>
14 #include <linux/module.h>
15 #include <linux/of.h>
16 #include <linux/of_device.h>
17 #include <linux/of_gpio.h>
18 #include <linux/of_graph.h>
19 #include <linux/platform_device.h>
20 #include <linux/string.h>
21 #include <sound/graph_card.h>
23 #define DPCM_SELECTABLE 1
25 #define PREFIX "audio-graph-card,"
27 static int graph_outdrv_event(struct snd_soc_dapm_widget *w,
28 struct snd_kcontrol *kcontrol,
29 int event)
31 struct snd_soc_dapm_context *dapm = w->dapm;
32 struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(dapm->card);
34 switch (event) {
35 case SND_SOC_DAPM_POST_PMU:
36 gpiod_set_value_cansleep(priv->pa_gpio, 1);
37 break;
38 case SND_SOC_DAPM_PRE_PMD:
39 gpiod_set_value_cansleep(priv->pa_gpio, 0);
40 break;
41 default:
42 return -EINVAL;
45 return 0;
48 static const struct snd_soc_dapm_widget graph_dapm_widgets[] = {
49 SND_SOC_DAPM_OUT_DRV_E("Amplifier", SND_SOC_NOPM,
50 0, 0, NULL, 0, graph_outdrv_event,
51 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
54 static const struct snd_soc_ops graph_ops = {
55 .startup = asoc_simple_startup,
56 .shutdown = asoc_simple_shutdown,
57 .hw_params = asoc_simple_hw_params,
60 static int graph_get_dai_id(struct device_node *ep)
62 struct device_node *node;
63 struct device_node *endpoint;
64 struct of_endpoint info;
65 int i, id;
66 const u32 *reg;
67 int ret;
69 /* use driver specified DAI ID if exist */
70 ret = snd_soc_get_dai_id(ep);
71 if (ret != -ENOTSUPP)
72 return ret;
74 /* use endpoint/port reg if exist */
75 ret = of_graph_parse_endpoint(ep, &info);
76 if (ret == 0) {
78 * Because it will count port/endpoint if it doesn't have "reg".
79 * But, we can't judge whether it has "no reg", or "reg = <0>"
80 * only of_graph_parse_endpoint().
81 * We need to check "reg" property
83 if (of_get_property(ep, "reg", NULL))
84 return info.id;
86 node = of_get_parent(ep);
87 reg = of_get_property(node, "reg", NULL);
88 of_node_put(node);
89 if (reg)
90 return info.port;
92 node = of_graph_get_port_parent(ep);
95 * Non HDMI sound case, counting port/endpoint on its DT
96 * is enough. Let's count it.
98 i = 0;
99 id = -1;
100 for_each_endpoint_of_node(node, endpoint) {
101 if (endpoint == ep)
102 id = i;
103 i++;
106 of_node_put(node);
108 if (id < 0)
109 return -ENODEV;
111 return id;
114 static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
116 struct snd_soc_dai *dai = snd_soc_find_dai_with_mutex(dlc);
118 if (dai && (dai->component->driver->pcm_construct ||
119 dai->driver->pcm_new))
120 return true;
122 return false;
125 static int asoc_simple_parse_dai(struct device_node *ep,
126 struct snd_soc_dai_link_component *dlc,
127 int *is_single_link)
129 struct device_node *node;
130 struct of_phandle_args args;
131 int ret;
133 if (!ep)
134 return 0;
136 node = of_graph_get_port_parent(ep);
138 /* Get dai->name */
139 args.np = node;
140 args.args[0] = graph_get_dai_id(ep);
141 args.args_count = (of_graph_get_endpoint_count(node) > 1);
144 * FIXME
146 * Here, dlc->dai_name is pointer to CPU/Codec DAI name.
147 * If user unbinded CPU or Codec driver, but not for Sound Card,
148 * dlc->dai_name is keeping unbinded CPU or Codec
149 * driver's pointer.
151 * If user re-bind CPU or Codec driver again, ALSA SoC will try
152 * to rebind Card via snd_soc_try_rebind_card(), but because of
153 * above reason, it might can't bind Sound Card.
154 * Because Sound Card is pointing to released dai_name pointer.
156 * To avoid this rebind Card issue,
157 * 1) It needs to alloc memory to keep dai_name eventhough
158 * CPU or Codec driver was unbinded, or
159 * 2) user need to rebind Sound Card everytime
160 * if he unbinded CPU or Codec.
162 ret = snd_soc_get_dai_name(&args, &dlc->dai_name);
163 if (ret < 0)
164 return ret;
166 dlc->of_node = node;
168 if (is_single_link)
169 *is_single_link = of_graph_get_endpoint_count(node) == 1;
171 return 0;
174 static void graph_parse_convert(struct device *dev,
175 struct device_node *ep,
176 struct asoc_simple_data *adata)
178 struct device_node *top = dev->of_node;
179 struct device_node *port = of_get_parent(ep);
180 struct device_node *ports = of_get_parent(port);
181 struct device_node *node = of_graph_get_port_parent(ep);
183 asoc_simple_parse_convert(dev, top, NULL, adata);
184 asoc_simple_parse_convert(dev, node, PREFIX, adata);
185 asoc_simple_parse_convert(dev, ports, NULL, adata);
186 asoc_simple_parse_convert(dev, port, NULL, adata);
187 asoc_simple_parse_convert(dev, ep, NULL, adata);
189 of_node_put(port);
190 of_node_put(ports);
191 of_node_put(node);
194 static void graph_parse_mclk_fs(struct device_node *top,
195 struct device_node *ep,
196 struct simple_dai_props *props)
198 struct device_node *port = of_get_parent(ep);
199 struct device_node *ports = of_get_parent(port);
200 struct device_node *node = of_graph_get_port_parent(ep);
202 of_property_read_u32(top, "mclk-fs", &props->mclk_fs);
203 of_property_read_u32(ports, "mclk-fs", &props->mclk_fs);
204 of_property_read_u32(port, "mclk-fs", &props->mclk_fs);
205 of_property_read_u32(ep, "mclk-fs", &props->mclk_fs);
207 of_node_put(port);
208 of_node_put(ports);
209 of_node_put(node);
212 static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
213 struct device_node *cpu_ep,
214 struct device_node *codec_ep,
215 struct link_info *li,
216 int dup_codec)
218 struct device *dev = simple_priv_to_dev(priv);
219 struct snd_soc_card *card = simple_priv_to_card(priv);
220 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
221 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
222 struct device_node *top = dev->of_node;
223 struct device_node *ep = li->cpu ? cpu_ep : codec_ep;
224 struct device_node *port;
225 struct device_node *ports;
226 struct device_node *node;
227 struct asoc_simple_dai *dai;
228 struct snd_soc_dai_link_component *cpus = dai_link->cpus;
229 struct snd_soc_dai_link_component *codecs = dai_link->codecs;
230 int ret;
233 * Codec endpoint can be NULL for pluggable audio HW.
234 * Platform DT can populate the Codec endpoint depending on the
235 * plugged HW.
237 if (!li->cpu && !codec_ep)
238 return 0;
240 /* Do it all CPU endpoint, and 1st Codec endpoint */
241 if (!li->cpu && dup_codec)
242 return 0;
244 port = of_get_parent(ep);
245 ports = of_get_parent(port);
246 node = of_graph_get_port_parent(ep);
248 li->link++;
250 dev_dbg(dev, "link_of DPCM (%pOF)\n", ep);
252 if (li->cpu) {
253 int is_single_links = 0;
255 /* Codec is dummy */
256 codecs->of_node = NULL;
257 codecs->dai_name = "snd-soc-dummy-dai";
258 codecs->name = "snd-soc-dummy";
260 /* FE settings */
261 dai_link->dynamic = 1;
262 dai_link->dpcm_merged_format = 1;
264 dai =
265 dai_props->cpu_dai = &priv->dais[li->dais++];
267 ret = asoc_simple_parse_cpu(ep, dai_link, &is_single_links);
268 if (ret)
269 goto out_put_node;
271 ret = asoc_simple_parse_clk_cpu(dev, ep, dai_link, dai);
272 if (ret < 0)
273 goto out_put_node;
275 ret = asoc_simple_set_dailink_name(dev, dai_link,
276 "fe.%pOFP.%s",
277 cpus->of_node,
278 cpus->dai_name);
279 if (ret < 0)
280 goto out_put_node;
283 * In BE<->BE connections it is not required to create
284 * PCM devices at CPU end of the dai link and thus 'no_pcm'
285 * flag needs to be set. It is useful when there are many
286 * BE components and some of these have to be connected to
287 * form a valid audio path.
289 * For example: FE <-> BE1 <-> BE2 <-> ... <-> BEn where
290 * there are 'n' BE components in the path.
292 if (card->component_chaining && !soc_component_is_pcm(cpus))
293 dai_link->no_pcm = 1;
295 /* card->num_links includes Codec */
296 asoc_simple_canonicalize_cpu(dai_link, is_single_links);
297 } else {
298 struct snd_soc_codec_conf *cconf;
300 /* CPU is dummy */
301 cpus->of_node = NULL;
302 cpus->dai_name = "snd-soc-dummy-dai";
303 cpus->name = "snd-soc-dummy";
305 /* BE settings */
306 dai_link->no_pcm = 1;
307 dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
309 dai =
310 dai_props->codec_dai = &priv->dais[li->dais++];
312 cconf =
313 dai_props->codec_conf = &priv->codec_conf[li->conf++];
315 ret = asoc_simple_parse_codec(ep, dai_link);
316 if (ret < 0)
317 goto out_put_node;
319 ret = asoc_simple_parse_clk_codec(dev, ep, dai_link, dai);
320 if (ret < 0)
321 goto out_put_node;
323 ret = asoc_simple_set_dailink_name(dev, dai_link,
324 "be.%pOFP.%s",
325 codecs->of_node,
326 codecs->dai_name);
327 if (ret < 0)
328 goto out_put_node;
330 /* check "prefix" from top node */
331 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,
332 "prefix");
333 snd_soc_of_parse_node_prefix(node, cconf, codecs->of_node,
334 PREFIX "prefix");
335 snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node,
336 "prefix");
337 snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node,
338 "prefix");
341 graph_parse_convert(dev, ep, &dai_props->adata);
342 graph_parse_mclk_fs(top, ep, dai_props);
344 asoc_simple_canonicalize_platform(dai_link);
346 ret = asoc_simple_parse_tdm(ep, dai);
347 if (ret)
348 goto out_put_node;
350 ret = asoc_simple_parse_daifmt(dev, cpu_ep, codec_ep,
351 NULL, &dai_link->dai_fmt);
352 if (ret < 0)
353 goto out_put_node;
355 snd_soc_dai_link_set_capabilities(dai_link);
357 dai_link->ops = &graph_ops;
359 /* Use custom snd_soc_ops callbacks if available */
360 if (priv->ops)
361 dai_link->ops = priv->ops;
363 dai_link->init = asoc_simple_dai_init;
365 out_put_node:
366 of_node_put(ports);
367 of_node_put(port);
368 of_node_put(node);
369 return ret;
372 static int graph_dai_link_of(struct asoc_simple_priv *priv,
373 struct device_node *cpu_ep,
374 struct device_node *codec_ep,
375 struct link_info *li)
377 struct device *dev = simple_priv_to_dev(priv);
378 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
379 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
380 struct device_node *top = dev->of_node;
381 struct asoc_simple_dai *cpu_dai;
382 struct asoc_simple_dai *codec_dai;
383 int ret, single_cpu;
385 /* Do it only CPU turn */
386 if (!li->cpu)
387 return 0;
389 dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
391 li->link++;
393 cpu_dai =
394 dai_props->cpu_dai = &priv->dais[li->dais++];
395 codec_dai =
396 dai_props->codec_dai = &priv->dais[li->dais++];
398 /* Factor to mclk, used in hw_params() */
399 graph_parse_mclk_fs(top, cpu_ep, dai_props);
400 graph_parse_mclk_fs(top, codec_ep, dai_props);
402 ret = asoc_simple_parse_daifmt(dev, cpu_ep, codec_ep,
403 NULL, &dai_link->dai_fmt);
404 if (ret < 0)
405 return ret;
407 ret = asoc_simple_parse_cpu(cpu_ep, dai_link, &single_cpu);
408 if (ret < 0)
409 return ret;
411 ret = asoc_simple_parse_codec(codec_ep, dai_link);
412 if (ret < 0)
413 return ret;
415 ret = asoc_simple_parse_tdm(cpu_ep, cpu_dai);
416 if (ret < 0)
417 return ret;
419 ret = asoc_simple_parse_tdm(codec_ep, codec_dai);
420 if (ret < 0)
421 return ret;
423 ret = asoc_simple_parse_clk_cpu(dev, cpu_ep, dai_link, cpu_dai);
424 if (ret < 0)
425 return ret;
427 ret = asoc_simple_parse_clk_codec(dev, codec_ep, dai_link, codec_dai);
428 if (ret < 0)
429 return ret;
431 ret = asoc_simple_set_dailink_name(dev, dai_link,
432 "%s-%s",
433 dai_link->cpus->dai_name,
434 dai_link->codecs->dai_name);
435 if (ret < 0)
436 return ret;
438 dai_link->ops = &graph_ops;
439 dai_link->init = asoc_simple_dai_init;
441 asoc_simple_canonicalize_cpu(dai_link, single_cpu);
442 asoc_simple_canonicalize_platform(dai_link);
444 return 0;
447 static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv,
448 struct device_node *codec_port,
449 struct asoc_simple_data *adata)
451 if (priv->force_dpcm)
452 return true;
454 if (!priv->dpcm_selectable)
455 return false;
458 * It is DPCM
459 * if Codec port has many endpoints,
460 * or has convert-xxx property
462 if ((of_get_child_count(codec_port) > 1) ||
463 (adata->convert_rate || adata->convert_channels))
464 return true;
466 return false;
469 static int graph_for_each_link(struct asoc_simple_priv *priv,
470 struct link_info *li,
471 int (*func_noml)(struct asoc_simple_priv *priv,
472 struct device_node *cpu_ep,
473 struct device_node *codec_ep,
474 struct link_info *li),
475 int (*func_dpcm)(struct asoc_simple_priv *priv,
476 struct device_node *cpu_ep,
477 struct device_node *codec_ep,
478 struct link_info *li, int dup_codec))
480 struct of_phandle_iterator it;
481 struct device *dev = simple_priv_to_dev(priv);
482 struct device_node *node = dev->of_node;
483 struct device_node *cpu_port;
484 struct device_node *cpu_ep;
485 struct device_node *codec_ep;
486 struct device_node *codec_port;
487 struct device_node *codec_port_old = NULL;
488 struct asoc_simple_data adata;
489 int rc, ret;
491 /* loop for all listed CPU port */
492 of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
493 cpu_port = it.node;
494 cpu_ep = NULL;
496 /* loop for all CPU endpoint */
497 while (1) {
498 cpu_ep = of_get_next_child(cpu_port, cpu_ep);
499 if (!cpu_ep)
500 break;
502 /* get codec */
503 codec_ep = of_graph_get_remote_endpoint(cpu_ep);
504 codec_port = of_get_parent(codec_ep);
506 /* get convert-xxx property */
507 memset(&adata, 0, sizeof(adata));
508 graph_parse_convert(dev, codec_ep, &adata);
509 graph_parse_convert(dev, cpu_ep, &adata);
511 /* check if link requires DPCM parsing */
512 if (parse_as_dpcm_link(priv, codec_port, &adata))
513 ret = func_dpcm(priv, cpu_ep, codec_ep, li,
514 (codec_port_old == codec_port));
515 /* else normal sound */
516 else
517 ret = func_noml(priv, cpu_ep, codec_ep, li);
519 of_node_put(codec_ep);
520 of_node_put(codec_port);
522 if (ret < 0)
523 return ret;
525 codec_port_old = codec_port;
529 return 0;
532 static void graph_get_dais_count(struct asoc_simple_priv *priv,
533 struct link_info *li);
535 int graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
537 struct snd_soc_card *card = simple_priv_to_card(priv);
538 struct link_info li;
539 int ret;
541 card->owner = THIS_MODULE;
542 card->dev = dev;
544 memset(&li, 0, sizeof(li));
545 graph_get_dais_count(priv, &li);
546 if (!li.link || !li.dais)
547 return -EINVAL;
549 ret = asoc_simple_init_priv(priv, &li);
550 if (ret < 0)
551 return ret;
553 priv->pa_gpio = devm_gpiod_get_optional(dev, "pa", GPIOD_OUT_LOW);
554 if (IS_ERR(priv->pa_gpio)) {
555 ret = PTR_ERR(priv->pa_gpio);
556 dev_err(dev, "failed to get amplifier gpio: %d\n", ret);
557 return ret;
560 ret = asoc_simple_parse_widgets(card, NULL);
561 if (ret < 0)
562 return ret;
564 ret = asoc_simple_parse_routing(card, NULL);
565 if (ret < 0)
566 return ret;
568 memset(&li, 0, sizeof(li));
569 for (li.cpu = 1; li.cpu >= 0; li.cpu--) {
571 * Detect all CPU first, and Detect all Codec 2nd.
573 * In Normal sound case, all DAIs are detected
574 * as "CPU-Codec".
576 * In DPCM sound case,
577 * all CPUs are detected as "CPU-dummy", and
578 * all Codecs are detected as "dummy-Codec".
579 * To avoid random sub-device numbering,
580 * detect "dummy-Codec" in last;
582 ret = graph_for_each_link(priv, &li,
583 graph_dai_link_of,
584 graph_dai_link_of_dpcm);
585 if (ret < 0)
586 goto err;
589 ret = asoc_simple_parse_card_name(card, NULL);
590 if (ret < 0)
591 goto err;
593 snd_soc_card_set_drvdata(card, priv);
595 asoc_simple_debug_info(priv);
597 ret = devm_snd_soc_register_card(dev, card);
598 if (ret < 0)
599 goto err;
601 return 0;
603 err:
604 asoc_simple_clean_reference(card);
606 if (ret != -EPROBE_DEFER)
607 dev_err(dev, "parse error %d\n", ret);
609 return ret;
611 EXPORT_SYMBOL_GPL(graph_parse_of);
613 static int graph_count_noml(struct asoc_simple_priv *priv,
614 struct device_node *cpu_ep,
615 struct device_node *codec_ep,
616 struct link_info *li)
618 struct device *dev = simple_priv_to_dev(priv);
620 li->link += 1; /* 1xCPU-Codec */
621 li->dais += 2; /* 1xCPU + 1xCodec */
623 dev_dbg(dev, "Count As Normal\n");
625 return 0;
628 static int graph_count_dpcm(struct asoc_simple_priv *priv,
629 struct device_node *cpu_ep,
630 struct device_node *codec_ep,
631 struct link_info *li,
632 int dup_codec)
634 struct device *dev = simple_priv_to_dev(priv);
636 li->link++; /* 1xCPU-dummy */
637 li->dais++; /* 1xCPU */
639 if (!dup_codec && codec_ep) {
640 li->link++; /* 1xdummy-Codec */
641 li->conf++; /* 1xdummy-Codec */
642 li->dais++; /* 1xCodec */
645 dev_dbg(dev, "Count As DPCM\n");
647 return 0;
650 static void graph_get_dais_count(struct asoc_simple_priv *priv,
651 struct link_info *li)
653 struct device *dev = simple_priv_to_dev(priv);
656 * link_num : number of links.
657 * CPU-Codec / CPU-dummy / dummy-Codec
658 * dais_num : number of DAIs
659 * ccnf_num : number of codec_conf
660 * same number for "dummy-Codec"
662 * ex1)
663 * CPU0 --- Codec0 link : 5
664 * CPU1 --- Codec1 dais : 7
665 * CPU2 -/ ccnf : 1
666 * CPU3 --- Codec2
668 * => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
669 * => 7 DAIs = 4xCPU + 3xCodec
670 * => 1 ccnf = 1xdummy-Codec
672 * ex2)
673 * CPU0 --- Codec0 link : 5
674 * CPU1 --- Codec1 dais : 6
675 * CPU2 -/ ccnf : 1
676 * CPU3 -/
678 * => 5 links = 1xCPU-Codec + 3xCPU-dummy + 1xdummy-Codec
679 * => 6 DAIs = 4xCPU + 2xCodec
680 * => 1 ccnf = 1xdummy-Codec
682 * ex3)
683 * CPU0 --- Codec0 link : 6
684 * CPU1 -/ dais : 6
685 * CPU2 --- Codec1 ccnf : 2
686 * CPU3 -/
688 * => 6 links = 0xCPU-Codec + 4xCPU-dummy + 2xdummy-Codec
689 * => 6 DAIs = 4xCPU + 2xCodec
690 * => 2 ccnf = 2xdummy-Codec
692 * ex4)
693 * CPU0 --- Codec0 (convert-rate) link : 3
694 * CPU1 --- Codec1 dais : 4
695 * ccnf : 1
697 * => 3 links = 1xCPU-Codec + 1xCPU-dummy + 1xdummy-Codec
698 * => 4 DAIs = 2xCPU + 2xCodec
699 * => 1 ccnf = 1xdummy-Codec
701 graph_for_each_link(priv, li,
702 graph_count_noml,
703 graph_count_dpcm);
704 dev_dbg(dev, "link %d, dais %d, ccnf %d\n",
705 li->link, li->dais, li->conf);
708 int graph_card_probe(struct snd_soc_card *card)
710 struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
711 int ret;
713 ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
714 if (ret < 0)
715 return ret;
717 ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
718 if (ret < 0)
719 return ret;
721 return 0;
723 EXPORT_SYMBOL_GPL(graph_card_probe);
725 static int graph_probe(struct platform_device *pdev)
727 struct asoc_simple_priv *priv;
728 struct device *dev = &pdev->dev;
729 struct snd_soc_card *card;
731 /* Allocate the private data and the DAI link array */
732 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
733 if (!priv)
734 return -ENOMEM;
736 card = simple_priv_to_card(priv);
737 card->dapm_widgets = graph_dapm_widgets;
738 card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets);
739 card->probe = graph_card_probe;
741 if (of_device_get_match_data(dev))
742 priv->dpcm_selectable = 1;
744 return graph_parse_of(priv, dev);
747 static int graph_remove(struct platform_device *pdev)
749 struct snd_soc_card *card = platform_get_drvdata(pdev);
751 return asoc_simple_clean_reference(card);
754 static const struct of_device_id graph_of_match[] = {
755 { .compatible = "audio-graph-card", },
756 { .compatible = "audio-graph-scu-card",
757 .data = (void *)DPCM_SELECTABLE },
760 MODULE_DEVICE_TABLE(of, graph_of_match);
762 static struct platform_driver graph_card = {
763 .driver = {
764 .name = "asoc-audio-graph-card",
765 .pm = &snd_soc_pm_ops,
766 .of_match_table = graph_of_match,
768 .probe = graph_probe,
769 .remove = graph_remove,
771 module_platform_driver(graph_card);
773 MODULE_ALIAS("platform:asoc-audio-graph-card");
774 MODULE_LICENSE("GPL v2");
775 MODULE_DESCRIPTION("ASoC Audio Graph Sound Card");
776 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");