x86/xen: resume timer irqs early
[linux/fpc-iii.git] / sound / soc / sh / rcar / core.c
bloba35706028514056e162afa491504d3864c6fa5c7
1 /*
2 * Renesas R-Car SRU/SCU/SSIU/SSI support
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7 * Based on fsi.c
8 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 * Renesas R-Car sound device structure
18 * Gen1
20 * SRU : Sound Routing Unit
21 * - SRC : Sampling Rate Converter
22 * - CMD
23 * - CTU : Channel Count Conversion Unit
24 * - MIX : Mixer
25 * - DVC : Digital Volume and Mute Function
26 * - SSI : Serial Sound Interface
28 * Gen2
30 * SCU : Sampling Rate Converter Unit
31 * - SRC : Sampling Rate Converter
32 * - CMD
33 * - CTU : Channel Count Conversion Unit
34 * - MIX : Mixer
35 * - DVC : Digital Volume and Mute Function
36 * SSIU : Serial Sound Interface Unit
37 * - SSI : Serial Sound Interface
41 * driver data Image
43 * rsnd_priv
44 * |
45 * | ** this depends on Gen1/Gen2
46 * |
47 * +- gen
48 * |
49 * | ** these depend on data path
50 * | ** gen and platform data control it
51 * |
52 * +- rdai[0]
53 * | | sru ssiu ssi
54 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
55 * | |
56 * | | sru ssiu ssi
57 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
58 * |
59 * +- rdai[1]
60 * | | sru ssiu ssi
61 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
62 * | |
63 * | | sru ssiu ssi
64 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
65 * ...
66 * |
67 * | ** these control ssi
68 * |
69 * +- ssi
70 * | |
71 * | +- ssi[0]
72 * | +- ssi[1]
73 * | +- ssi[2]
74 * | ...
75 * |
76 * | ** these control scu
77 * |
78 * +- scu
79 * |
80 * +- scu[0]
81 * +- scu[1]
82 * +- scu[2]
83 * ...
86 * for_each_rsnd_dai(xx, priv, xx)
87 * rdai[0] => rdai[1] => rdai[2] => ...
89 * for_each_rsnd_mod(xx, rdai, xx)
90 * [mod] => [mod] => [mod] => ...
92 * rsnd_dai_call(xxx, fn )
93 * [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
96 #include <linux/pm_runtime.h>
97 #include "rsnd.h"
99 #define RSND_RATES SNDRV_PCM_RATE_8000_96000
100 #define RSND_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
103 * rsnd_platform functions
105 #define rsnd_platform_call(priv, dai, func, param...) \
106 (!(priv->info->func) ? -ENODEV : \
107 priv->info->func(param))
111 * basic function
113 u32 rsnd_read(struct rsnd_priv *priv,
114 struct rsnd_mod *mod, enum rsnd_reg reg)
116 void __iomem *base = rsnd_gen_reg_get(priv, mod, reg);
118 BUG_ON(!base);
120 return ioread32(base);
123 void rsnd_write(struct rsnd_priv *priv,
124 struct rsnd_mod *mod,
125 enum rsnd_reg reg, u32 data)
127 void __iomem *base = rsnd_gen_reg_get(priv, mod, reg);
128 struct device *dev = rsnd_priv_to_dev(priv);
130 BUG_ON(!base);
132 dev_dbg(dev, "w %p : %08x\n", base, data);
134 iowrite32(data, base);
137 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod,
138 enum rsnd_reg reg, u32 mask, u32 data)
140 void __iomem *base = rsnd_gen_reg_get(priv, mod, reg);
141 struct device *dev = rsnd_priv_to_dev(priv);
142 u32 val;
144 BUG_ON(!base);
146 val = ioread32(base);
147 val &= ~mask;
148 val |= data & mask;
149 iowrite32(val, base);
151 dev_dbg(dev, "s %p : %08x\n", base, val);
155 * rsnd_mod functions
157 char *rsnd_mod_name(struct rsnd_mod *mod)
159 if (!mod || !mod->ops)
160 return "unknown";
162 return mod->ops->name;
165 void rsnd_mod_init(struct rsnd_priv *priv,
166 struct rsnd_mod *mod,
167 struct rsnd_mod_ops *ops,
168 int id)
170 mod->priv = priv;
171 mod->id = id;
172 mod->ops = ops;
173 INIT_LIST_HEAD(&mod->list);
177 * rsnd_dma functions
179 static void rsnd_dma_continue(struct rsnd_dma *dma)
181 /* push next A or B plane */
182 dma->submit_loop = 1;
183 schedule_work(&dma->work);
186 void rsnd_dma_start(struct rsnd_dma *dma)
188 /* push both A and B plane*/
189 dma->submit_loop = 2;
190 schedule_work(&dma->work);
193 void rsnd_dma_stop(struct rsnd_dma *dma)
195 dma->submit_loop = 0;
196 cancel_work_sync(&dma->work);
197 dmaengine_terminate_all(dma->chan);
200 static void rsnd_dma_complete(void *data)
202 struct rsnd_dma *dma = (struct rsnd_dma *)data;
203 struct rsnd_priv *priv = dma->priv;
204 unsigned long flags;
206 rsnd_lock(priv, flags);
208 dma->complete(dma);
210 if (dma->submit_loop)
211 rsnd_dma_continue(dma);
213 rsnd_unlock(priv, flags);
216 static void rsnd_dma_do_work(struct work_struct *work)
218 struct rsnd_dma *dma = container_of(work, struct rsnd_dma, work);
219 struct rsnd_priv *priv = dma->priv;
220 struct device *dev = rsnd_priv_to_dev(priv);
221 struct dma_async_tx_descriptor *desc;
222 dma_addr_t buf;
223 size_t len;
224 int i;
226 for (i = 0; i < dma->submit_loop; i++) {
228 if (dma->inquiry(dma, &buf, &len) < 0)
229 return;
231 desc = dmaengine_prep_slave_single(
232 dma->chan, buf, len, dma->dir,
233 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
234 if (!desc) {
235 dev_err(dev, "dmaengine_prep_slave_sg() fail\n");
236 return;
239 desc->callback = rsnd_dma_complete;
240 desc->callback_param = dma;
242 if (dmaengine_submit(desc) < 0) {
243 dev_err(dev, "dmaengine_submit() fail\n");
244 return;
249 dma_async_issue_pending(dma->chan);
252 int rsnd_dma_available(struct rsnd_dma *dma)
254 return !!dma->chan;
257 static bool rsnd_dma_filter(struct dma_chan *chan, void *param)
259 chan->private = param;
261 return true;
264 int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
265 int is_play, int id,
266 int (*inquiry)(struct rsnd_dma *dma,
267 dma_addr_t *buf, int *len),
268 int (*complete)(struct rsnd_dma *dma))
270 struct device *dev = rsnd_priv_to_dev(priv);
271 dma_cap_mask_t mask;
273 if (dma->chan) {
274 dev_err(dev, "it already has dma channel\n");
275 return -EIO;
278 dma_cap_zero(mask);
279 dma_cap_set(DMA_SLAVE, mask);
281 dma->slave.shdma_slave.slave_id = id;
283 dma->chan = dma_request_channel(mask, rsnd_dma_filter,
284 &dma->slave.shdma_slave);
285 if (!dma->chan) {
286 dev_err(dev, "can't get dma channel\n");
287 return -EIO;
290 dma->dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
291 dma->priv = priv;
292 dma->inquiry = inquiry;
293 dma->complete = complete;
294 INIT_WORK(&dma->work, rsnd_dma_do_work);
296 return 0;
299 void rsnd_dma_quit(struct rsnd_priv *priv,
300 struct rsnd_dma *dma)
302 if (dma->chan)
303 dma_release_channel(dma->chan);
305 dma->chan = NULL;
309 * rsnd_dai functions
311 #define rsnd_dai_call(rdai, io, fn) \
312 ({ \
313 struct rsnd_mod *mod, *n; \
314 int ret = 0; \
315 for_each_rsnd_mod(mod, n, io) { \
316 ret = rsnd_mod_call(mod, fn, rdai, io); \
317 if (ret < 0) \
318 break; \
320 ret; \
323 int rsnd_dai_connect(struct rsnd_dai *rdai,
324 struct rsnd_mod *mod,
325 struct rsnd_dai_stream *io)
327 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
328 struct device *dev = rsnd_priv_to_dev(priv);
330 if (!mod) {
331 dev_err(dev, "NULL mod\n");
332 return -EIO;
335 if (!list_empty(&mod->list)) {
336 dev_err(dev, "%s%d is not empty\n",
337 rsnd_mod_name(mod),
338 rsnd_mod_id(mod));
339 return -EIO;
342 list_add_tail(&mod->list, &io->head);
344 return 0;
347 int rsnd_dai_disconnect(struct rsnd_mod *mod)
349 list_del_init(&mod->list);
351 return 0;
354 int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai)
356 int id = rdai - priv->rdai;
358 if ((id < 0) || (id >= rsnd_dai_nr(priv)))
359 return -EINVAL;
361 return id;
364 struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id)
366 return priv->rdai + id;
369 static struct rsnd_dai *rsnd_dai_to_rdai(struct snd_soc_dai *dai)
371 struct rsnd_priv *priv = snd_soc_dai_get_drvdata(dai);
373 return rsnd_dai_get(priv, dai->id);
376 int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io)
378 return &rdai->playback == io;
382 * rsnd_soc_dai functions
384 int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional)
386 struct snd_pcm_substream *substream = io->substream;
387 struct snd_pcm_runtime *runtime = substream->runtime;
388 int pos = io->byte_pos + additional;
390 pos %= (runtime->periods * io->byte_per_period);
392 return pos;
395 void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int byte)
397 io->byte_pos += byte;
399 if (io->byte_pos >= io->next_period_byte) {
400 struct snd_pcm_substream *substream = io->substream;
401 struct snd_pcm_runtime *runtime = substream->runtime;
403 io->period_pos++;
404 io->next_period_byte += io->byte_per_period;
406 if (io->period_pos >= runtime->periods) {
407 io->byte_pos = 0;
408 io->period_pos = 0;
409 io->next_period_byte = io->byte_per_period;
412 snd_pcm_period_elapsed(substream);
416 static int rsnd_dai_stream_init(struct rsnd_dai_stream *io,
417 struct snd_pcm_substream *substream)
419 struct snd_pcm_runtime *runtime = substream->runtime;
421 if (!list_empty(&io->head))
422 return -EIO;
424 INIT_LIST_HEAD(&io->head);
425 io->substream = substream;
426 io->byte_pos = 0;
427 io->period_pos = 0;
428 io->byte_per_period = runtime->period_size *
429 runtime->channels *
430 samples_to_bytes(runtime, 1);
431 io->next_period_byte = io->byte_per_period;
433 return 0;
436 static
437 struct snd_soc_dai *rsnd_substream_to_dai(struct snd_pcm_substream *substream)
439 struct snd_soc_pcm_runtime *rtd = substream->private_data;
441 return rtd->cpu_dai;
444 static
445 struct rsnd_dai_stream *rsnd_rdai_to_io(struct rsnd_dai *rdai,
446 struct snd_pcm_substream *substream)
448 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
449 return &rdai->playback;
450 else
451 return &rdai->capture;
454 static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
455 struct snd_soc_dai *dai)
457 struct rsnd_priv *priv = snd_soc_dai_get_drvdata(dai);
458 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
459 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
460 struct rsnd_mod *mod = rsnd_ssi_mod_get_frm_dai(priv,
461 rsnd_dai_id(priv, rdai),
462 rsnd_dai_is_play(rdai, io));
463 int ssi_id = rsnd_mod_id(mod);
464 int ret;
465 unsigned long flags;
467 rsnd_lock(priv, flags);
469 switch (cmd) {
470 case SNDRV_PCM_TRIGGER_START:
471 ret = rsnd_dai_stream_init(io, substream);
472 if (ret < 0)
473 goto dai_trigger_end;
475 ret = rsnd_platform_call(priv, dai, start, ssi_id);
476 if (ret < 0)
477 goto dai_trigger_end;
479 ret = rsnd_gen_path_init(priv, rdai, io);
480 if (ret < 0)
481 goto dai_trigger_end;
483 ret = rsnd_dai_call(rdai, io, init);
484 if (ret < 0)
485 goto dai_trigger_end;
487 ret = rsnd_dai_call(rdai, io, start);
488 if (ret < 0)
489 goto dai_trigger_end;
490 break;
491 case SNDRV_PCM_TRIGGER_STOP:
492 ret = rsnd_dai_call(rdai, io, stop);
493 if (ret < 0)
494 goto dai_trigger_end;
496 ret = rsnd_dai_call(rdai, io, quit);
497 if (ret < 0)
498 goto dai_trigger_end;
500 ret = rsnd_gen_path_exit(priv, rdai, io);
501 if (ret < 0)
502 goto dai_trigger_end;
504 ret = rsnd_platform_call(priv, dai, stop, ssi_id);
505 if (ret < 0)
506 goto dai_trigger_end;
507 break;
508 default:
509 ret = -EINVAL;
512 dai_trigger_end:
513 rsnd_unlock(priv, flags);
515 return ret;
518 static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
520 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
522 /* set master/slave audio interface */
523 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
524 case SND_SOC_DAIFMT_CBM_CFM:
525 rdai->clk_master = 1;
526 break;
527 case SND_SOC_DAIFMT_CBS_CFS:
528 rdai->clk_master = 0;
529 break;
530 default:
531 return -EINVAL;
534 /* set clock inversion */
535 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
536 case SND_SOC_DAIFMT_NB_IF:
537 rdai->bit_clk_inv = 0;
538 rdai->frm_clk_inv = 1;
539 break;
540 case SND_SOC_DAIFMT_IB_NF:
541 rdai->bit_clk_inv = 1;
542 rdai->frm_clk_inv = 0;
543 break;
544 case SND_SOC_DAIFMT_IB_IF:
545 rdai->bit_clk_inv = 1;
546 rdai->frm_clk_inv = 1;
547 break;
548 case SND_SOC_DAIFMT_NB_NF:
549 default:
550 rdai->bit_clk_inv = 0;
551 rdai->frm_clk_inv = 0;
552 break;
555 /* set format */
556 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
557 case SND_SOC_DAIFMT_I2S:
558 rdai->sys_delay = 0;
559 rdai->data_alignment = 0;
560 break;
561 case SND_SOC_DAIFMT_LEFT_J:
562 rdai->sys_delay = 1;
563 rdai->data_alignment = 0;
564 break;
565 case SND_SOC_DAIFMT_RIGHT_J:
566 rdai->sys_delay = 1;
567 rdai->data_alignment = 1;
568 break;
571 return 0;
574 static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
575 .trigger = rsnd_soc_dai_trigger,
576 .set_fmt = rsnd_soc_dai_set_fmt,
579 static int rsnd_dai_probe(struct platform_device *pdev,
580 struct rcar_snd_info *info,
581 struct rsnd_priv *priv)
583 struct snd_soc_dai_driver *drv;
584 struct rsnd_dai *rdai;
585 struct rsnd_mod *pmod, *cmod;
586 struct device *dev = rsnd_priv_to_dev(priv);
587 int dai_nr;
588 int i;
590 /* get max dai nr */
591 for (dai_nr = 0; dai_nr < 32; dai_nr++) {
592 pmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 1);
593 cmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 0);
595 if (!pmod && !cmod)
596 break;
599 if (!dai_nr) {
600 dev_err(dev, "no dai\n");
601 return -EIO;
604 drv = devm_kzalloc(dev, sizeof(*drv) * dai_nr, GFP_KERNEL);
605 rdai = devm_kzalloc(dev, sizeof(*rdai) * dai_nr, GFP_KERNEL);
606 if (!drv || !rdai) {
607 dev_err(dev, "dai allocate failed\n");
608 return -ENOMEM;
611 for (i = 0; i < dai_nr; i++) {
613 pmod = rsnd_ssi_mod_get_frm_dai(priv, i, 1);
614 cmod = rsnd_ssi_mod_get_frm_dai(priv, i, 0);
617 * init rsnd_dai
619 INIT_LIST_HEAD(&rdai[i].playback.head);
620 INIT_LIST_HEAD(&rdai[i].capture.head);
622 snprintf(rdai[i].name, RSND_DAI_NAME_SIZE, "rsnd-dai.%d", i);
625 * init snd_soc_dai_driver
627 drv[i].name = rdai[i].name;
628 drv[i].ops = &rsnd_soc_dai_ops;
629 if (pmod) {
630 drv[i].playback.rates = RSND_RATES;
631 drv[i].playback.formats = RSND_FMTS;
632 drv[i].playback.channels_min = 2;
633 drv[i].playback.channels_max = 2;
635 if (cmod) {
636 drv[i].capture.rates = RSND_RATES;
637 drv[i].capture.formats = RSND_FMTS;
638 drv[i].capture.channels_min = 2;
639 drv[i].capture.channels_max = 2;
642 dev_dbg(dev, "%s (%s/%s)\n", rdai[i].name,
643 pmod ? "play" : " -- ",
644 cmod ? "capture" : " -- ");
647 priv->dai_nr = dai_nr;
648 priv->daidrv = drv;
649 priv->rdai = rdai;
651 return 0;
654 static void rsnd_dai_remove(struct platform_device *pdev,
655 struct rsnd_priv *priv)
660 * pcm ops
662 static struct snd_pcm_hardware rsnd_pcm_hardware = {
663 .info = SNDRV_PCM_INFO_INTERLEAVED |
664 SNDRV_PCM_INFO_MMAP |
665 SNDRV_PCM_INFO_MMAP_VALID |
666 SNDRV_PCM_INFO_PAUSE,
667 .formats = RSND_FMTS,
668 .rates = RSND_RATES,
669 .rate_min = 8000,
670 .rate_max = 192000,
671 .channels_min = 2,
672 .channels_max = 2,
673 .buffer_bytes_max = 64 * 1024,
674 .period_bytes_min = 32,
675 .period_bytes_max = 8192,
676 .periods_min = 1,
677 .periods_max = 32,
678 .fifo_size = 256,
681 static int rsnd_pcm_open(struct snd_pcm_substream *substream)
683 struct snd_pcm_runtime *runtime = substream->runtime;
684 int ret = 0;
686 snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware);
688 ret = snd_pcm_hw_constraint_integer(runtime,
689 SNDRV_PCM_HW_PARAM_PERIODS);
691 return ret;
694 static int rsnd_hw_params(struct snd_pcm_substream *substream,
695 struct snd_pcm_hw_params *hw_params)
697 return snd_pcm_lib_malloc_pages(substream,
698 params_buffer_bytes(hw_params));
701 static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream)
703 struct snd_pcm_runtime *runtime = substream->runtime;
704 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
705 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
706 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
708 return bytes_to_frames(runtime, io->byte_pos);
711 static struct snd_pcm_ops rsnd_pcm_ops = {
712 .open = rsnd_pcm_open,
713 .ioctl = snd_pcm_lib_ioctl,
714 .hw_params = rsnd_hw_params,
715 .hw_free = snd_pcm_lib_free_pages,
716 .pointer = rsnd_pointer,
720 * snd_soc_platform
723 #define PREALLOC_BUFFER (32 * 1024)
724 #define PREALLOC_BUFFER_MAX (32 * 1024)
726 static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
728 return snd_pcm_lib_preallocate_pages_for_all(
729 rtd->pcm,
730 SNDRV_DMA_TYPE_DEV,
731 rtd->card->snd_card->dev,
732 PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
735 static void rsnd_pcm_free(struct snd_pcm *pcm)
737 snd_pcm_lib_preallocate_free_for_all(pcm);
740 static struct snd_soc_platform_driver rsnd_soc_platform = {
741 .ops = &rsnd_pcm_ops,
742 .pcm_new = rsnd_pcm_new,
743 .pcm_free = rsnd_pcm_free,
746 static const struct snd_soc_component_driver rsnd_soc_component = {
747 .name = "rsnd",
751 * rsnd probe
753 static int rsnd_probe(struct platform_device *pdev)
755 struct rcar_snd_info *info;
756 struct rsnd_priv *priv;
757 struct device *dev = &pdev->dev;
758 int ret;
760 info = pdev->dev.platform_data;
761 if (!info) {
762 dev_err(dev, "driver needs R-Car sound information\n");
763 return -ENODEV;
767 * init priv data
769 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
770 if (!priv) {
771 dev_err(dev, "priv allocate failed\n");
772 return -ENODEV;
775 priv->dev = dev;
776 priv->info = info;
777 spin_lock_init(&priv->lock);
780 * init each module
782 ret = rsnd_gen_probe(pdev, info, priv);
783 if (ret < 0)
784 return ret;
786 ret = rsnd_scu_probe(pdev, info, priv);
787 if (ret < 0)
788 return ret;
790 ret = rsnd_adg_probe(pdev, info, priv);
791 if (ret < 0)
792 return ret;
794 ret = rsnd_ssi_probe(pdev, info, priv);
795 if (ret < 0)
796 return ret;
798 ret = rsnd_dai_probe(pdev, info, priv);
799 if (ret < 0)
800 return ret;
803 * asoc register
805 ret = snd_soc_register_platform(dev, &rsnd_soc_platform);
806 if (ret < 0) {
807 dev_err(dev, "cannot snd soc register\n");
808 return ret;
811 ret = snd_soc_register_component(dev, &rsnd_soc_component,
812 priv->daidrv, rsnd_dai_nr(priv));
813 if (ret < 0) {
814 dev_err(dev, "cannot snd dai register\n");
815 goto exit_snd_soc;
818 dev_set_drvdata(dev, priv);
820 pm_runtime_enable(dev);
822 dev_info(dev, "probed\n");
823 return ret;
825 exit_snd_soc:
826 snd_soc_unregister_platform(dev);
828 return ret;
831 static int rsnd_remove(struct platform_device *pdev)
833 struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
835 pm_runtime_disable(&pdev->dev);
838 * remove each module
840 rsnd_ssi_remove(pdev, priv);
841 rsnd_adg_remove(pdev, priv);
842 rsnd_scu_remove(pdev, priv);
843 rsnd_dai_remove(pdev, priv);
844 rsnd_gen_remove(pdev, priv);
846 return 0;
849 static struct platform_driver rsnd_driver = {
850 .driver = {
851 .name = "rcar_sound",
853 .probe = rsnd_probe,
854 .remove = rsnd_remove,
856 module_platform_driver(rsnd_driver);
858 MODULE_LICENSE("GPL");
859 MODULE_DESCRIPTION("Renesas R-Car audio driver");
860 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
861 MODULE_ALIAS("platform:rcar-pcm-audio");