Re: [PATCH v2 2/6] ASoC: codecs: lpass-wsa-macro: Add support to WSA Macro

From: Srinivas Kandagatla
Date: Tue Nov 03 2020 - 07:31:52 EST




On 29/10/2020 15:47, Pierre-Louis Bossart wrote:
+static void wsa_macro_mclk_enable(struct wsa_macro *wsa, bool mclk_enable)
+{
+    struct regmap *regmap = wsa->regmap;
+
+    if (mclk_enable) {
+        if (wsa->wsa_mclk_users == 0) {
+            regcache_mark_dirty(regmap);
+            regcache_sync_region(regmap, 0x0, WSA_MAX_OFFSET);

I am not a regcache/regmap expert but the sequence seems odd. I could be wrong, but one would typically sync *after* doing changes, no?

In this code path the MCLK is going from OFF to ON state, so the registers would be put in reset state, so we need to sync them with current cache state!

--srini