ASoC: uniphier: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87369zir3b.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
f7c4880113
Коммит
41759f4c43
|
@ -23,7 +23,7 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd)
|
|||
{
|
||||
struct snd_compr *compr = rtd->compr;
|
||||
struct device *dev = compr->card->dev;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[compr->direction];
|
||||
size_t size = AUD_RING_SIZE;
|
||||
int dma_dir = DMA_FROM_DEVICE, ret;
|
||||
|
@ -56,7 +56,7 @@ static int uniphier_aio_comprdma_free(struct snd_soc_pcm_runtime *rtd)
|
|||
{
|
||||
struct snd_compr *compr = rtd->compr;
|
||||
struct device *dev = compr->card->dev;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[compr->direction];
|
||||
int dma_dir = DMA_FROM_DEVICE;
|
||||
|
||||
|
@ -73,7 +73,7 @@ static int uniphier_aio_comprdma_free(struct snd_soc_pcm_runtime *rtd)
|
|||
static int uniphier_aio_compr_open(struct snd_compr_stream *cstream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
int ret;
|
||||
|
||||
|
@ -98,7 +98,7 @@ static int uniphier_aio_compr_open(struct snd_compr_stream *cstream)
|
|||
static int uniphier_aio_compr_free(struct snd_compr_stream *cstream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
int ret;
|
||||
|
||||
|
@ -118,7 +118,7 @@ static int uniphier_aio_compr_get_params(struct snd_compr_stream *cstream,
|
|||
struct snd_codec *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
|
||||
*params = sub->cparams.codec;
|
||||
|
@ -130,7 +130,7 @@ static int uniphier_aio_compr_set_params(struct snd_compr_stream *cstream,
|
|||
struct snd_compr_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
struct device *dev = &aio->chip->pdev->dev;
|
||||
int ret;
|
||||
|
@ -165,7 +165,7 @@ static int uniphier_aio_compr_set_params(struct snd_compr_stream *cstream,
|
|||
static int uniphier_aio_compr_hw_free(struct snd_compr_stream *cstream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
|
||||
sub->setting = 0;
|
||||
|
@ -177,7 +177,7 @@ static int uniphier_aio_compr_prepare(struct snd_compr_stream *cstream)
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
int bytes = runtime->fragment_size;
|
||||
unsigned long flags;
|
||||
|
@ -215,7 +215,7 @@ static int uniphier_aio_compr_trigger(struct snd_compr_stream *cstream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
struct device *dev = &aio->chip->pdev->dev;
|
||||
int bytes = runtime->fragment_size, ret = 0;
|
||||
|
@ -248,7 +248,7 @@ static int uniphier_aio_compr_pointer(struct snd_compr_stream *cstream,
|
|||
{
|
||||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
int bytes = runtime->fragment_size;
|
||||
unsigned long flags;
|
||||
|
@ -322,7 +322,7 @@ static int uniphier_aio_compr_copy(struct snd_compr_stream *cstream,
|
|||
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct device *carddev = rtd->compr->card->dev;
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
|
||||
size_t cnt = min_t(size_t, count, aio_rb_space_to_end(sub) / 2);
|
||||
int bytes = runtime->fragment_size;
|
||||
|
|
|
@ -109,7 +109,7 @@ static int uniphier_aiodma_prepare(struct snd_soc_component *component,
|
|||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
|
||||
int bytes = runtime->period_size *
|
||||
runtime->channels * samples_to_bytes(runtime, 1);
|
||||
|
@ -136,7 +136,7 @@ static int uniphier_aiodma_trigger(struct snd_soc_component *component,
|
|||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
|
||||
struct device *dev = &aio->chip->pdev->dev;
|
||||
int bytes = runtime->period_size *
|
||||
|
@ -172,7 +172,7 @@ static snd_pcm_uframes_t uniphier_aiodma_pointer(
|
|||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
|
||||
struct uniphier_aio *aio = uniphier_priv(rtd->cpu_dai);
|
||||
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
|
||||
int bytes = runtime->period_size *
|
||||
runtime->channels * samples_to_bytes(runtime, 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче