soundwire: cadence: handle error cases with CONFIG_UPDATE

config_update() may time out or cannot be use in ClockStopMode

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200317163329.25501-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Pierre-Louis Bossart 2020-03-17 11:33:16 -05:00 committed by Vinod Koul
parent 5a885c52cf
commit 9bc87cce94
1 changed files with 5 additions and 0 deletions

View File

@ -239,6 +239,11 @@ static int cdns_config_update(struct sdw_cdns *cdns)
{ {
int ret; int ret;
if (sdw_cdns_is_clock_stop(cdns)) {
dev_err(cdns->dev, "Cannot program MCP_CONFIG_UPDATE in ClockStopMode\n");
return -EINVAL;
}
ret = cdns_clear_bit(cdns, CDNS_MCP_CONFIG_UPDATE, ret = cdns_clear_bit(cdns, CDNS_MCP_CONFIG_UPDATE,
CDNS_MCP_CONFIG_UPDATE_BIT); CDNS_MCP_CONFIG_UPDATE_BIT);
if (ret < 0) if (ret < 0)