Message ID | 20220706211330.120198-3-aidanmacdonald.0x0@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Commit | 8a7691010992886290b340a1ba943067c2e70f85 |
Headers | show |
Series | ASoC: cleanups and improvements for jz4740-i2s | expand |
Le mer., juil. 6 2022 at 22:13:21 +0100, Aidan MacDonald <aidanmacdonald.0x0@gmail.com> a écrit : > It's simpler to set up the playback and capture DMA settings > at driver probe time instead of during DAI probing. > > Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> > --- > sound/soc/jz4740/jz4740-i2s.c | 23 +++++------------------ > 1 file changed, 5 insertions(+), 18 deletions(-) > > diff --git a/sound/soc/jz4740/jz4740-i2s.c > b/sound/soc/jz4740/jz4740-i2s.c > index 298ff0a83931..ecd8df70d39c 100644 > --- a/sound/soc/jz4740/jz4740-i2s.c > +++ b/sound/soc/jz4740/jz4740-i2s.c > @@ -95,7 +95,6 @@ struct i2s_soc_info { > struct jz4740_i2s { > struct resource *mem; > void __iomem *base; > - dma_addr_t phys_base; Acked-by: Paul Cercueil <paul@crapouillou.net> Note that you can remove "mem" too, it's not used anywhere. Cheers, -Paul > > struct clk *clk_aic; > struct clk *clk_i2s; > @@ -370,21 +369,6 @@ static int jz4740_i2s_resume(struct > snd_soc_component *component) > return 0; > } > > -static void jz4740_i2s_init_pcm_config(struct jz4740_i2s *i2s) > -{ > - struct snd_dmaengine_dai_dma_data *dma_data; > - > - /* Playback */ > - dma_data = &i2s->playback_dma_data; > - dma_data->maxburst = 16; > - dma_data->addr = i2s->phys_base + JZ_REG_AIC_FIFO; > - > - /* Capture */ > - dma_data = &i2s->capture_dma_data; > - dma_data->maxburst = 16; > - dma_data->addr = i2s->phys_base + JZ_REG_AIC_FIFO; > -} > - > static int jz4740_i2s_dai_probe(struct snd_soc_dai *dai) > { > struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); > @@ -395,7 +379,6 @@ static int jz4740_i2s_dai_probe(struct > snd_soc_dai *dai) > if (ret) > return ret; > > - jz4740_i2s_init_pcm_config(i2s); > snd_soc_dai_init_dma_data(dai, &i2s->playback_dma_data, > &i2s->capture_dma_data); > > @@ -529,7 +512,11 @@ static int jz4740_i2s_dev_probe(struct > platform_device *pdev) > if (IS_ERR(i2s->base)) > return PTR_ERR(i2s->base); > > - i2s->phys_base = mem->start; > + i2s->playback_dma_data.maxburst = 16; > + i2s->playback_dma_data.addr = mem->start + JZ_REG_AIC_FIFO; > + > + i2s->capture_dma_data.maxburst = 16; > + i2s->capture_dma_data.addr = mem->start + JZ_REG_AIC_FIFO; > > i2s->clk_aic = devm_clk_get(dev, "aic"); > if (IS_ERR(i2s->clk_aic)) > -- > 2.35.1 >
diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c index 298ff0a83931..ecd8df70d39c 100644 --- a/sound/soc/jz4740/jz4740-i2s.c +++ b/sound/soc/jz4740/jz4740-i2s.c @@ -95,7 +95,6 @@ struct i2s_soc_info { struct jz4740_i2s { struct resource *mem; void __iomem *base; - dma_addr_t phys_base; struct clk *clk_aic; struct clk *clk_i2s; @@ -370,21 +369,6 @@ static int jz4740_i2s_resume(struct snd_soc_component *component) return 0; } -static void jz4740_i2s_init_pcm_config(struct jz4740_i2s *i2s) -{ - struct snd_dmaengine_dai_dma_data *dma_data; - - /* Playback */ - dma_data = &i2s->playback_dma_data; - dma_data->maxburst = 16; - dma_data->addr = i2s->phys_base + JZ_REG_AIC_FIFO; - - /* Capture */ - dma_data = &i2s->capture_dma_data; - dma_data->maxburst = 16; - dma_data->addr = i2s->phys_base + JZ_REG_AIC_FIFO; -} - static int jz4740_i2s_dai_probe(struct snd_soc_dai *dai) { struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); @@ -395,7 +379,6 @@ static int jz4740_i2s_dai_probe(struct snd_soc_dai *dai) if (ret) return ret; - jz4740_i2s_init_pcm_config(i2s); snd_soc_dai_init_dma_data(dai, &i2s->playback_dma_data, &i2s->capture_dma_data); @@ -529,7 +512,11 @@ static int jz4740_i2s_dev_probe(struct platform_device *pdev) if (IS_ERR(i2s->base)) return PTR_ERR(i2s->base); - i2s->phys_base = mem->start; + i2s->playback_dma_data.maxburst = 16; + i2s->playback_dma_data.addr = mem->start + JZ_REG_AIC_FIFO; + + i2s->capture_dma_data.maxburst = 16; + i2s->capture_dma_data.addr = mem->start + JZ_REG_AIC_FIFO; i2s->clk_aic = devm_clk_get(dev, "aic"); if (IS_ERR(i2s->clk_aic))
It's simpler to set up the playback and capture DMA settings at driver probe time instead of during DAI probing. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> --- sound/soc/jz4740/jz4740-i2s.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-)