@@ -1207,6 +1207,25 @@ static const struct sdw_master_port_ops cdns_port_ops = {
.dpn_port_enable_ch = cdns_port_enable,
};
+/**
+ * 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;
+ }
+
+ return false;
+}
+EXPORT_SYMBOL(sdw_cdns_is_clock_stop);
+
/**
* sdw_cdns_probe() - Cadence probe routine
* @cdns: Cadence instance
@@ -144,6 +144,8 @@ int sdw_cdns_pdi_init(struct sdw_cdns *cdns,
int sdw_cdns_exit_reset(struct sdw_cdns *cdns);
int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns, bool state);
+bool sdw_cdns_is_clock_stop(struct sdw_cdns *cdns);
+
#ifdef CONFIG_DEBUG_FS
void sdw_cdns_debugfs_init(struct sdw_cdns *cdns, struct dentry *root);
#endif