ASoC: tegra: OPE DAPM path uses wrong regmap

OPE enable is not happening even though the DAPM path is complete.
This seems to happen because ASoC core does not use correct regmap
interface for the DAPM route listed by driver. The driver makes use
of multiple regmap interfaces (one each for OPE, PEQ and MBDRC).
The core populates component regmap using dev_get_regmap(), which
actually returns the last registered interface in the OPE driver
probe() call.

Since the same callback function is not available in later versions
of kernel for component driver, use component probe() call to setup
the regmap.

Bug 200750067
Jira EMA-393

Change-Id: Ib509a9f95f4c152c2210f88975a1f7572d79ba08
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1318570
(cherry picked from commit 545ee019fc4a7c5b0b92a488cd3d16dbbcefbba9 in
partial and updated logic for it to work on newer kernel)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2558375
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Sheetal . <sheetal@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Sameer Pujar
2021-07-13 16:48:49 +05:30
parent 42782c7dcd
commit ae473fa8b4

View File

@@ -125,9 +125,24 @@ static int tegra210_ope_hw_params(struct snd_pcm_substream *substream,
static int tegra210_ope_codec_probe(struct snd_soc_component *cmpnt) static int tegra210_ope_codec_probe(struct snd_soc_component *cmpnt)
{ {
struct tegra210_ope *ope = dev_get_drvdata(cmpnt->dev);
tegra210_peq_codec_init(cmpnt); tegra210_peq_codec_init(cmpnt);
tegra210_mbdrc_codec_init(cmpnt); tegra210_mbdrc_codec_init(cmpnt);
/*
* The OPE, PEQ and MBDRC functionalities are combined under one
* device registered by OPE driver. However there are separate
* regmap interfaces for each of these. ASoC core depends on
* dev_get_regmap() to populate the regmap field for a given ASoC
* component. Due to multiple regmap interfaces, it always uses
* the last registered interface in probe(). The DAPM routes in
* the current driver depend on OPE regmap. So to avoid dependency
* on probe order and to allow DAPM paths to use correct regmap
* below explicit assignment is done.
*/
snd_soc_component_init_regmap(cmpnt, ope->regmap);
return 0; return 0;
} }