linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dt-bindings: fsl_asrc: add compatible string for imx8qm
@ 2019-10-29  9:17 Shengjiu Wang
  2019-10-29  9:17 ` [PATCH 2/2] ASoC: fsl_asrc: Add support " Shengjiu Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Shengjiu Wang @ 2019-10-29  9:17 UTC (permalink / raw)
  To: timur, nicoleotsuka, Xiubo.Lee, festevam, broonie, alsa-devel,
	lgirdwood, perex, tiwai, robh+dt, mark.rutland, devicetree
  Cc: linuxppc-dev, linux-kernel

In order to support the two asrc modules in imx8qm, we need to
add compatible string "fsl,imx8qm-asrc0" and "fsl,imx8qm-asrc1"

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 Documentation/devicetree/bindings/sound/fsl,asrc.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/fsl,asrc.txt b/Documentation/devicetree/bindings/sound/fsl,asrc.txt
index 1d4d9f938689..cd2bd3daa7e1 100644
--- a/Documentation/devicetree/bindings/sound/fsl,asrc.txt
+++ b/Documentation/devicetree/bindings/sound/fsl,asrc.txt
@@ -8,7 +8,8 @@ three substreams within totally 10 channels.
 
 Required properties:
 
-  - compatible		: Contains "fsl,imx35-asrc" or "fsl,imx53-asrc".
+  - compatible		: Contains "fsl,imx35-asrc", "fsl,imx53-asrc",
+			  "fsl,imx8qm-asrc0" or "fsl,imx8qm-asrc1".
 
   - reg			: Offset and length of the register set for the device.
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] ASoC: fsl_asrc: Add support for imx8qm
@ 2019-10-30  3:20 S.j. Wang
  2019-10-30  8:38 ` Nicolin Chen
  0 siblings, 1 reply; 5+ messages in thread
From: S.j. Wang @ 2019-10-30  3:20 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: timur, Xiubo.Lee, festevam, broonie, alsa-devel, lgirdwood,
	perex, tiwai, robh+dt, mark.rutland, devicetree, linuxppc-dev,
	linux-kernel

Hi

> 
> On Tue, Oct 29, 2019 at 05:17:09PM +0800, Shengjiu Wang wrote:
> > There are two asrc module in imx8qm, each module has different clock
> > configuration, and the DMA type is EDMA.
> >
> > So in this patch, we define the new clocks, refine the clock map, and
> > include struct fsl_asrc_soc_data for different soc usage.
> >
> > The EDMA channel is fixed with each dma request, one dma request
> > corresponding to one dma channel. So we need to request dma channel
> > with dma request of asrc module.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > ---
> >  sound/soc/fsl/fsl_asrc.c     | 91 +++++++++++++++++++++++++++++-------
> >  sound/soc/fsl/fsl_asrc.h     | 65 +++++++++++++++++++++++++-
> >  sound/soc/fsl/fsl_asrc_dma.c | 39 ++++++++++++----
> >  3 files changed, 167 insertions(+), 28 deletions(-)
> 
> > diff --git a/sound/soc/fsl/fsl_asrc_dma.c
> > b/sound/soc/fsl/fsl_asrc_dma.c index d6146de9acd2..dbb07a486504
> 100644
> > --- a/sound/soc/fsl/fsl_asrc_dma.c
> > +++ b/sound/soc/fsl/fsl_asrc_dma.c
> > @@ -199,19 +199,40 @@ static int fsl_asrc_dma_hw_params(struct
> > snd_soc_component *component,
> >
> >       /* Get DMA request of Back-End */
> >       tmp_chan = dma_request_slave_channel(dev_be, tx ? "tx" : "rx");
> > -     tmp_data = tmp_chan->private;
> > -     pair->dma_data.dma_request = tmp_data->dma_request;
> > -     dma_release_channel(tmp_chan);
> > +     /* tmp_chan may be NULL for it is already allocated by Back-End */
> > +     if (tmp_chan) {
> > +             tmp_data = tmp_chan->private;
> > +             if (tmp_data)
> > +                     pair->dma_data.dma_request =
> > + tmp_data->dma_request;
> 
> If this patch is supposed to add a !tmp_chan case for EDMA, we probably
> shouldn't mute the !tmp_data case because dma_request will be NULL,
> although the code previously didn't have a check either. I mean we might
> need to error-out for !tmp_chan. Or...
> is this intentional?
> 

Yes, intentional. May be we can change to 

        if (!asrc_priv->soc->use_edma) {
                /* Get DMA request of Back-End */
                tmp_chan = dma_request_slave_channel(dev_be, tx ? "tx" : "rx");
                tmp_data = tmp_chan->private;
                pair->dma_data.dma_request = tmp_data->dma_request;
                dma_release_channel(tmp_chan);

                /* Get DMA request of Front-End */
                tmp_chan = fsl_asrc_get_dma_channel(pair, dir);
                tmp_data = tmp_chan->private;
                pair->dma_data.dma_request2 = tmp_data->dma_request;
                pair->dma_data.peripheral_type = tmp_data->peripheral_type;
                pair->dma_data.priority = tmp_data->priority;
                dma_release_channel(tmp_chan);
        }

Best regards
Wang shengjiu

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-30  8:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  9:17 [PATCH 1/2] ASoC: dt-bindings: fsl_asrc: add compatible string for imx8qm Shengjiu Wang
2019-10-29  9:17 ` [PATCH 2/2] ASoC: fsl_asrc: Add support " Shengjiu Wang
2019-10-30  0:17   ` Nicolin Chen
2019-10-30  3:20 S.j. Wang
2019-10-30  8:38 ` Nicolin Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).