[alsa-devel] [PATCH 2/3] Add ALSA driver for Atmel Audio Bitstream DAC
Takashi Iwai
tiwai at suse.de
Wed Feb 4 13:52:06 CET 2009
At Wed, 4 Feb 2009 13:18:35 +0100,
Hans-Christian Egtvedt wrote:
>
> > > +static int at32_abdac_trigger(struct snd_pcm_substream *substream,
> > > int cmd) +{
> > > + struct at32_abdac *dac = snd_pcm_substream_chip(substream);
> > > + int retval = -EINVAL;
> > > +
> > > + switch (cmd) {
> > > + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */
> > > + case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
> > > + case SNDRV_PCM_TRIGGER_START:
> > > + clk_enable(dac->sample_clk);
> > > + retval = dw_dma_cyclic_start(dac->dma.chan);
> > > + if (retval)
> > > + goto out;
> > > + dac_writel(dac, CTRL, DAC_BIT(EN));
> > > + break;
> > > + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
> > > + case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */
> > > + case SNDRV_PCM_TRIGGER_STOP:
> > > + set_bit(DMA_STOP, &dac->flags);
> > > + dw_dma_cyclic_stop(dac->dma.chan);
> > > + dac_writel(dac, DATA, 0);
> > > + dac_writel(dac, CTRL, 0);
> > > + clk_disable(dac->sample_clk);
> > > + break;
> >
> > No retval is set for these cases?
> >
>
> Nope, they are all void return functions and will always complete
> successfully.
I meant that retval is kept -EINVAL in the cases for STOP, etc,
although the call is successful.
Takashi
More information about the Alsa-devel
mailing list