mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
ASoC: renesas: rz-ssi: Move DMA configuration
Move DMA configuration from rz_ssi_dma_request() to rz_ssi_dai_trigger() for supporting sample widths higher than 16. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a472f0b157
commit
b541cb0a27
|
|
@ -774,14 +774,6 @@ static int rz_ssi_dma_request(struct rz_ssi_priv *ssi, struct device *dev)
|
|||
if (!rz_ssi_is_dma_enabled(ssi))
|
||||
goto no_dma;
|
||||
|
||||
if (ssi->playback.dma_ch &&
|
||||
(rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch, true) < 0))
|
||||
goto no_dma;
|
||||
|
||||
if (ssi->capture.dma_ch &&
|
||||
(rz_ssi_dma_slave_config(ssi, ssi->capture.dma_ch, false) < 0))
|
||||
goto no_dma;
|
||||
|
||||
return 0;
|
||||
|
||||
no_dma:
|
||||
|
|
@ -829,24 +821,27 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
if (cmd == SNDRV_PCM_TRIGGER_START)
|
||||
rz_ssi_stream_init(strm, substream);
|
||||
|
||||
if (ssi->dma_rt) {
|
||||
bool is_playback;
|
||||
if (rz_ssi_is_dma_enabled(ssi)) {
|
||||
bool is_playback = rz_ssi_stream_is_play(substream);
|
||||
|
||||
if (ssi->dma_rt)
|
||||
ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch,
|
||||
is_playback);
|
||||
else
|
||||
ret = rz_ssi_dma_slave_config(ssi, strm->dma_ch,
|
||||
is_playback);
|
||||
|
||||
is_playback = rz_ssi_stream_is_play(substream);
|
||||
ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch,
|
||||
is_playback);
|
||||
/* Fallback to pio */
|
||||
if (ret < 0) {
|
||||
ssi->playback.transfer = rz_ssi_pio_send;
|
||||
ssi->capture.transfer = rz_ssi_pio_recv;
|
||||
rz_ssi_release_dma_channels(ssi);
|
||||
} else {
|
||||
/* For DMA, queue up multiple DMA descriptors */
|
||||
num_transfer = 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* For DMA, queue up multiple DMA descriptors */
|
||||
if (rz_ssi_is_dma_enabled(ssi))
|
||||
num_transfer = 4;
|
||||
|
||||
for (i = 0; i < num_transfer; i++) {
|
||||
ret = strm->transfer(ssi, strm);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user