[PATCH 03/16] soundwire: cadence: add interface to check clock status

Vinod Koul vkoul at kernel.org
Sat Mar 14 10:50:19 CET 2020


On 13-03-20, 11:31, Pierre-Louis Bossart wrote:
> 
> 
> > > +/**
> > > + * sdw_cdns_is_clock_stop: Check clock status
> > > + *
> > > + * @cdns: Cadence instance
> > > + */
> > > +bool sdw_cdns_is_clock_stop(struct sdw_cdns *cdns)
> > > +{
> > > +	u32 status;
> > > +
> > > +	status = cdns_readl(cdns, CDNS_MCP_STAT) & CDNS_MCP_STAT_CLK_STOP;
> > > +	if (status) {
> > > +		dev_dbg(cdns->dev, "Clock is stopped\n");
> > > +		return true;
> > > +	}
> > 
> > This can be further optimized to:
> > 
> >          return !!(cdns_readl(cdns, CDNS_MCP_STAT) & CDNS_MCP_STAT_CLK_STOP);
> 
> The logs are very useful for debug.

You have this log also in caller function.

-- 
~Vinod


More information about the Alsa-devel mailing list