Re: [RFC PATCH 5/5] ASoC: simplify the SSP DMA parameters settings by run-time generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +       snprintf(dma->name, 20, "SSP%d PCM %s %s", ssp->port_id,>> +                       stereo ? "Stereo" : "Mono", out ? "out" : "in");>> Should we change Stereo/Mono to 32-bit/16-bit here?>
Depends on Mark, the dma->name and the comments below doesn'tactually match very well ...
>> +>> +       dma->params.name = dma->name;>> +       dma->params.drcmr = &DRCMR(out ? ssp->drcmr_tx : ssp->drcmr_rx);>> +       dma->params.dcmd = (out ? (DCMD_INCSRCADDR | DCMD_FLOWTRG) :>> +                                 (DCMD_INCTRGADDR | DCMD_FLOWSRC)) |>> +                       (stereo ? DCMD_WIDTH4 : DCMD_WIDTH2) | DCMD_BURST16;>> +       dma->params.dev_addr = ssp->phys_base + SSDR;>> +>> +       return &dma->params;>> +}>> +>>  static int pxa_ssp_startup(struct snd_pcm_substream *substream,>>                           struct snd_soc_dai *dai)>>  {>> @@ -225,6 +100,11 @@ static int pxa_ssp_startup(struct>> snd_pcm_substream *substream,>>                clk_enable(priv->ssp->clk);>>                ssp_disable(priv->ssp);>>        }>> +>> +       if (cpu_dai->dma_data) {>> +               kfree(cpu_dai->dma_data);>> +               cpu_dai->dma_data = NULL;>> +       }>>        return ret;>>  }>>>> @@ -239,6 +119,11 @@ static void pxa_ssp_shutdown(struct>> snd_pcm_substream *substream,>>                ssp_disable(priv->ssp);>>                clk_disable(priv->ssp->clk);>>        }>> +>> +       if (cpu_dai->dma_data) {>> +               kfree(cpu_dai->dma_data);>> +               cpu_dai->dma_data = NULL;>> +       }>>  }>>>>  #ifdef CONFIG_PM>> @@ -611,25 +496,20 @@ static int pxa_ssp_hw_params(struct>> snd_pcm_substream *substream,>>        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;>>        struct ssp_priv *priv = cpu_dai->private_data;>>        struct ssp_device *ssp = priv->ssp;>> -       int dma = 0, chn = params_channels(params);>> +       int chn = params_channels(params);>>        u32 sscr0;>>        u32 sspsp;>>        int width = snd_pcm_format_physical_width(params_format(params));>>        int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf;>>>> -       /* select correct DMA params */>> -       if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)>> -               dma = 1; /* capture DMA offset is 1,3 */>> -       /* Network mode with one active slot (ttsa == 1) can be used>> -        * to force 16-bit frame width on the wire (for S16_LE), even>> -        * with two channels. Use 16-bit DMA transfers for this case.>> -        */>> Do you think the ttsa bit below is obvious enough to warrant removal> of the above comment?
Yes, sorry. This is a nice comment, I removed it by accident.
>>> -       if (((chn == 2) && (ttsa != 1)) || (width == 32))>> -               dma += 2; /* 32-bit DMA offset is 2, 16-bit is 0 */>> ->> -       cpu_dai->dma_data = ssp_dma_params[cpu_dai->id][dma];>> +       printk("%s\n", __func__);>> +       /* generate correct DMA params */>> +       if (cpu_dai->dma_data)>> +               kfree(cpu_dai->dma_data);>>>> -       dev_dbg(&ssp->pdev->dev, "pxa_ssp_hw_params: dma %d\n", dma);>> +       cpu_dai->dma_data = ssp_get_dma_params(ssp,>> +                       ((chn == 2) && (ttsa != 1)) || (width == 32),>> +                       substream->stream == SNDRV_PCM_STREAM_PLAYBACK);>>>>        /* we can only change the settings if the port is not in use */>>        if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE)>> -->> 1.6.0.4>>>> regards> Philipp>


-- Cheers- eric_______________________________________________Alsa-devel mailing listAlsa-devel@xxxxxxxxxxxxxxxxxxxx://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux