mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 14:43:16 +00:00
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: 378918d59181 ("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>
This commit is contained in:
parent
3e83957e8d
commit
77212f300b
@ -228,11 +228,13 @@ struct va_macro {
|
||||
struct va_macro_data {
|
||||
bool has_swr_master;
|
||||
bool has_npl_clk;
|
||||
int version;
|
||||
};
|
||||
|
||||
static const struct va_macro_data sm8250_va_data = {
|
||||
.has_swr_master = false,
|
||||
.has_npl_clk = false,
|
||||
.version = LPASS_CODEC_VERSION_1_0,
|
||||
};
|
||||
|
||||
static const struct va_macro_data sm8450_va_data = {
|
||||
@ -1587,6 +1589,13 @@ static int va_macro_probe(struct platform_device *pdev)
|
||||
goto err_npl;
|
||||
}
|
||||
|
||||
/**
|
||||
* old version of codecs do not have a reliable way to determine the
|
||||
* version from registers, get them from soc specific data
|
||||
*/
|
||||
if (data->version)
|
||||
lpass_macro_set_codec_version(data->version);
|
||||
else /* read version from register */
|
||||
va_macro_set_lpass_codec_version(va);
|
||||
|
||||
if (va->has_swr_master) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user