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_connect_simple(struct rsnd_priv *priv,
1035 struct device_node *dai_np,
1036 int dai_i, int is_play)
1038 struct device *dev = rsnd_priv_to_dev(priv);
1039 struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
1040 struct rsnd_dai_stream *io = is_play ?
1043 struct device_node *ssiu_np = rsnd_ssiu_of_node(priv);
1044 struct device_node *np;
1050 if (!rsnd_io_to_mod_ssi(io))
1054 * This driver assumes that it is TDM Split mode
1055 * if it includes ssiu node
1058 struct device_node *node = is_play ?
1059 of_parse_phandle(dai_np, "playback", i) :
1060 of_parse_phandle(dai_np, "capture", i);
1066 for_each_child_of_node(ssiu_np, np) {
1068 rsnd_flags_set(io, RSND_STREAM_TDM_SPLIT);
1069 dev_dbg(dev, "%s is part of TDM Split\n", io->name);
1077 static void rsnd_parse_connect_graph(struct rsnd_priv *priv,
1078 struct rsnd_dai_stream *io,
1079 struct device_node *endpoint)
1081 struct device *dev = rsnd_priv_to_dev(priv);
1082 struct device_node *remote_port = of_graph_get_remote_port(endpoint);
1083 struct device_node *remote_node = of_graph_get_remote_port_parent(endpoint);
1085 if (!rsnd_io_to_mod_ssi(io))
1089 if (strstr(remote_node->full_name, "hdmi@fead0000")) {
1090 rsnd_flags_set(io, RSND_STREAM_HDMI0);
1091 dev_dbg(dev, "%s connected to HDMI0\n", io->name);
1095 if (strstr(remote_node->full_name, "hdmi@feae0000")) {
1096 rsnd_flags_set(io, RSND_STREAM_HDMI1);
1097 dev_dbg(dev, "%s connected to HDMI1\n", io->name);
1101 * This driver assumes that it is TDM Split mode
1102 * if remote node has multi endpoint
1104 if (of_get_child_count(remote_port) > 1) {
1105 rsnd_flags_set(io, RSND_STREAM_TDM_SPLIT);
1106 dev_dbg(dev, "%s is part of TDM Split\n", io->name);
1110 void rsnd_parse_connect_common(struct rsnd_dai *rdai,
1111 struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id),
1112 struct device_node *node,
1113 struct device_node *playback,
1114 struct device_node *capture)
1116 struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
1117 struct device_node *np;
1118 struct rsnd_mod *mod;
1125 for_each_child_of_node(node, np) {
1126 mod = mod_get(priv, i);
1128 rsnd_dai_connect(mod, &rdai->playback, mod->type);
1130 rsnd_dai_connect(mod, &rdai->capture, mod->type);
1137 static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv,
1140 struct device *dev = rsnd_priv_to_dev(priv);
1141 struct device_node *np = dev->of_node;
1142 struct device_node *dai_node;
1143 struct device_node *ret;
1148 * parse both previous dai (= rcar_sound,dai), and
1149 * graph dai (= ports/port)
1151 dai_node = of_get_child_by_name(np, RSND_NODE_DAI);
1154 goto of_node_compatible;
1159 dai_node = of_graph_get_next_endpoint(np, NULL);
1168 of_node_put(dai_node);
1173 static void __rsnd_dai_probe(struct rsnd_priv *priv,
1174 struct device_node *dai_np,
1177 struct device_node *playback, *capture;
1178 struct rsnd_dai_stream *io_playback;
1179 struct rsnd_dai_stream *io_capture;
1180 struct snd_soc_dai_driver *drv;
1181 struct rsnd_dai *rdai;
1182 struct device *dev = rsnd_priv_to_dev(priv);
1185 rdai = rsnd_rdai_get(priv, dai_i);
1186 drv = rsnd_daidrv_get(priv, dai_i);
1187 io_playback = &rdai->playback;
1188 io_capture = &rdai->capture;
1190 snprintf(rdai->name, RSND_DAI_NAME_SIZE, "rsnd-dai.%d", dai_i);
1193 drv->name = rdai->name;
1194 drv->ops = &rsnd_soc_dai_ops;
1196 snprintf(io_playback->name, RSND_DAI_NAME_SIZE,
1197 "DAI%d Playback", dai_i);
1198 drv->playback.rates = RSND_RATES;
1199 drv->playback.formats = RSND_FMTS;
1200 drv->playback.channels_min = 2;
1201 drv->playback.channels_max = 8;
1202 drv->playback.stream_name = io_playback->name;
1204 snprintf(io_capture->name, RSND_DAI_NAME_SIZE,
1205 "DAI%d Capture", dai_i);
1206 drv->capture.rates = RSND_RATES;
1207 drv->capture.formats = RSND_FMTS;
1208 drv->capture.channels_min = 2;
1209 drv->capture.channels_max = 8;
1210 drv->capture.stream_name = io_capture->name;
1212 io_playback->rdai = rdai;
1213 io_capture->rdai = rdai;
1214 rsnd_rdai_channels_set(rdai, 2); /* default 2ch */
1215 rsnd_rdai_ssi_lane_set(rdai, 1); /* default 1lane */
1216 rsnd_rdai_width_set(rdai, 32); /* default 32bit width */
1218 for (io_i = 0;; io_i++) {
1219 playback = of_parse_phandle(dai_np, "playback", io_i);
1220 capture = of_parse_phandle(dai_np, "capture", io_i);
1222 if (!playback && !capture)
1225 rsnd_parse_connect_ssi(rdai, playback, capture);
1226 rsnd_parse_connect_ssiu(rdai, playback, capture);
1227 rsnd_parse_connect_src(rdai, playback, capture);
1228 rsnd_parse_connect_ctu(rdai, playback, capture);
1229 rsnd_parse_connect_mix(rdai, playback, capture);
1230 rsnd_parse_connect_dvc(rdai, playback, capture);
1232 of_node_put(playback);
1233 of_node_put(capture);
1236 if (rsnd_ssi_is_pin_sharing(io_capture) ||
1237 rsnd_ssi_is_pin_sharing(io_playback)) {
1238 /* should have symmetric_rates if pin sharing */
1239 drv->symmetric_rates = 1;
1242 dev_dbg(dev, "%s (%s/%s)\n", rdai->name,
1243 rsnd_io_to_mod_ssi(io_playback) ? "play" : " -- ",
1244 rsnd_io_to_mod_ssi(io_capture) ? "capture" : " -- ");
1247 static int rsnd_dai_probe(struct rsnd_priv *priv)
1249 struct device_node *dai_node;
1250 struct device_node *dai_np;
1251 struct snd_soc_dai_driver *rdrv;
1252 struct device *dev = rsnd_priv_to_dev(priv);
1253 struct rsnd_dai *rdai;
1258 dai_node = rsnd_dai_of_node(priv, &is_graph);
1260 nr = of_graph_get_endpoint_count(dai_node);
1262 nr = of_get_child_count(dai_node);
1267 rdrv = devm_kcalloc(dev, nr, sizeof(*rdrv), GFP_KERNEL);
1268 rdai = devm_kcalloc(dev, nr, sizeof(*rdai), GFP_KERNEL);
1273 priv->daidrv = rdrv;
1281 for_each_endpoint_of_node(dai_node, dai_np) {
1282 __rsnd_dai_probe(priv, dai_np, dai_i);
1283 if (rsnd_is_gen3(priv)) {
1284 struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
1286 rsnd_parse_connect_graph(priv, &rdai->playback, dai_np);
1287 rsnd_parse_connect_graph(priv, &rdai->capture, dai_np);
1292 for_each_child_of_node(dai_node, dai_np) {
1293 __rsnd_dai_probe(priv, dai_np, dai_i);
1294 if (rsnd_is_gen3(priv)) {
1295 rsnd_parse_connect_simple(priv, dai_np, dai_i, 1);
1296 rsnd_parse_connect_simple(priv, dai_np, dai_i, 0);
1308 static int rsnd_hw_params(struct snd_pcm_substream *substream,
1309 struct snd_pcm_hw_params *hw_params)
1311 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
1312 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1313 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1314 struct snd_soc_pcm_runtime *fe = substream->private_data;
1318 * rsnd assumes that it might be used under DPCM if user want to use
1319 * channel / rate convert. Then, rsnd should be FE.
1320 * And then, this function will be called *after* BE settings.
1321 * this means, each BE already has fixuped hw_params.
1323 * dpcm_fe_dai_hw_params()
1324 * dpcm_be_dai_hw_params()
1326 io->converted_rate = 0;
1327 io->converted_chan = 0;
1328 if (fe->dai_link->dynamic) {
1329 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1330 struct device *dev = rsnd_priv_to_dev(priv);
1331 struct snd_soc_dpcm *dpcm;
1332 struct snd_pcm_hw_params *be_params;
1333 int stream = substream->stream;
1335 for_each_dpcm_be(fe, stream, dpcm) {
1336 be_params = &dpcm->hw_params;
1337 if (params_channels(hw_params) != params_channels(be_params))
1338 io->converted_chan = params_channels(be_params);
1339 if (params_rate(hw_params) != params_rate(be_params))
1340 io->converted_rate = params_rate(be_params);
1342 if (io->converted_chan)
1343 dev_dbg(dev, "convert channels = %d\n", io->converted_chan);
1344 if (io->converted_rate)
1345 dev_dbg(dev, "convert rate = %d\n", io->converted_rate);
1348 ret = rsnd_dai_call(hw_params, io, substream, hw_params);
1352 return snd_pcm_lib_malloc_pages(substream,
1353 params_buffer_bytes(hw_params));
1356 static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream)
1358 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
1359 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1360 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
1361 snd_pcm_uframes_t pointer = 0;
1363 rsnd_dai_call(pointer, io, &pointer);
1368 static const struct snd_pcm_ops rsnd_pcm_ops = {
1369 .ioctl = snd_pcm_lib_ioctl,
1370 .hw_params = rsnd_hw_params,
1371 .hw_free = snd_pcm_lib_free_pages,
1372 .pointer = rsnd_pointer,
1378 static int rsnd_kctrl_info(struct snd_kcontrol *kctrl,
1379 struct snd_ctl_elem_info *uinfo)
1381 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1384 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1385 uinfo->count = cfg->size;
1386 uinfo->value.enumerated.items = cfg->max;
1387 if (uinfo->value.enumerated.item >= cfg->max)
1388 uinfo->value.enumerated.item = cfg->max - 1;
1389 strlcpy(uinfo->value.enumerated.name,
1390 cfg->texts[uinfo->value.enumerated.item],
1391 sizeof(uinfo->value.enumerated.name));
1393 uinfo->count = cfg->size;
1394 uinfo->value.integer.min = 0;
1395 uinfo->value.integer.max = cfg->max;
1396 uinfo->type = (cfg->max == 1) ?
1397 SNDRV_CTL_ELEM_TYPE_BOOLEAN :
1398 SNDRV_CTL_ELEM_TYPE_INTEGER;
1404 static int rsnd_kctrl_get(struct snd_kcontrol *kctrl,
1405 struct snd_ctl_elem_value *uc)
1407 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1410 for (i = 0; i < cfg->size; i++)
1412 uc->value.enumerated.item[i] = cfg->val[i];
1414 uc->value.integer.value[i] = cfg->val[i];
1419 static int rsnd_kctrl_put(struct snd_kcontrol *kctrl,
1420 struct snd_ctl_elem_value *uc)
1422 struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl);
1425 if (!cfg->accept(cfg->io))
1428 for (i = 0; i < cfg->size; i++) {
1430 change |= (uc->value.enumerated.item[i] != cfg->val[i]);
1431 cfg->val[i] = uc->value.enumerated.item[i];
1433 change |= (uc->value.integer.value[i] != cfg->val[i]);
1434 cfg->val[i] = uc->value.integer.value[i];
1438 if (change && cfg->update)
1439 cfg->update(cfg->io, cfg->mod);
1444 int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)
1449 int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io)
1451 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
1452 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1453 struct device *dev = rsnd_priv_to_dev(priv);
1456 dev_warn(dev, "Can't update kctrl when idle\n");
1463 struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg)
1465 cfg->cfg.val = cfg->val;
1470 struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg)
1472 cfg->cfg.val = &cfg->val;
1477 const char * const volume_ramp_rate[] = {
1478 "128 dB/1 step", /* 00000 */
1479 "64 dB/1 step", /* 00001 */
1480 "32 dB/1 step", /* 00010 */
1481 "16 dB/1 step", /* 00011 */
1482 "8 dB/1 step", /* 00100 */
1483 "4 dB/1 step", /* 00101 */
1484 "2 dB/1 step", /* 00110 */
1485 "1 dB/1 step", /* 00111 */
1486 "0.5 dB/1 step", /* 01000 */
1487 "0.25 dB/1 step", /* 01001 */
1488 "0.125 dB/1 step", /* 01010 = VOLUME_RAMP_MAX_MIX */
1489 "0.125 dB/2 steps", /* 01011 */
1490 "0.125 dB/4 steps", /* 01100 */
1491 "0.125 dB/8 steps", /* 01101 */
1492 "0.125 dB/16 steps", /* 01110 */
1493 "0.125 dB/32 steps", /* 01111 */
1494 "0.125 dB/64 steps", /* 10000 */
1495 "0.125 dB/128 steps", /* 10001 */
1496 "0.125 dB/256 steps", /* 10010 */
1497 "0.125 dB/512 steps", /* 10011 */
1498 "0.125 dB/1024 steps", /* 10100 */
1499 "0.125 dB/2048 steps", /* 10101 */
1500 "0.125 dB/4096 steps", /* 10110 */
1501 "0.125 dB/8192 steps", /* 10111 = VOLUME_RAMP_MAX_DVC */
1504 int rsnd_kctrl_new(struct rsnd_mod *mod,
1505 struct rsnd_dai_stream *io,
1506 struct snd_soc_pcm_runtime *rtd,
1507 const unsigned char *name,
1508 int (*accept)(struct rsnd_dai_stream *io),
1509 void (*update)(struct rsnd_dai_stream *io,
1510 struct rsnd_mod *mod),
1511 struct rsnd_kctrl_cfg *cfg,
1512 const char * const *texts,
1516 struct snd_card *card = rtd->card->snd_card;
1517 struct snd_kcontrol *kctrl;
1518 struct snd_kcontrol_new knew = {
1519 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1521 .info = rsnd_kctrl_info,
1523 .get = rsnd_kctrl_get,
1524 .put = rsnd_kctrl_put,
1529 * 1) Avoid duplicate register (ex. MIXer case)
1530 * 2) re-register if card was rebinded
1532 list_for_each_entry(kctrl, &card->controls, list) {
1533 struct rsnd_kctrl_cfg *c = kctrl->private_data;
1535 if (strcmp(kctrl->id.name, name) == 0 &&
1540 if (size > RSND_MAX_CHANNELS)
1543 kctrl = snd_ctl_new1(&knew, cfg);
1547 ret = snd_ctl_add(card, kctrl);
1554 cfg->accept = accept;
1555 cfg->update = update;
1568 #define PREALLOC_BUFFER (32 * 1024)
1569 #define PREALLOC_BUFFER_MAX (32 * 1024)
1571 static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
1572 struct rsnd_dai_stream *io,
1575 struct rsnd_priv *priv = rsnd_io_to_priv(io);
1576 struct device *dev = rsnd_priv_to_dev(priv);
1577 struct snd_pcm_substream *substream;
1581 * use Audio-DMAC dev if we can use IPMMU
1583 * rsnd_dmaen_attach()
1588 for (substream = rtd->pcm->streams[stream].substream;
1590 substream = substream->next) {
1591 err = snd_pcm_lib_preallocate_pages(substream,
1594 PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
1602 static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
1604 struct snd_soc_dai *dai = rtd->cpu_dai;
1605 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1608 ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
1612 ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
1616 ret = rsnd_preallocate_pages(rtd, &rdai->playback,
1617 SNDRV_PCM_STREAM_PLAYBACK);
1621 ret = rsnd_preallocate_pages(rtd, &rdai->capture,
1622 SNDRV_PCM_STREAM_CAPTURE);
1629 static const struct snd_soc_component_driver rsnd_soc_component = {
1630 .ops = &rsnd_pcm_ops,
1631 .pcm_new = rsnd_pcm_new,
1635 static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
1636 struct rsnd_dai_stream *io)
1640 ret = rsnd_dai_call(probe, io, priv);
1641 if (ret == -EAGAIN) {
1642 struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
1643 struct rsnd_mod *mod;
1647 * Fallback to PIO mode
1651 * call "remove" for SSI/SRC/DVC
1652 * SSI will be switch to PIO mode if it was DMA mode
1655 * rsnd_ssi_fallback()
1657 rsnd_dai_call(remove, io, priv);
1660 * remove all mod from io
1661 * and, re connect ssi
1663 for_each_rsnd_mod(i, mod, io)
1664 rsnd_dai_disconnect(mod, io, i);
1665 rsnd_dai_connect(ssi_mod, io, RSND_MOD_SSI);
1670 rsnd_dai_call(fallback, io, priv);
1674 * DAI has SSI which is PIO mode only now.
1676 ret = rsnd_dai_call(probe, io, priv);
1685 static int rsnd_probe(struct platform_device *pdev)
1687 struct rsnd_priv *priv;
1688 struct device *dev = &pdev->dev;
1689 struct rsnd_dai *rdai;
1690 int (*probe_func[])(struct rsnd_priv *priv) = {
1708 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
1713 priv->flags = (unsigned long)of_device_get_match_data(dev);
1714 spin_lock_init(&priv->lock);
1719 for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
1720 ret = probe_func[i](priv);
1725 for_each_rsnd_dai(rdai, priv, i) {
1726 ret = rsnd_rdai_continuance_probe(priv, &rdai->playback);
1728 goto exit_snd_probe;
1730 ret = rsnd_rdai_continuance_probe(priv, &rdai->capture);
1732 goto exit_snd_probe;
1735 dev_set_drvdata(dev, priv);
1740 ret = devm_snd_soc_register_component(dev, &rsnd_soc_component,
1741 priv->daidrv, rsnd_rdai_nr(priv));
1743 dev_err(dev, "cannot snd dai register\n");
1744 goto exit_snd_probe;
1747 pm_runtime_enable(dev);
1749 dev_info(dev, "probed\n");
1753 for_each_rsnd_dai(rdai, priv, i) {
1754 rsnd_dai_call(remove, &rdai->playback, priv);
1755 rsnd_dai_call(remove, &rdai->capture, priv);
1759 * adg is very special mod which can't use rsnd_dai_call(remove),
1760 * and it registers ADG clock on probe.
1761 * It should be unregister if probe failed.
1762 * Mainly it is assuming -EPROBE_DEFER case
1764 rsnd_adg_remove(priv);
1769 static int rsnd_remove(struct platform_device *pdev)
1771 struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
1772 struct rsnd_dai *rdai;
1773 void (*remove_func[])(struct rsnd_priv *priv) = {
1785 snd_soc_disconnect_sync(&pdev->dev);
1787 pm_runtime_disable(&pdev->dev);
1789 for_each_rsnd_dai(rdai, priv, i) {
1790 ret |= rsnd_dai_call(remove, &rdai->playback, priv);
1791 ret |= rsnd_dai_call(remove, &rdai->capture, priv);
1794 for (i = 0; i < ARRAY_SIZE(remove_func); i++)
1795 remove_func[i](priv);
1800 static int __maybe_unused rsnd_suspend(struct device *dev)
1802 struct rsnd_priv *priv = dev_get_drvdata(dev);
1804 rsnd_adg_clk_disable(priv);
1809 static int __maybe_unused rsnd_resume(struct device *dev)
1811 struct rsnd_priv *priv = dev_get_drvdata(dev);
1813 rsnd_adg_clk_enable(priv);
1818 static const struct dev_pm_ops rsnd_pm_ops = {
1819 SET_SYSTEM_SLEEP_PM_OPS(rsnd_suspend, rsnd_resume)
1822 static struct platform_driver rsnd_driver = {
1824 .name = "rcar_sound",
1826 .of_match_table = rsnd_of_match,
1828 .probe = rsnd_probe,
1829 .remove = rsnd_remove,
1831 module_platform_driver(rsnd_driver);
1833 MODULE_LICENSE("GPL v2");
1834 MODULE_DESCRIPTION("Renesas R-Car audio driver");
1835 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
1836 MODULE_ALIAS("platform:rcar-pcm-audio");