summaryrefslogtreecommitdiff
path: root/drivers/soundwire/cadence_master.c
diff options
context:
space:
mode:
authorRander Wang <rander.wang@intel.com>2020-03-17 19:33:15 +0300
committerVinod Koul <vkoul@kernel.org>2020-03-19 10:13:03 +0300
commit5a885c52cfe6e5491fb7ce1d93d1a3d8f6fd6da9 (patch)
tree0ca47e69babacceaa9314bb80bfcc16b16591cec /drivers/soundwire/cadence_master.c
parent7b174f24f4cfb8e13a89c4493aa3d0c6ac062e0c (diff)
downloadlinux-5a885c52cfe6e5491fb7ce1d93d1a3d8f6fd6da9.tar.xz
soundwire: cadence: add interface to check clock status
If master is in clock stop state, driver can't modify registers in master except the registers for clock stop setting. Signed-off-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200317163329.25501-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/cadence_master.c')
-rw-r--r--drivers/soundwire/cadence_master.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 941809ea00a8..1bfdc1d4fcb1 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -1208,6 +1208,17 @@ static const struct sdw_master_port_ops cdns_port_ops = {
};
/**
+ * sdw_cdns_is_clock_stop: Check clock status
+ *
+ * @cdns: Cadence instance
+ */
+bool sdw_cdns_is_clock_stop(struct sdw_cdns *cdns)
+{
+ return !!(cdns_readl(cdns, CDNS_MCP_STAT) & CDNS_MCP_STAT_CLK_STOP);
+}
+EXPORT_SYMBOL(sdw_cdns_is_clock_stop);
+
+/**
* sdw_cdns_probe() - Cadence probe routine
* @cdns: Cadence instance
*/