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

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

 





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



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

  Powered by Linux