lkml.org 
[lkml]   [2022]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 06/12] ASoC: codecs: wsa883x: add clock stop support
Date
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@linaro.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
\
 
 \ /
  Last update: 2022-09-06 19:14    [W:0.065 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site