ASoC: codecs: tx-macro: fix active_decimator array
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 6 Sep 2022 17:01:04 +0000 (18:01 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 23 Sep 2022 13:25:01 +0000 (14:25 +0100)
commit1c6a7f5250ce81f11a248f9bf88fdbca8b6b0b5d
tree83814801cb7afaf738c33d4fa861438a5adf4b50
parentd83a7201412d32e2ac76f20439470976b2edf699
ASoC: codecs: tx-macro: fix active_decimator array

currently active_decimator[] is unsigned long however we store negative
values when there is no decimator setup -1.

This is first bug, and the second bug is that we do not check if the decimator
is valid before writing to register using decimator as offset in
CDC_TXn_TX_PATH_CTL()

Fix these both by making active_decimator as integer array and adding check
in tx_macro_digital_mute() before accessing CDC_TXn_TX_PATH_CTL() register.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-tx-macro.c