Skip to content

Commit 796a58f

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: q6routing: add dummy register read/write function
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 <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 56235e4 commit 796a58f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sound/soc/qcom/qdsp6/q6routing.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,20 @@ static int msm_routing_probe(struct snd_soc_component *c)
973973
return 0;
974974
}
975975

976+
static unsigned int q6routing_reg_read(struct snd_soc_component *component,
977+
unsigned int reg)
978+
{
979+
/* default value */
980+
return 0;
981+
}
982+
983+
static int q6routing_reg_write(struct snd_soc_component *component,
984+
unsigned int reg, unsigned int val)
985+
{
986+
/* dummy */
987+
return 0;
988+
}
989+
976990
static const struct snd_soc_component_driver msm_soc_routing_component = {
977991
.probe = msm_routing_probe,
978992
.name = DRV_NAME,
@@ -981,6 +995,8 @@ static const struct snd_soc_component_driver msm_soc_routing_component = {
981995
.num_dapm_widgets = ARRAY_SIZE(msm_qdsp6_widgets),
982996
.dapm_routes = intercon,
983997
.num_dapm_routes = ARRAY_SIZE(intercon),
998+
.read = q6routing_reg_read,
999+
.write = q6routing_reg_write,
9841000
};
9851001

9861002
static int q6pcm_routing_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)