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: e3a33673e8 ("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>
This commit is contained in:
Srinivas Kandagatla 2020-08-11 13:02:05 +01:00 коммит произвёл Mark Brown
Родитель 56235e4bc5
Коммит 796a58fe2b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -973,6 +973,20 @@ static int msm_routing_probe(struct snd_soc_component *c)
return 0;
}
static unsigned int q6routing_reg_read(struct snd_soc_component *component,
unsigned int reg)
{
/* default value */
return 0;
}
static int q6routing_reg_write(struct snd_soc_component *component,
unsigned int reg, unsigned int val)
{
/* dummy */
return 0;
}
static const struct snd_soc_component_driver msm_soc_routing_component = {
.probe = msm_routing_probe,
.name = DRV_NAME,
@ -981,6 +995,8 @@ static const struct snd_soc_component_driver msm_soc_routing_component = {
.num_dapm_widgets = ARRAY_SIZE(msm_qdsp6_widgets),
.dapm_routes = intercon,
.num_dapm_routes = ARRAY_SIZE(intercon),
.read = q6routing_reg_read,
.write = q6routing_reg_write,
};
static int q6pcm_routing_probe(struct platform_device *pdev)