[alsa-devel] [PATCH v3 5/5] ALSA - hda: Add support for link audio time reporting

Vinod Koul vinod.koul at intel.com
Thu Aug 4 04:00:10 CEST 2016


On Wed, Aug 03, 2016 at 06:21:07PM +0200, Takashi Iwai wrote:
> > +{
> > +	struct snd_pcm_substream *substream = (struct snd_pcm_substream *)ctx;
> 
> Superfluous cast.

ok

> > +		dma_select = (direction << GTSCC_CDMAS_DMA_DIR_SHIFT) |
> > +					(azx_dev->core.stream_tag - 1);
> > +		_snd_hdac_chip_write(l, azx_bus(chip), AZX_REG_GTSCC,
> > +						dma_select);
> 
> You can use
> 		snd_hdac_chip_writel(azx_bus(chip), GTSCC, dma_select);
> 
> The use of _snd_hdac_chip_write() is for non-constant registers.  When
> you pass AZX_REG_XXX, you can use the standard macro.  For example:

Yes I remeber that. I did see this earlier but missed to update :(

> > +		/* Enable the capture */
> > +		_snd_hdac_chip_write(l, azx_bus(chip), AZX_REG_GTSCC,
> > +				     _snd_hdac_chip_read(l, azx_bus(chip),
> > +					AZX_REG_GTSCC) | GTSCC_TSCCI_MASK);
> 
> This can be simplified with snd_hdac_chip_updatel().

ok


> > +	if (retry_count == HDA_MAX_CYCLE_READ_RETRY) {
> > +		dev_err(chip->card->dev, "Error in WALFCC cycle count\n");
> 
> Hrm, this has a danger to spew huge amount of error messages, since
> this gets called so often.

print once or rate limit?


> > -	} else
> > +	} else if ((runtime->hw.info &
> > +			SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME) &&
> > +			(audio_tstamp_config->type_requested ==
> > +			SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED)) {
> 
> The indentation is hard to follow here...

will fix

> 
> > +
> > +		azx_get_crosststamp(substream, &xtstamp);
> 
> No error check?

yes will add

-- 
~Vinod


More information about the Alsa-devel mailing list