[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220906170112.1984-7-srinivas.kandagatla@linaro.org>
Date: Tue, 6 Sep 2022 18:01:06 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: broonie@...nel.org
Cc: lgirdwood@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, bgoswami@...cinc.com,
perex@...ex.cz, tiwai@...e.com, linux-arm-msm@...r.kernel.org,
alsa-devel@...a-project.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH v2 06/12] ASoC: codecs: wsa883x: add clock stop support
WSA883x does support clock stop, so remove code that reset
the Codec during runtime pm suspend and add flag to mark
clock stop support.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
sound/soc/codecs/wsa883x.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index 63e1d7aa6137..c7b10bbfba7e 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -415,7 +415,6 @@
#define WSA883X_NUM_REGISTERS (WSA883X_EMEM_63 + 1)
#define WSA883X_MAX_REGISTER (WSA883X_NUM_REGISTERS - 1)
-#define WSA883X_PROBE_TIMEOUT 1000
#define WSA883X_VERSION_1_0 0
#define WSA883X_VERSION_1_1 1
@@ -1409,6 +1408,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
wsa883x->sconfig.type = SDW_STREAM_PDM;
pdev->prop.sink_ports = GENMASK(WSA883X_MAX_SWR_PORTS, 0);
+ pdev->prop.simple_clk_stop_capable = true;
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
gpiod_direction_output(wsa883x->sd_n, 1);
@@ -1440,43 +1440,17 @@ static int wsa883x_probe(struct sdw_slave *pdev,
static int __maybe_unused wsa883x_runtime_suspend(struct device *dev)
{
struct regmap *regmap = dev_get_regmap(dev, NULL);
- struct wsa883x_priv *wsa883x = dev_get_drvdata(dev);
-
- gpiod_direction_output(wsa883x->sd_n, 0);
regcache_cache_only(regmap, true);
regcache_mark_dirty(regmap);
- regulator_disable(wsa883x->vdd);
return 0;
}
static int __maybe_unused wsa883x_runtime_resume(struct device *dev)
{
- struct sdw_slave *slave = dev_to_sdw_dev(dev);
struct regmap *regmap = dev_get_regmap(dev, NULL);
- struct wsa883x_priv *wsa883x = dev_get_drvdata(dev);
- unsigned long time;
- int ret;
-
- ret = regulator_enable(wsa883x->vdd);
- if (ret) {
- dev_err(dev, "Failed to enable vdd regulator (%d)\n", ret);
- return ret;
- }
-
- gpiod_direction_output(wsa883x->sd_n, 1);
-
- time = wait_for_completion_timeout(&slave->initialization_complete,
- msecs_to_jiffies(WSA883X_PROBE_TIMEOUT));
- if (!time) {
- dev_err(dev, "Initialization not complete, timed out\n");
- gpiod_direction_output(wsa883x->sd_n, 0);
- regulator_disable(wsa883x->vdd);
- return -ETIMEDOUT;
- }
- usleep_range(20000, 20010);
regcache_cache_only(regmap, false);
regcache_sync(regmap);
--
2.21.0
Powered by blists - more mailing lists