Browse Source

asoc: bolero: set bolero dev_up flag before macro notification

When UP notification is sent to macros, the macros can try
to do regcache sync for their regions. Set dev_up flag in bolero
before sending UP event to macros to enable register access.

Change-Id: Ic04cfef121e9be55e91bf8927da26f9ec249338e
Signed-off-by: Ramprasad Katkam <[email protected]>
Ramprasad Katkam 6 years ago
parent
commit
cbb6f02c95
1 changed files with 4 additions and 4 deletions
  1. 4 4
      asoc/codecs/bolero/bolero-cdc.c

+ 4 - 4
asoc/codecs/bolero/bolero-cdc.c

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
-/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/of_platform.h>
@@ -615,6 +615,9 @@ static int bolero_ssr_enable(struct device *dev, void *data)
 			BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, 0x0);
 
 	regcache_cache_only(priv->regmap, false);
+	mutex_lock(&priv->clk_lock);
+	priv->dev_up = true;
+	mutex_unlock(&priv->clk_lock);
 	/* call ssr event for supported macros */
 	for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) {
 		if (!priv->macro_params[macro_idx].event_handler)
@@ -623,9 +626,6 @@ static int bolero_ssr_enable(struct device *dev, void *data)
 			priv->component,
 			BOLERO_MACRO_EVT_SSR_UP, 0x0);
 	}
-	mutex_lock(&priv->clk_lock);
-	priv->dev_up = true;
-	mutex_unlock(&priv->clk_lock);
 	bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_SSR_UP);
 	return 0;
 }