1 // SPDX-License-Identifier: GPL-2.0
3 // Renesas R-Car SRU/SCU/SSIU/SSI support
5 // Copyright (C) 2013 Renesas Solutions Corp.
6 // Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
9 // Kuninori Morimoto <morimoto.kuninori@renesas.com>
12 * Renesas R-Car sound device structure
16 * SRU : Sound Routing Unit
17 * - SRC : Sampling Rate Converter
19 * - CTU : Channel Count Conversion Unit
21 * - DVC : Digital Volume and Mute Function
22 * - SSI : Serial Sound Interface
26 * SCU : Sampling Rate Converter Unit
27 * - SRC : Sampling Rate Converter
29 * - CTU : Channel Count Conversion Unit
31 * - DVC : Digital Volume and Mute Function
32 * SSIU : Serial Sound Interface Unit
33 * - SSI : Serial Sound Interface
41 * | ** this depends on Gen1/Gen2
45 * | ** these depend on data path
46 * | ** gen and platform data control it
50 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
53 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
57 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
60 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
63 * | ** these control ssi
72 * | ** these control src
82 * for_each_rsnd_dai(xx, priv, xx)
83 * rdai[0] => rdai[1] => rdai[2] => ...
85 * for_each_rsnd_mod(xx, rdai, xx)
86 * [mod] => [mod] => [mod] => ...
88 * rsnd_dai_call(xxx, fn )
89 * [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
94 * you can enable below define if you don't need
95 * DAI status debug message when debugging
96 * see rsnd_dbg_dai_call()
98 * #define RSND_DEBUG_NO_DAI_CALL 1
101 #include <linux/pm_runtime.h>
104 #define RSND_RATES SNDRV_PCM_RATE_8000_192000
105 #define RSND_FMTS (SNDRV_PCM_FMTBIT_S8 |\
106 SNDRV_PCM_FMTBIT_S16_LE |\
107 SNDRV_PCM_FMTBIT_S24_LE)
109 static const struct of_device_id rsnd_of_match[] = {
110 { .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 },
111 { .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 },
112 { .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN3 },
115 MODULE_DEVICE_TABLE(of, rsnd_of_match);
120 void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type)
122 if (mod->type != type) {
123 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
124 struct device *dev = rsnd_priv_to_dev(priv);
126 dev_warn(dev, "%s is not your expected module\n",
131 struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
132 struct rsnd_mod *mod)
134 if (!mod || !mod->ops || !mod->ops->dma_req)
137 return mod->ops->dma_req(io, mod);
140 #define MOD_NAME_NUM 5
141 #define MOD_NAME_SIZE 16
142 char *rsnd_mod_name(struct rsnd_mod *mod)
144 static char names[MOD_NAME_NUM][MOD_NAME_SIZE];
146 char *name = names[num];
149 if (num >= MOD_NAME_NUM)
153 * Let's use same char to avoid pointlessness memory
154 * Thus, rsnd_mod_name() should be used immediately
157 if ((mod)->ops->id_sub) {
158 snprintf(name, MOD_NAME_SIZE, "%s[%d%d]",
161 rsnd_mod_id_sub(mod));
163 snprintf(name, MOD_NAME_SIZE, "%s[%d]",
171 u32 *rsnd_mod_get_status(struct rsnd_mod *mod,
172 struct rsnd_dai_stream *io,
173 enum rsnd_mod_type type)
178 int rsnd_mod_id_raw(struct rsnd_mod *mod)
183 int rsnd_mod_id(struct rsnd_mod *mod)
186 return (mod)->ops->id(mod);
188 return rsnd_mod_id_raw(mod);
191 int rsnd_mod_id_sub(struct rsnd_mod *mod)
193 if ((mod)->ops->id_sub)
194 return (mod)->ops->id_sub(mod);
199 int rsnd_mod_init(struct rsnd_priv *priv,
200 struct rsnd_mod *mod,
201 struct rsnd_mod_ops *ops,
203 enum rsnd_mod_type type,
206 int ret = clk_prepare(clk);
220 void rsnd_mod_quit(struct rsnd_mod *mod)
222 clk_unprepare(mod->clk);
226 void rsnd_mod_interrupt(struct rsnd_mod *mod,
227 void (*callback)(struct rsnd_mod *mod,
228 struct rsnd_dai_stream *io))
230 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
231 struct rsnd_dai_stream *io;
232 struct rsnd_dai *rdai;
235 for_each_rsnd_dai(rdai, priv, i) {
236 io = &rdai->playback;
237 if (mod == io->mod[mod->type])
241 if (mod == io->mod[mod->type])
246 int rsnd_io_is_working(struct rsnd_dai_stream *io)
248 /* see rsnd_dai_stream_init/quit() */
250 return snd_pcm_running(io->substream);
255 int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io,
256 struct snd_pcm_hw_params *params)
258 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
261 * params will be added when refine
263 * __rsnd_soc_hw_rule_rate()
264 * __rsnd_soc_hw_rule_channels()
267 return params_channels(params);
269 return runtime->channels;
272 int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,
273 struct snd_pcm_hw_params *params)
275 int chan = rsnd_runtime_channel_original_with_params(io, params);
276 struct rsnd_mod *ctu_mod = rsnd_io_to_mod_ctu(io);
279 u32 converted_chan = rsnd_io_converted_chan(io);
284 * converted_chan will be used for CTU,
286 * User shouldn't use CTU with TDM Split mode.
288 if (rsnd_runtime_is_tdm_split(io)) {
289 struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io));
291 dev_err(dev, "CTU and TDM Split should be used\n");
295 return converted_chan;
301 int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
302 struct snd_pcm_hw_params *params)
304 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
305 int chan = rsnd_io_is_play(io) ?
306 rsnd_runtime_channel_after_ctu_with_params(io, params) :
307 rsnd_runtime_channel_original_with_params(io, params);
310 if (rsnd_runtime_is_multi_ssi(io))
311 chan /= rsnd_rdai_ssi_lane_get(rdai);
313 /* TDM Extend Mode needs 8ch */
320 int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io)
322 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
323 int lane = rsnd_rdai_ssi_lane_get(rdai);
324 int chan = rsnd_io_is_play(io) ?
325 rsnd_runtime_channel_after_ctu(io) :
326 rsnd_runtime_channel_original(io);
328 return (chan > 2) && (lane > 1);
331 int rsnd_runtime_is_tdm(struct rsnd_dai_stream *io)
333 return rsnd_runtime_channel_for_ssi(io) >= 6;
336 int rsnd_runtime_is_tdm_split(struct rsnd_dai_stream *io)
338 return !!rsnd_flags_has(io, RSND_STREAM_TDM_SPLIT);
344 u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
346 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
347 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
348 struct device *dev = rsnd_priv_to_dev(priv);
350 switch (snd_pcm_format_width(runtime->format)) {
359 dev_warn(dev, "not supported sample bits\n");
367 u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
369 struct rsnd_mod *ssiu = rsnd_io_to_mod_ssiu(io);
370 struct rsnd_mod *target;
371 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
374 * *Hardware* L/R and *Software* L/R are inverted for 16bit data.
378 * We need to care about inversion timing to control
379 * Playback/Capture correctly.
380 * The point is [DVC] needs *Hardware* L/R, [MEM] needs *Software* L/R
382 * sL/R : software L/R
383 * hL/R : hardware L/R
384 * (*) : conversion timing
387 * sL/R (*) hL/R hL/R hL/R hL/R hL/R
388 * [MEM] -> [SRC] -> [DVC] -> [CMD] -> [SSIU] -> [SSI] -> codec
391 * hL/R hL/R hL/R hL/R hL/R (*) sL/R
392 * codec -> [SSI] -> [SSIU] -> [SRC] -> [DVC] -> [CMD] -> [MEM]
394 if (rsnd_io_is_play(io)) {
395 struct rsnd_mod *src = rsnd_io_to_mod_src(io);
397 target = src ? src : ssiu;
399 struct rsnd_mod *cmd = rsnd_io_to_mod_cmd(io);
401 target = cmd ? cmd : ssiu;
404 /* Non target mod or non 16bit needs normal DALIGN */
405 if ((snd_pcm_format_width(runtime->format) != 16) ||
408 /* Target mod needs inverted DALIGN when 16bit */
413 u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod)
415 enum rsnd_mod_type playback_mods[] = {
420 enum rsnd_mod_type capture_mods[] = {
425 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
426 struct rsnd_mod *tmod = NULL;
427 enum rsnd_mod_type *mods =
428 rsnd_io_is_play(io) ?
429 playback_mods : capture_mods;
433 * This is needed for 24bit data
434 * We need to shift 8bit
436 * Linux 24bit data is located as 0x00******
437 * HW 24bit data is located as 0x******00
440 if (snd_pcm_format_width(runtime->format) != 24)
443 for (i = 0; i < ARRAY_SIZE(playback_mods); i++) {
444 tmod = rsnd_io_to_mod(io, mods[i]);
452 if (rsnd_io_is_play(io))
453 return (0 << 20) | /* shift to Left */
454 (8 << 16); /* 8bit */
456 return (1 << 20) | /* shift to Right */
457 (8 << 16); /* 8bit */
463 struct rsnd_mod *rsnd_mod_next(int *iterator,
464 struct rsnd_dai_stream *io,
465 enum rsnd_mod_type *array,
468 struct rsnd_mod *mod;
469 enum rsnd_mod_type type;
470 int max = array ? array_size : RSND_MOD_MAX;
472 for (; *iterator < max; (*iterator)++) {
473 type = (array) ? array[*iterator] : *iterator;
474 mod = rsnd_io_to_mod(io, type);
482 static enum rsnd_mod_type rsnd_mod_sequence[][RSND_MOD_MAX] = {
516 static int rsnd_status_update(u32 *status,
517 int shift, int add, int timing)
519 u32 mask = 0xF << shift;
520 u8 val = (*status >> shift) & 0xF;
521 u8 next_val = (val + add) & 0xF;
522 int func_call = (val == timing);
524 if (next_val == 0xF) /* underflow case */
527 *status = (*status & ~mask) + (next_val << shift);
532 #define rsnd_dai_call(fn, io, param...) \
534 struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io)); \
535 struct rsnd_mod *mod; \
536 int is_play = rsnd_io_is_play(io); \
538 enum rsnd_mod_type *types = rsnd_mod_sequence[is_play]; \
539 for_each_rsnd_mod_arrays(i, mod, io, types, RSND_MOD_MAX) { \
541 u32 *status = mod->ops->get_status(mod, io, types[i]); \
542 int func_call = rsnd_status_update(status, \
543 __rsnd_mod_shift_##fn, \
544 __rsnd_mod_add_##fn, \
545 __rsnd_mod_call_##fn); \
546 rsnd_dbg_dai_call(dev, "%s\t0x%08x %s\n", \
547 rsnd_mod_name(mod), *status, \
548 (func_call && (mod)->ops->fn) ? #fn : ""); \
549 if (func_call && (mod)->ops->fn) \
550 tmp = (mod)->ops->fn(mod, io, param); \
551 if (tmp && (tmp != -EPROBE_DEFER)) \
552 dev_err(dev, "%s : %s error %d\n", \
553 rsnd_mod_name(mod), #fn, tmp); \
559 int rsnd_dai_connect(struct rsnd_mod *mod,
560 struct rsnd_dai_stream *io,
561 enum rsnd_mod_type type)
563 struct rsnd_priv *priv;
569 if (io->mod[type] == mod)
575 priv = rsnd_mod_to_priv(mod);
576 dev = rsnd_priv_to_dev(priv);
580 dev_dbg(dev, "%s is connected to io (%s)\n",
582 rsnd_io_is_play(io) ? "Playback" : "Capture");
587 static void rsnd_dai_disconnect(struct rsnd_mod *mod,
588 struct rsnd_dai_stream *io,
589 enum rsnd_mod_type type)
591 io->mod[type] = NULL;
594 int rsnd_rdai_channels_ctrl(struct rsnd_dai *rdai,
597 if (max_channels > 0)
598 rdai->max_channels = max_channels;
600 return rdai->max_channels;
603 int rsnd_rdai_ssi_lane_ctrl(struct rsnd_dai *rdai,
607 rdai->ssi_lane = ssi_lane;
609 return rdai->ssi_lane;
612 int rsnd_rdai_width_ctrl(struct rsnd_dai *rdai, int width)
615 rdai->chan_width = width;
617 return rdai->chan_width;
620 struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id)
622 if ((id < 0) || (id >= rsnd_rdai_nr(priv)))
625 return priv->rdai + id;
628 static struct snd_soc_dai_driver
629 *rsnd_daidrv_get(struct rsnd_priv *priv, int id)
631 if ((id < 0) || (id >= rsnd_rdai_nr(priv)))
634 return priv->daidrv + id;
637 #define rsnd_dai_to_priv(dai) snd_soc_dai_get_drvdata(dai)
638 static struct rsnd_dai *rsnd_dai_to_rdai(struct snd_soc_dai *dai)
640 struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
642 return rsnd_rdai_get(priv, dai->id);
646 * rsnd_soc_dai functions
648 void rsnd_dai_period_elapsed(struct rsnd_dai_stream *io)
650 struct snd_pcm_substream *substream = io->substream;
653 * this function should be called...
655 * - if rsnd_dai_pointer_update() returns true
656 * - without spin lock
659 snd_pcm_period_elapsed(substream);
662 static void rsnd_dai_stream_init(struct rsnd_dai_stream *io,
663 struct snd_pcm_substream *substream)
665 io->substream = substream;
668 static void rsnd_dai_stream_quit(struct rsnd_dai_stream *io)
670 io->substream = NULL;
674 struct snd_soc_dai *rsnd_substream_to_dai(struct snd_pcm_substream *substream)
676 struct snd_soc_pcm_runtime *rtd = substream->private_data;
682 struct rsnd_dai_stream *rsnd_rdai_to_io(struct rsnd_dai *rdai,
683 struct snd_pcm_substream *substream)
685 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
686 return &rdai->playback;
688 return &rdai->capture;
691 static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
692 struct snd_soc_dai *dai)
694 struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
695 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
696 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
700 spin_lock_irqsave(&priv->lock, flags);
703 case SNDRV_PCM_TRIGGER_START:
704 case SNDRV_PCM_TRIGGER_RESUME:
705 ret = rsnd_dai_call(init, io, priv);
707 goto dai_trigger_end;
709 ret = rsnd_dai_call(start, io, priv);
711 goto dai_trigger_end;
713 ret = rsnd_dai_call(irq, io, priv, 1);
715 goto dai_trigger_end;
718 case SNDRV_PCM_TRIGGER_STOP:
719 case SNDRV_PCM_TRIGGER_SUSPEND:
720 ret = rsnd_dai_call(irq, io, priv, 0);
722 ret |= rsnd_dai_call(stop, io, priv);
724 ret |= rsnd_dai_call(quit, io, priv);
732 spin_unlock_irqrestore(&priv->lock, flags);
737 static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
739 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
741 /* set master/slave audio interface */
742 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
743 case SND_SOC_DAIFMT_CBM_CFM:
744 rdai->clk_master = 0;
746 case SND_SOC_DAIFMT_CBS_CFS:
747 rdai->clk_master = 1; /* codec is slave, cpu is master */
754 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
755 case SND_SOC_DAIFMT_I2S:
757 rdai->data_alignment = 0;
758 rdai->frm_clk_inv = 0;
760 case SND_SOC_DAIFMT_LEFT_J:
761 case SND_SOC_DAIFMT_DSP_B:
763 rdai->data_alignment = 0;
764 rdai->frm_clk_inv = 1;
766 case SND_SOC_DAIFMT_RIGHT_J:
768 rdai->data_alignment = 1;
769 rdai->frm_clk_inv = 1;
771 case SND_SOC_DAIFMT_DSP_A:
773 rdai->data_alignment = 0;
774 rdai->frm_clk_inv = 1;
778 /* set clock inversion */
779 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
780 case SND_SOC_DAIFMT_NB_IF:
781 rdai->frm_clk_inv = !rdai->frm_clk_inv;
783 case SND_SOC_DAIFMT_IB_NF:
784 rdai->bit_clk_inv = !rdai->bit_clk_inv;
786 case SND_SOC_DAIFMT_IB_IF:
787 rdai->bit_clk_inv = !rdai->bit_clk_inv;
788 rdai->frm_clk_inv = !rdai->frm_clk_inv;
790 case SND_SOC_DAIFMT_NB_NF:
798 static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai,
799 u32 tx_mask, u32 rx_mask,
800 int slots, int slot_width)
802 struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
803 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
804 struct device *dev = rsnd_priv_to_dev(priv);
806 switch (slot_width) {
821 /* TDM Extend Mode */
822 rsnd_rdai_channels_set(rdai, slots);
823 rsnd_rdai_ssi_lane_set(rdai, 1);
824 rsnd_rdai_width_set(rdai, slot_width);
827 dev_err(dev, "unsupported TDM slots (%d)\n", slots);
834 static unsigned int rsnd_soc_hw_channels_list[] = {
838 static unsigned int rsnd_soc_hw_rate_list[] = {
853 static int rsnd_soc_hw_rule(struct rsnd_dai *rdai,
854 unsigned int *list, int list_num,
855 struct snd_interval *baseline, struct snd_interval *iv)
857 struct snd_interval p;
861 snd_interval_any(&p);
865 for (i = 0; i < list_num; i++) {
867 if (!snd_interval_test(iv, list[i]))
870 rate = rsnd_ssi_clk_query(rdai,
871 baseline->min, list[i], NULL);
873 p.min = min(p.min, list[i]);
874 p.max = max(p.max, list[i]);
877 rate = rsnd_ssi_clk_query(rdai,
878 baseline->max, list[i], NULL);
880 p.min = min(p.min, list[i]);
881 p.max = max(p.max, list[i]);
885 return snd_interval_refine(iv, &p);
888 static int rsnd_soc_hw_rule_rate(struct snd_pcm_hw_params *params,
889 struct snd_pcm_hw_rule *rule)
891 struct snd_interval *ic_ = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
892 struct snd_interval *ir = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
893 struct snd_interval ic;
894 struct rsnd_dai_stream *io = rule->private;
895 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
898 * possible sampling rate limitation is same as
899 * 2ch if it supports multi ssi
900 * and same as 8ch if TDM 6ch (see rsnd_ssi_config_init())
904 ic.max = rsnd_runtime_channel_for_ssi_with_params(io, params);
906 return rsnd_soc_hw_rule(rdai, rsnd_soc_hw_rate_list,
907 ARRAY_SIZE(rsnd_soc_hw_rate_list),
911 static int rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params,
912 struct snd_pcm_hw_rule *rule)
914 struct snd_interval *ic_ = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
915 struct snd_interval *ir = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
916 struct snd_interval ic;
917 struct rsnd_dai_stream *io = rule->private;
918 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
921 * possible sampling rate limitation is same as
922 * 2ch if it supports multi ssi
923 * and same as 8ch if TDM 6ch (see rsnd_ssi_config_init())
927 ic.max = rsnd_runtime_channel_for_ssi_with_params(io, params);
929 return rsnd_soc_hw_rule(rdai, rsnd_soc_hw_channels_list,
930 ARRAY_SIZE(rsnd_soc_hw_channels_list),
934 static const struct snd_pcm_hardware rsnd_pcm_hardware = {
935 .info = SNDRV_PCM_INFO_INTERLEAVED |
936 SNDRV_PCM_INFO_MMAP |
937 SNDRV_PCM_INFO_MMAP_VALID,
938 .buffer_bytes_max = 64 * 1024,
939 .period_bytes_min = 32,
940 .period_bytes_max = 8192,
946 static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
947 struct snd_soc_dai *dai)
949 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
950 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
951 struct snd_pcm_hw_constraint_list *constraint = &rdai->constraint;
952 struct snd_pcm_runtime *runtime = substream->runtime;
953 unsigned int max_channels = rsnd_rdai_channels_get(rdai);
956 rsnd_dai_stream_init(io, substream);
960 * It depends on Platform design
962 constraint->list = rsnd_soc_hw_channels_list;
963 constraint->count = 0;
964 constraint->mask = 0;
966 for (i = 0; i < ARRAY_SIZE(rsnd_soc_hw_channels_list); i++) {
967 if (rsnd_soc_hw_channels_list[i] > max_channels)
969 constraint->count = i + 1;
972 snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware);
974 snd_pcm_hw_constraint_list(runtime, 0,
975 SNDRV_PCM_HW_PARAM_CHANNELS, constraint);
977 snd_pcm_hw_constraint_integer(runtime,
978 SNDRV_PCM_HW_PARAM_PERIODS);
981 * Sampling Rate / Channel Limitation
982 * It depends on Clock Master Mode
984 if (rsnd_rdai_is_clk_master(rdai)) {
985 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
987 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
988 rsnd_soc_hw_rule_rate,
989 is_play ? &rdai->playback : &rdai->capture,
990 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
991 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
992 rsnd_soc_hw_rule_channels,
993 is_play ? &rdai->playback : &rdai->capture,
994 SNDRV_PCM_HW_PARAM_RATE, -1);
1000 static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
1001 struct snd_soc_dai *dai)
1003 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1004 struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
1005 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1008 * call rsnd_dai_call without spinlock
1010 rsnd_dai_call(cleanup, io, priv);
1012 rsnd_dai_stream_quit(io);
1015 static int rsnd_soc_dai_prepare(struct snd_pcm_substream *substream,
1016 struct snd_soc_dai *dai)
1018 struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
1019 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1020 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1022 return rsnd_dai_call(prepare, io, priv);
1025 static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
1026 .startup = rsnd_soc_dai_startup,
1027 .shutdown = rsnd_soc_dai_shutdown,
1028 .trigger = rsnd_soc_dai_trigger,
1029 .set_fmt = rsnd_soc_dai_set_fmt,
1030 .set_tdm_slot = rsnd_soc_set_dai_tdm_slot,
1031 .prepare = rsnd_soc_dai_prepare,
1034 static void rsnd_parse_tdm_split_mode(struct rsnd_priv *priv,
1035 struct rsnd_dai_stream *io,
1036 struct device_node *dai_np)
1038 struct device *dev = rsnd_priv_to_dev(priv);
1039 struct device_node *ssiu_np = rsnd_ssiu_of_node(priv);
1040 struct device_node *np;
1041 int is_play = rsnd_io_is_play(io);
1048 * This driver assumes that it is TDM Split mode
1049 * if it includes ssiu node
1052 struct device_node *node = is_play ?
1053 of_parse_phandle(dai_np, "playback", i) :
1054 of_parse_phandle(dai_np, "capture", i);
1060 for_each_child_of_node(ssiu_np, np) {
1062 rsnd_flags_set(io, RSND_STREAM_TDM_SPLIT);
1063 dev_dbg(dev, "%s is part of TDM Split\n", io->name);
1071 static void rsnd_parse_connect_simple(struct rsnd_priv *priv,
1072 struct rsnd_dai_stream *io,
1073 struct device_node *dai_np)
1075 if (!rsnd_io_to_mod_ssi(io))
1078 rsnd_parse_tdm_split_mode(priv, io, dai_np);
1081 static void rsnd_parse_connect_graph(struct rsnd_priv *priv,
1082 struct rsnd_dai_stream *io,
1083 struct device_node *endpoint)
1085 struct device *dev = rsnd_priv_to_dev(priv);
1086 struct device_node *remote_node = of_graph_get_remote_port_parent(endpoint);
1088 if (!rsnd_io_to_mod_ssi(io))
1092 if (strstr(remote_node->full_name, "hdmi@fead0000")) {
1093 rsnd_flags_set(io, RSND_STREAM_HDMI0);
1094 dev_dbg(dev, "%s connected to HDMI0\n", io->name);
1098 if (strstr(remote_node->full_name, "hdmi@feae0000")) {
1099 rsnd_flags_set(io, RSND_STREAM_HDMI1);
1100 dev_dbg(dev, "%s connected to HDMI1\n", io->name);
1103 rsnd_parse_tdm_split_mode(priv, io, endpoint);
1106 void rsnd_parse_connect_common(struct rsnd_dai *rdai,
1107 struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id),
1108 struct device_node *node,
1109 struct device_node *playback,
1110 struct device_node *capture)
1112 struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
1113 struct device_node *np;
1114 struct rsnd_mod *mod;
1121 for_each_child_of_node(node, np) {
1122 mod = mod_get(priv, i);
1124 rsnd_dai_connect(mod, &rdai->playback, mod->type);
1126 rsnd_dai_connect(mod, &rdai->capture, mod->type);
1133 static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv,
1136 struct device *dev = rsnd_priv_to_dev(priv);
1137 struct device_node *np = dev->of_node;
1138 struct device_node *dai_node;
1139 struct device_node *ret;
1144 * parse both previous dai (= rcar_sound,dai), and
1145 * graph dai (= ports/port)
1147 dai_node = of_get_child_by_name(np, RSND_NODE_DAI);
1150 goto of_node_compatible;
1155 dai_node = of_graph_get_next_endpoint(np, NULL);
1164 of_node_put(dai_node);
1169 static void __rsnd_dai_probe(struct rsnd_priv *priv,
1170 struct device_node *dai_np,
1173 struct device_node *playback, *capture;
1174 struct rsnd_dai_stream *io_playback;
1175 struct rsnd_dai_stream *io_capture;
1176 struct snd_soc_dai_driver *drv;
1177 struct rsnd_dai *rdai;
1178 struct device *dev = rsnd_priv_to_dev(priv);
1181 rdai = rsnd_rdai_get(priv, dai_i);
1182 drv = rsnd_daidrv_get(priv, dai_i);
1183 io_playback = &rdai->playback;
1184 io_capture = &rdai->capture;
1186 snprintf(rdai->name, RSND_DAI_NAME_SIZE, "rsnd-dai.%d", dai_i);
1189 drv->name = rdai->name;
1190 drv->ops = &rsnd_soc_dai_ops;
1192 snprintf(io_playback->name, RSND_DAI_NAME_SIZE,
1193 "DAI%d Playback", dai_i);
1194 drv->playback.rates = RSND_RATES;
1195 drv->playback.formats = RSND_FMTS;
1196 drv->playback.channels_min = 2;
1197 drv->playback.channels_max = 8;
1198 drv->playback.stream_name = io_playback->name;
1200 snprintf(io_capture->name, RSND_DAI_NAME_SIZE,
1201 "DAI%d Capture", dai_i);
1202 drv->capture.rates = RSND_RATES;
1203 drv->capture.formats = RSND_FMTS;
1204 drv->capture.channels_min = 2;
1205 drv->capture.channels_max = 8;
1206 drv->capture.stream_name = io_capture->name;
1208 io_playback->rdai = rdai;
1209 io_capture->rdai = rdai;
1210 rsnd_rdai_channels_set(rdai, 2); /* default 2ch */
1211 rsnd_rdai_ssi_lane_set(rdai, 1); /* default 1lane */
1212 rsnd_rdai_width_set(rdai, 32); /* default 32bit width */
1214 for (io_i = 0;; io_i++) {
1215 playback = of_parse_phandle(dai_np, "playback", io_i);
1216 capture = of_parse_phandle(dai_np, "capture", io_i);
1218 if (!playback && !capture)
1221 rsnd_parse_connect_ssi(rdai, playback, capture);
1222 rsnd_parse_connect_ssiu(rdai, playback, capture);
1223 rsnd_parse_connect_src(rdai, playback, capture);
1224 rsnd_parse_connect_ctu(rdai, playback, capture);
1225 rsnd_parse_connect_mix(rdai, playback, capture);
1226 rsnd_parse_connect_dvc(rdai, playback, capture);
1228 of_node_put(playback);
1229 of_node_put(capture);
1232 if (rsnd_ssi_is_pin_sharing(io_capture) ||
1233 rsnd_ssi_is_pin_sharing(io_playback)) {
1234 /* should have symmetric_rates if pin sharing */
1235 drv->symmetric_rates = 1;
1238 dev_dbg(dev, "%s (%s/%s)\n", rdai->name,
1239 rsnd_io_to_mod_ssi(io_playback) ? "play" : " -- ",
1240 rsnd_io_to_mod_ssi(io_capture) ? "capture" : " -- ");
1243 static int rsnd_dai_probe(struct rsnd_priv *priv)
1245 struct device_node *dai_node;
1246 struct device_node *dai_np;
1247 struct snd_soc_dai_driver *rdrv;
1248 struct device *dev = rsnd_priv_to_dev(priv);
1249 struct rsnd_dai *rdai;
1254 dai_node = rsnd_dai_of_node(priv, &is_graph);
1256 nr = of_graph_get_endpoint_count(dai_node);
1258 nr = of_get_child_count(dai_node);
1263 rdrv = devm_kcalloc(dev, nr, sizeof(*rdrv), GFP_KERNEL);
1264 rdai = devm_kcalloc(dev, nr, sizeof(*rdai), GFP_KERNEL);
1269 priv->daidrv = rdrv;
1277 for_each_endpoint_of_node(dai_node, dai_np) {
1278 __rsnd_dai_probe(priv, dai_np, dai_i);
1279 if (rsnd_is_gen3(priv)) {
1280 struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
1282 rsnd_parse_connect_graph(priv, &rdai->playback, dai_np);
1283 rsnd_parse_connect_graph(priv, &rdai->capture, dai_np);
1288 for_each_child_of_node(dai_node, dai_np) {
1289 __rsnd_dai_probe(priv, dai_np, dai_i);
1290 if (rsnd_is_gen3(priv)) {
1291 struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
1293 rsnd_parse_connect_simple(priv, &rdai->playback, dai_np);
1294 rsnd_parse_connect_simple(priv, &rdai->capture, dai_np);
1306 static int rsnd_hw_params(struct snd_pcm_substream *substream,
1307 struct snd_pcm_hw_params *hw_params)
1309 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
1310 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1311 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1312 struct snd_soc_pcm_runtime *fe = substream->private_data;
1316 * rsnd assumes that it might be used under DPCM if user want to use
1317 * channel / rate convert. Then, rsnd should be FE.
1318 * And then, this function will be called *after* BE settings.
1319 * this means, each BE already has fixuped hw_params.
1321 * dpcm_fe_dai_hw_params()
1322 * dpcm_be_dai_hw_params()
1324 io->converted_rate = 0;
1325 io->converted_chan = 0;
1326 if (fe->dai_link->dynamic) {
1327 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1328 struct device *dev = rsnd_priv_to_dev(priv);
1329 struct snd_soc_dpcm *dpcm;
1330 struct snd_pcm_hw_params *be_params;
1331 int stream = substream->stream;
1333 for_each_dpcm_be(fe, stream, dpcm) {
1334 be_params = &dpcm->hw_params;
1335 if (params_channels(hw_params) != params_channels(be_params))
1336 io->converted_chan = params_channels(be_params);
1337 if (params_rate(hw_params) != params_rate(be_params))
1338 io->converted_rate = params_rate(be_params);
1340 if (io->converted_chan)
1341 dev_dbg(dev, "convert channels = %d\n", io->converted_chan);
1342 if (io->converted_rate)
1343 dev_dbg(dev, "convert rate = %d\n", io->converted_rate);
1346 ret = rsnd_dai_call(hw_params, io, substream, hw_params);
1350 return snd_pcm_lib_malloc_pages(substream,
1351 params_buffer_bytes(hw_params));
1354 static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream)
1356 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
1357 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1358 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1359 snd_pcm_uframes_t pointer = 0;
1361 rsnd_dai_call(pointer, io, &pointer);
1366 static const struct snd_pcm_ops rsnd_pcm_ops = {
1367 .ioctl = snd_pcm_lib_ioctl,
1368 .hw_params = rsnd_hw_params,
1369 .hw_free = snd_pcm_lib_free_pages,
1370 .pointer = rsnd_pointer,
1376 static int rsnd_kctrl_info(struct snd_kcontrol *kctrl,
1377 struct snd_ctl_elem_info *uinfo)
1379 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1382 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1383 uinfo->count = cfg->size;
1384 uinfo->value.enumerated.items = cfg->max;
1385 if (uinfo->value.enumerated.item >= cfg->max)
1386 uinfo->value.enumerated.item = cfg->max - 1;
1387 strlcpy(uinfo->value.enumerated.name,
1388 cfg->texts[uinfo->value.enumerated.item],
1389 sizeof(uinfo->value.enumerated.name));
1391 uinfo->count = cfg->size;
1392 uinfo->value.integer.min = 0;
1393 uinfo->value.integer.max = cfg->max;
1394 uinfo->type = (cfg->max == 1) ?
1395 SNDRV_CTL_ELEM_TYPE_BOOLEAN :
1396 SNDRV_CTL_ELEM_TYPE_INTEGER;
1402 static int rsnd_kctrl_get(struct snd_kcontrol *kctrl,
1403 struct snd_ctl_elem_value *uc)
1405 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1408 for (i = 0; i < cfg->size; i++)
1410 uc->value.enumerated.item[i] = cfg->val[i];
1412 uc->value.integer.value[i] = cfg->val[i];
1417 static int rsnd_kctrl_put(struct snd_kcontrol *kctrl,
1418 struct snd_ctl_elem_value *uc)
1420 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1423 if (!cfg->accept(cfg->io))
1426 for (i = 0; i < cfg->size; i++) {
1428 change |= (uc->value.enumerated.item[i] != cfg->val[i]);
1429 cfg->val[i] = uc->value.enumerated.item[i];
1431 change |= (uc->value.integer.value[i] != cfg->val[i]);
1432 cfg->val[i] = uc->value.integer.value[i];
1436 if (change && cfg->update)
1437 cfg->update(cfg->io, cfg->mod);
1442 int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)
1447 int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io)
1449 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
1450 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1451 struct device *dev = rsnd_priv_to_dev(priv);
1454 dev_warn(dev, "Can't update kctrl when idle\n");
1461 struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg)
1463 cfg->cfg.val = cfg->val;
1468 struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg)
1470 cfg->cfg.val = &cfg->val;
1475 const char * const volume_ramp_rate[] = {
1476 "128 dB/1 step", /* 00000 */
1477 "64 dB/1 step", /* 00001 */
1478 "32 dB/1 step", /* 00010 */
1479 "16 dB/1 step", /* 00011 */
1480 "8 dB/1 step", /* 00100 */
1481 "4 dB/1 step", /* 00101 */
1482 "2 dB/1 step", /* 00110 */
1483 "1 dB/1 step", /* 00111 */
1484 "0.5 dB/1 step", /* 01000 */
1485 "0.25 dB/1 step", /* 01001 */
1486 "0.125 dB/1 step", /* 01010 = VOLUME_RAMP_MAX_MIX */
1487 "0.125 dB/2 steps", /* 01011 */
1488 "0.125 dB/4 steps", /* 01100 */
1489 "0.125 dB/8 steps", /* 01101 */
1490 "0.125 dB/16 steps", /* 01110 */
1491 "0.125 dB/32 steps", /* 01111 */
1492 "0.125 dB/64 steps", /* 10000 */
1493 "0.125 dB/128 steps", /* 10001 */
1494 "0.125 dB/256 steps", /* 10010 */
1495 "0.125 dB/512 steps", /* 10011 */
1496 "0.125 dB/1024 steps", /* 10100 */
1497 "0.125 dB/2048 steps", /* 10101 */
1498 "0.125 dB/4096 steps", /* 10110 */
1499 "0.125 dB/8192 steps", /* 10111 = VOLUME_RAMP_MAX_DVC */
1502 int rsnd_kctrl_new(struct rsnd_mod *mod,
1503 struct rsnd_dai_stream *io,
1504 struct snd_soc_pcm_runtime *rtd,
1505 const unsigned char *name,
1506 int (*accept)(struct rsnd_dai_stream *io),
1507 void (*update)(struct rsnd_dai_stream *io,
1508 struct rsnd_mod *mod),
1509 struct rsnd_kctrl_cfg *cfg,
1510 const char * const *texts,
1514 struct snd_card *card = rtd->card->snd_card;
1515 struct snd_kcontrol *kctrl;
1516 struct snd_kcontrol_new knew = {
1517 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1519 .info = rsnd_kctrl_info,
1521 .get = rsnd_kctrl_get,
1522 .put = rsnd_kctrl_put,
1527 * 1) Avoid duplicate register for DVC with MIX case
1528 * 2) Allow duplicate register for MIX
1529 * 3) re-register if card was rebinded
1531 list_for_each_entry(kctrl, &card->controls, list) {
1532 struct rsnd_kctrl_cfg *c = kctrl->private_data;
1538 if (size > RSND_MAX_CHANNELS)
1541 kctrl = snd_ctl_new1(&knew, cfg);
1545 ret = snd_ctl_add(card, kctrl);
1552 cfg->accept = accept;
1553 cfg->update = update;
1566 #define PREALLOC_BUFFER (32 * 1024)
1567 #define PREALLOC_BUFFER_MAX (32 * 1024)
1569 static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
1570 struct rsnd_dai_stream *io,
1573 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1574 struct device *dev = rsnd_priv_to_dev(priv);
1575 struct snd_pcm_substream *substream;
1578 * use Audio-DMAC dev if we can use IPMMU
1580 * rsnd_dmaen_attach()
1585 for (substream = rtd->pcm->streams[stream].substream;
1587 substream = substream->next) {
1588 snd_pcm_lib_preallocate_pages(substream,
1591 PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
1597 static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
1599 struct snd_soc_dai *dai = rtd->cpu_dai;
1600 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1603 ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
1607 ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
1611 ret = rsnd_preallocate_pages(rtd, &rdai->playback,
1612 SNDRV_PCM_STREAM_PLAYBACK);
1616 ret = rsnd_preallocate_pages(rtd, &rdai->capture,
1617 SNDRV_PCM_STREAM_CAPTURE);
1624 static const struct snd_soc_component_driver rsnd_soc_component = {
1625 .ops = &rsnd_pcm_ops,
1626 .pcm_new = rsnd_pcm_new,
1630 static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
1631 struct rsnd_dai_stream *io)
1635 ret = rsnd_dai_call(probe, io, priv);
1636 if (ret == -EAGAIN) {
1637 struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
1638 struct rsnd_mod *mod;
1642 * Fallback to PIO mode
1646 * call "remove" for SSI/SRC/DVC
1647 * SSI will be switch to PIO mode if it was DMA mode
1650 * rsnd_ssi_fallback()
1652 rsnd_dai_call(remove, io, priv);
1655 * remove all mod from io
1656 * and, re connect ssi
1658 for_each_rsnd_mod(i, mod, io)
1659 rsnd_dai_disconnect(mod, io, i);
1660 rsnd_dai_connect(ssi_mod, io, RSND_MOD_SSI);
1665 rsnd_dai_call(fallback, io, priv);
1669 * DAI has SSI which is PIO mode only now.
1671 ret = rsnd_dai_call(probe, io, priv);
1680 static int rsnd_probe(struct platform_device *pdev)
1682 struct rsnd_priv *priv;
1683 struct device *dev = &pdev->dev;
1684 struct rsnd_dai *rdai;
1685 int (*probe_func[])(struct rsnd_priv *priv) = {
1703 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
1708 priv->flags = (unsigned long)of_device_get_match_data(dev);
1709 spin_lock_init(&priv->lock);
1714 for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
1715 ret = probe_func[i](priv);
1720 for_each_rsnd_dai(rdai, priv, i) {
1721 ret = rsnd_rdai_continuance_probe(priv, &rdai->playback);
1723 goto exit_snd_probe;
1725 ret = rsnd_rdai_continuance_probe(priv, &rdai->capture);
1727 goto exit_snd_probe;
1730 dev_set_drvdata(dev, priv);
1735 ret = devm_snd_soc_register_component(dev, &rsnd_soc_component,
1736 priv->daidrv, rsnd_rdai_nr(priv));
1738 dev_err(dev, "cannot snd dai register\n");
1739 goto exit_snd_probe;
1742 pm_runtime_enable(dev);
1744 dev_info(dev, "probed\n");
1748 for_each_rsnd_dai(rdai, priv, i) {
1749 rsnd_dai_call(remove, &rdai->playback, priv);
1750 rsnd_dai_call(remove, &rdai->capture, priv);
1754 * adg is very special mod which can't use rsnd_dai_call(remove),
1755 * and it registers ADG clock on probe.
1756 * It should be unregister if probe failed.
1757 * Mainly it is assuming -EPROBE_DEFER case
1759 rsnd_adg_remove(priv);
1764 static int rsnd_remove(struct platform_device *pdev)
1766 struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
1767 struct rsnd_dai *rdai;
1768 void (*remove_func[])(struct rsnd_priv *priv) = {
1780 snd_soc_disconnect_sync(&pdev->dev);
1782 pm_runtime_disable(&pdev->dev);
1784 for_each_rsnd_dai(rdai, priv, i) {
1785 ret |= rsnd_dai_call(remove, &rdai->playback, priv);
1786 ret |= rsnd_dai_call(remove, &rdai->capture, priv);
1789 for (i = 0; i < ARRAY_SIZE(remove_func); i++)
1790 remove_func[i](priv);
1795 static int __maybe_unused rsnd_suspend(struct device *dev)
1797 struct rsnd_priv *priv = dev_get_drvdata(dev);
1799 rsnd_adg_clk_disable(priv);
1804 static int __maybe_unused rsnd_resume(struct device *dev)
1806 struct rsnd_priv *priv = dev_get_drvdata(dev);
1808 rsnd_adg_clk_enable(priv);
1813 static const struct dev_pm_ops rsnd_pm_ops = {
1814 SET_SYSTEM_SLEEP_PM_OPS(rsnd_suspend, rsnd_resume)
1817 static struct platform_driver rsnd_driver = {
1819 .name = "rcar_sound",
1821 .of_match_table = rsnd_of_match,
1823 .probe = rsnd_probe,
1824 .remove = rsnd_remove,
1826 module_platform_driver(rsnd_driver);
1828 MODULE_LICENSE("GPL v2");
1829 MODULE_DESCRIPTION("Renesas R-Car audio driver");
1830 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
1831 MODULE_ALIAS("platform:rcar-pcm-audio");