Lines Matching +full:convert +full:- +full:rate
1 // SPDX-License-Identifier: GPL-2.0
3 // Renesas R-Car SRC support
9 * You can use Synchronous Sampling Rate Convert (if no DVC)
11 * amixer set "SRC Out Rate" on
13 * amixer set "SRC Out Rate" 96000 // convert rate to 96000Hz
14 * amixer set "SRC Out Rate" 22050 // convert rate to 22050Hz
35 struct rsnd_kctrl_cfg_s sen; /* sync convert enable */
36 struct rsnd_kctrl_cfg_s sync; /* sync convert */
42 #define rsnd_src_get(priv, id) ((struct rsnd_src *)(priv->src) + id)
43 #define rsnd_src_nr(priv) ((priv)->src_nr)
44 #define rsnd_src_sync_is_enabled(mod) (rsnd_mod_to_src(mod)->sen.val)
52 ((pos) = (struct rsnd_src *)(priv)->src + i); \
57 * image of SRC (Sampling Rate Converter)
59 * 96kHz <-> +-----+ 48kHz +-----+ 48kHz +-------+
60 * 48kHz <-> | SRC | <------> | SSI | <-----> | codec |
61 * 44.1kHz <-> +-----+ +-----+ +-------+
102 convert_rate = src->sync.val; in rsnd_src_convert_rate()
108 convert_rate = runtime->rate; in rsnd_src_convert_rate()
119 unsigned int rate = 0; in rsnd_src_get_rate() local
124 * runtime_rate -> [SRC] -> convert_rate in rsnd_src_get_rate()
127 * convert_rate -> [SRC] -> runtime_rate in rsnd_src_get_rate()
131 return runtime->rate; in rsnd_src_get_rate()
134 * return convert rate if SRC is used, in rsnd_src_get_rate()
135 * otherwise, return runtime->rate as usual in rsnd_src_get_rate()
138 rate = rsnd_src_convert_rate(io, src_mod); in rsnd_src_get_rate()
140 if (!rate) in rsnd_src_get_rate()
141 rate = runtime->rate; in rsnd_src_get_rate()
143 return rate; in rsnd_src_get_rate()
147 0x01800000, /* 6 - 1/6 */
148 0x01000000, /* 6 - 1/4 */
149 0x00c00000, /* 6 - 1/3 */
150 0x00800000, /* 6 - 1/2 */
151 0x00600000, /* 6 - 2/3 */
152 0x00400000, /* 6 - 1 */
156 0x02400000, /* 6 - 1/6 */
157 0x01800000, /* 6 - 1/4 */
158 0x01200000, /* 6 - 1/3 */
159 0x00c00000, /* 6 - 1/2 */
160 0x00900000, /* 6 - 2/3 */
161 0x00600000, /* 6 - 1 */
165 0x00100060, /* 6 - 1/6 */
166 0x00100040, /* 6 - 1/4 */
167 0x00100030, /* 6 - 1/3 */
168 0x00100020, /* 6 - 1/2 */
169 0x00100020, /* 6 - 2/3 */
170 0x00100020, /* 6 - 1 */
226 /* 6 - 1/6 are very enough ratio for SRC_BSDSR */ in rsnd_src_set_convert_rate()
363 int irq = src->irq; in rsnd_src_irq()
371 * IRQ is not supported on non-DT in rsnd_src_irq()
442 * Enable SRC output if you want to use sync convert together with DVC in rsnd_src_start()
469 src->sync.val = 0; in rsnd_src_init()
495 src->sync.val = 0; in rsnd_src_quit()
506 spin_lock(&priv->lock); in __rsnd_src_interrupt()
518 spin_unlock(&priv->lock); in __rsnd_src_interrupt()
521 snd_pcm_stop_xrun(io->substream); in __rsnd_src_interrupt()
539 int irq = src->irq; in rsnd_src_probe_()
544 * IRQ is not supported on non-DT in rsnd_src_probe_()
556 ret = rsnd_dma_attach(io, mod, &src->dma); in rsnd_src_probe_()
569 * enable SRC sync convert if possible in rsnd_src_pcm_new()
573 * It can't use SRC Synchronous convert in rsnd_src_pcm_new()
580 * enable sync convert in rsnd_src_pcm_new()
584 "SRC Out Rate Switch" : in rsnd_src_pcm_new()
585 "SRC In Rate Switch", in rsnd_src_pcm_new()
588 &src->sen, 1); in rsnd_src_pcm_new()
594 "SRC Out Rate" : in rsnd_src_pcm_new()
595 "SRC In Rate", in rsnd_src_pcm_new()
598 &src->sync, 192000); in rsnd_src_pcm_new()
664 ret = -EINVAL; in rsnd_src_probe()
670 ret = -ENOMEM; in rsnd_src_probe()
674 priv->src_nr = nr; in rsnd_src_probe()
675 priv->src = src; in rsnd_src_probe()
684 ret = -EINVAL; in rsnd_src_probe()
694 src->irq = irq_of_parse_and_map(np, 0); in rsnd_src_probe()
695 if (!src->irq) { in rsnd_src_probe()
696 ret = -EINVAL; in rsnd_src_probe()