From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: [PATCH 8/8] ASoC: omap: Use common DAI DMA data Date: Wed, 3 Apr 2013 12:06:43 +0200 Message-ID: <515BFF33.6070905@ti.com> References: <1364979607-15286-1-git-send-email-lars@metafoo.de> <1364979965-15776-1-git-send-email-lars@metafoo.de> <1364979965-15776-4-git-send-email-lars@metafoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by alsa0.perex.cz (Postfix) with ESMTP id EC43A265338 for ; Wed, 3 Apr 2013 12:06:48 +0200 (CEST) In-Reply-To: <1364979965-15776-4-git-send-email-lars@metafoo.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Lars-Peter Clausen Cc: Ola Lilja , alsa-devel@alsa-project.org, Stephen Warren , Mark Brown , Nicolas Ferre , Liam Girdwood , Laxman Dewangan , Sascha Hauer , Shawn Guo , Jarkko Nikula List-Id: alsa-devel@alsa-project.org On 04/03/2013 11:06 AM, Lars-Peter Clausen wrote: > Use the common DAI DMA data struct for omap, this allows us to use the co= mmon > helper function to configure the DMA slave config based on the DAI DMA da= ta. > = > For omap-dmic and omap-mcpdm also move the DMA data from a global variabl= e to > the driver state struct. > = > Signed-off-by: Lars-Peter Clausen Looks good, works fine. Acked-by: Peter Ujfalusi > --- > sound/soc/omap/am3517evm.c | 1 - > sound/soc/omap/ams-delta.c | 1 - > sound/soc/omap/mcbsp.c | 14 +++++++------ > sound/soc/omap/mcbsp.h | 7 ++++--- > sound/soc/omap/n810.c | 1 - > sound/soc/omap/omap-abe-twl6040.c | 1 - > sound/soc/omap/omap-dmic.c | 22 ++++++++++---------- > sound/soc/omap/omap-hdmi.c | 24 ++++++++++------------ > sound/soc/omap/omap-mcbsp.c | 6 +++--- > sound/soc/omap/omap-mcpdm.c | 31 +++++++++++++---------------- > sound/soc/omap/omap-pcm.c | 42 +++++----------------------------= ------ > sound/soc/omap/omap-pcm.h | 39 ---------------------------------= --- > sound/soc/omap/omap-twl4030.c | 1 - > sound/soc/omap/omap3pandora.c | 1 - > sound/soc/omap/osk5912.c | 1 - > sound/soc/omap/rx51.c | 1 - > 16 files changed, 54 insertions(+), 139 deletions(-) > delete mode 100644 sound/soc/omap/omap-pcm.h > = > diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c > index c1900b2..994dcf3 100644 > --- a/sound/soc/omap/am3517evm.c > +++ b/sound/soc/omap/am3517evm.c > @@ -28,7 +28,6 @@ > #include > = > #include "omap-mcbsp.h" > -#include "omap-pcm.h" > = > #include "../codecs/tlv320aic23.h" > = > diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c > index 2600447..6294464 100644 > --- a/sound/soc/omap/ams-delta.c > +++ b/sound/soc/omap/ams-delta.c > @@ -36,7 +36,6 @@ > #include > = > #include "omap-mcbsp.h" > -#include "omap-pcm.h" > #include "../codecs/cx20442.h" > = > = > diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c > index 285c836..eb68c7d 100644 > --- a/sound/soc/omap/mcbsp.c > +++ b/sound/soc/omap/mcbsp.c > @@ -1018,9 +1018,10 @@ int omap_mcbsp_init(struct platform_device *pdev) > return -ENODEV; > } > /* RX DMA request number, and port address configuration */ > - mcbsp->dma_data[1].name =3D "Audio Capture"; > - mcbsp->dma_data[1].dma_req =3D res->start; > - mcbsp->dma_data[1].port_addr =3D omap_mcbsp_dma_reg_params(mcbsp, 1); > + mcbsp->dma_req[1] =3D res->start; > + mcbsp->dma_data[1].filter_data =3D &mcbsp->dma_req[1]; > + mcbsp->dma_data[1].addr =3D omap_mcbsp_dma_reg_params(mcbsp, 1); > + mcbsp->dma_data[1].maxburst =3D 4; > = > res =3D platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); > if (!res) { > @@ -1028,9 +1029,10 @@ int omap_mcbsp_init(struct platform_device *pdev) > return -ENODEV; > } > /* TX DMA request number, and port address configuration */ > - mcbsp->dma_data[0].name =3D "Audio Playback"; > - mcbsp->dma_data[0].dma_req =3D res->start; > - mcbsp->dma_data[0].port_addr =3D omap_mcbsp_dma_reg_params(mcbsp, 0); > + mcbsp->dma_req[0] =3D res->start; > + mcbsp->dma_data[0].filter_data =3D &mcbsp->dma_req[0]; > + mcbsp->dma_data[0].addr =3D omap_mcbsp_dma_reg_params(mcbsp, 0); > + mcbsp->dma_data[0].maxburst =3D 4; > = > mcbsp->fclk =3D clk_get(&pdev->dev, "fck"); > if (IS_ERR(mcbsp->fclk)) { > diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h > index f93e0b0..96d1b08 100644 > --- a/sound/soc/omap/mcbsp.h > +++ b/sound/soc/omap/mcbsp.h > @@ -24,14 +24,14 @@ > #ifndef __ASOC_MCBSP_H > #define __ASOC_MCBSP_H > = > -#include "omap-pcm.h" > - > #ifdef CONFIG_ARCH_OMAP1 > #define mcbsp_omap1() 1 > #else > #define mcbsp_omap1() 0 > #endif > = > +#include > + > /* McBSP register numbers. Register address offset =3D num * reg_step */ > enum { > /* Common registers */ > @@ -312,7 +312,8 @@ struct omap_mcbsp { > struct omap_mcbsp_platform_data *pdata; > struct omap_mcbsp_st_data *st_data; > struct omap_mcbsp_reg_cfg cfg_regs; > - struct omap_pcm_dma_data dma_data[2]; > + struct snd_dmaengine_dai_dma_data dma_data[2]; > + unsigned int dma_req[2]; > int dma_op_mode; > u16 max_tx_thres; > u16 max_rx_thres; > diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c > index ee7cd53..5e8d640 100644 > --- a/sound/soc/omap/n810.c > +++ b/sound/soc/omap/n810.c > @@ -34,7 +34,6 @@ > #include > = > #include "omap-mcbsp.h" > -#include "omap-pcm.h" > = > #define N810_HEADSET_AMP_GPIO 10 > #define N810_SPEAKER_AMP_GPIO 101 > diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-= twl6040.c > index e7d93fa..70cd5c7 100644 > --- a/sound/soc/omap/omap-abe-twl6040.c > +++ b/sound/soc/omap/omap-abe-twl6040.c > @@ -34,7 +34,6 @@ > = > #include "omap-dmic.h" > #include "omap-mcpdm.h" > -#include "omap-pcm.h" > #include "../codecs/twl6040.h" > = > struct abe_twl6040 { > diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c > index 37f4539..2ad0370 100644 > --- a/sound/soc/omap/omap-dmic.c > +++ b/sound/soc/omap/omap-dmic.c > @@ -39,8 +39,8 @@ > #include > #include > #include > +#include > = > -#include "omap-pcm.h" > #include "omap-dmic.h" > = > struct omap_dmic { > @@ -55,13 +55,9 @@ struct omap_dmic { > u32 ch_enabled; > bool active; > struct mutex mutex; > -}; > = > -/* > - * Stream DMA parameters > - */ > -static struct omap_pcm_dma_data omap_dmic_dai_dma_params =3D { > - .name =3D "DMIC capture", > + struct snd_dmaengine_dai_dma_data dma_data; > + unsigned int dma_req; > }; > = > static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 = val) > @@ -118,7 +114,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_subst= ream *substream, > = > mutex_unlock(&dmic->mutex); > = > - snd_soc_dai_set_dma_data(dai, substream, &omap_dmic_dai_dma_params); > + snd_soc_dai_set_dma_data(dai, substream, &dmic->dma_data); > return ret; > } > = > @@ -203,7 +199,7 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_sub= stream *substream, > struct snd_soc_dai *dai) > { > struct omap_dmic *dmic =3D snd_soc_dai_get_drvdata(dai); > - struct omap_pcm_dma_data *dma_data; > + struct snd_dmaengine_dai_dma_data *dma_data; > int channels; > = > dmic->clk_div =3D omap_dmic_select_divider(dmic, params_rate(params)); > @@ -230,7 +226,7 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_sub= stream *substream, > = > /* packet size is threshold * channels */ > dma_data =3D snd_soc_dai_get_dma_data(dai, substream); > - dma_data->packet_size =3D dmic->threshold * channels; > + dma_data->maxburst =3D dmic->threshold * channels; > = > return 0; > } > @@ -480,7 +476,7 @@ static int asoc_dmic_probe(struct platform_device *pd= ev) > ret =3D -ENODEV; > goto err_put_clk; > } > - omap_dmic_dai_dma_params.port_addr =3D res->start + OMAP_DMIC_DATA_REG; > + dmic->dma_data.addr =3D res->start + OMAP_DMIC_DATA_REG; > = > res =3D platform_get_resource(pdev, IORESOURCE_DMA, 0); > if (!res) { > @@ -488,7 +484,9 @@ static int asoc_dmic_probe(struct platform_device *pd= ev) > ret =3D -ENODEV; > goto err_put_clk; > } > - omap_dmic_dai_dma_params.dma_req =3D res->start; > + > + dmic->dma_req =3D res->start; > + dmic->dma_data.filter_data =3D &dmic->dma_req; > = > res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); > if (!res) { > diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c > index 7e120cc..ced3b88 100644 > --- a/sound/soc/omap/omap-hdmi.c > +++ b/sound/soc/omap/omap-hdmi.c > @@ -32,15 +32,16 @@ > #include > #include > #include > +#include > #include