lkml.org 
[lkml]   [2020]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/16] soundwire: cadence: add interface to check clock status
From
Date


>> +/**
>> + * 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.

\
 
 \ /
  Last update: 2020-03-13 18:29    [W:0.059 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site