Asoc: lpass-cdc: Synchronize lpass-cdc register macro function

lpass_cdc_register_macro can be called simultaneously by different
macros as bootup resulting in inconsistent value of
num_macros_registered. This will result in one of macro going ahead and
registering lpass-cdc component and other macro failing to register which
will cause probe of other macro to fail. Protect function with mutex lock
so that macros access it sequentially

Change-Id: I9d3811eeceb06b6a7e66d79a1b899b2c4283bb52
Signed-off-by: Yuhui Zhao <quic_yuhuzhao@quicinc.com>
This commit is contained in:
Yuhui Zhao
2022-11-01 15:24:40 +08:00
parent 6b5e8148d4
commit b78dc76483
2 changed files with 7 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ struct lpass_cdc_priv {
struct device *dev;
struct snd_soc_component *component;
struct regmap *regmap;
struct mutex macro_lock;
struct mutex io_lock;
struct mutex clk_lock;
struct mutex vote_lock;