Skip to content

Commit b9d4cab

Browse files
Srinivas-Kandagatlagregkh
authored andcommitted
ASoC: q6routing: add dummy register read/write function
[ Upstream commit 796a58f ] Most of the DAPM widgets for DSP ASoC components reuse reg field of the widgets for its internal calculations, however these are not real registers. So read/writes to these numbers are not really valid. However ASoC core will read these registers to get default state during startup. With recent changes to ASoC core, every register read/write failures are reported very verbosely. Prior to this fails to reads are totally ignored, so we never saw any error messages. To fix this add dummy read/write function to return default value. Fixes: e3a3367 ("ASoC: qdsp6: q6routing: Add q6routing driver") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200811120205.21805-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1373f88 commit b9d4cab

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

sound/soc/qcom/qdsp6/q6routing.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,20 @@ static int msm_routing_probe(struct snd_soc_component *c)
968968
return 0;
969969
}
970970

971+
static unsigned int q6routing_reg_read(struct snd_soc_component *component,
972+
unsigned int reg)
973+
{
974+
/* default value */
975+
return 0;
976+
}
977+
978+
static int q6routing_reg_write(struct snd_soc_component *component,
979+
unsigned int reg, unsigned int val)
980+
{
981+
/* dummy */
982+
return 0;
983+
}
984+
971985
static const struct snd_soc_component_driver msm_soc_routing_component = {
972986
.ops = &q6pcm_routing_ops,
973987
.probe = msm_routing_probe,
@@ -976,6 +990,8 @@ static const struct snd_soc_component_driver msm_soc_routing_component = {
976990
.num_dapm_widgets = ARRAY_SIZE(msm_qdsp6_widgets),
977991
.dapm_routes = intercon,
978992
.num_dapm_routes = ARRAY_SIZE(intercon),
993+
.read = q6routing_reg_read,
994+
.write = q6routing_reg_write,
979995
};
980996

981997
static int q6pcm_routing_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)