[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b1b0a8b9-5fc2-bfe1-dfde-692a0a7ac34a@linux.intel.com>
Date: Wed, 20 Apr 2022 12:59:12 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
broonie@...nel.org
Cc: alsa-devel@...a-project.org, lgirdwood@...il.com,
linux-kernel@...r.kernel.org, tiwai@...e.com,
quic_srivasam@...cinc.com
Subject: Re: [PATCH v4] ASoC: codecs: wsa881x: add runtime pm support
Hi Srini,
> +static int __maybe_unused wsa881x_runtime_resume(struct device *dev)
> +{
> + struct sdw_slave *slave = dev_to_sdw_dev(dev);
> + struct regmap *regmap = dev_get_regmap(dev, NULL);
> + struct wsa881x_priv *wsa881x = dev_get_drvdata(dev);
> +
> + gpiod_direction_output(wsa881x->sd_n, 1);
> +
> + wait_for_completion_timeout(&slave->initialization_complete,
> + msecs_to_jiffies(WSA881X_PROBE_TIMEOUT));
while I was revisiting pm_runtime support, I also saw that this codec driver is the only one that doesn't check for errors
max98373-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt1308-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt1316-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt5682-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt5682.c: &slave->initialization_complete,
rt700-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt711-sdca-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt711-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
rt715-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete,
wsa881x.c: wait_for_completion_timeout(&slave->initialization_complete,
If the attachment fails for some reason, you probably want to avoid starting regmap syncs that will fail by construction, no?
> +
> + regcache_cache_only(regmap, false);
> + regcache_sync(regmap);
> +
> + return 0;
> +}
Powered by blists - more mailing lists