Skip to content

Commit 77212f3

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: codecs: lpass-va-macro: set the default codec version for sm8250
sm8250 and sc7280 have lpass codec version 1.0, as these are very old platforms, they do not have a reliable way to get the codec version from core_id registers. On codec versions below 2.0, even though the core_id registers are available to read, the values of these registers are not unique to be able to determine the version of the codec dynamically. Add the version info into of_data, so that driver does not need to use core_id registers to get version number for such situations. Fixes: 378918d ("ASoC: codecs: lpass-macro: add helpers to get codec version") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Amit Pundir <amit.pundir@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Link: https://patch.msgid.link/20240816091210.50172-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3e83957 commit 77212f3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sound/soc/codecs/lpass-va-macro.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,13 @@ struct va_macro {
228228
struct va_macro_data {
229229
bool has_swr_master;
230230
bool has_npl_clk;
231+
int version;
231232
};
232233

233234
static const struct va_macro_data sm8250_va_data = {
234235
.has_swr_master = false,
235236
.has_npl_clk = false,
237+
.version = LPASS_CODEC_VERSION_1_0,
236238
};
237239

238240
static const struct va_macro_data sm8450_va_data = {
@@ -1587,7 +1589,14 @@ static int va_macro_probe(struct platform_device *pdev)
15871589
goto err_npl;
15881590
}
15891591

1590-
va_macro_set_lpass_codec_version(va);
1592+
/**
1593+
* old version of codecs do not have a reliable way to determine the
1594+
* version from registers, get them from soc specific data
1595+
*/
1596+
if (data->version)
1597+
lpass_macro_set_codec_version(data->version);
1598+
else /* read version from register */
1599+
va_macro_set_lpass_codec_version(va);
15911600

15921601
if (va->has_swr_master) {
15931602
/* Set default CLK div to 1 */

0 commit comments

Comments
 (0)