Fix kcontrol put callback in Tegra drivers
Subsystems (3)
cover Fix kcontrol put callback in Tegra drivers
This series fixes kcontrol put callback in some of the Tegra drivers which are used on platforms based on Tegra210 and later. The callback is expected to return 1 whenever the HW update is done.
ADMAIF, I2S, DMIC and DSPK drivers are updated as part of it.
This idea is suggested by Jaroslav. Similar suggestion came from Mark during review of series [0] and drivers under those series were taken care. This series takes care of remaining drivers. I have added 'Suggested-by" tags accordingly.
[0] https://lore.kernel.org/linux-arm-kernel/[email protected]/
Sameer Pujar (4):
ASoC: tegra: Fix kcontrol put callback in ADMAIF
ASoC: tegra: Fix kcontrol put callback in I2S
ASoC: tegra: Fix kcontrol put callback in DMIC
ASoC: tegra: Fix kcontrol put callback in DSPK
sound/soc/tegra/tegra186_dspk.c | 4 +++- sound/soc/tegra/tegra210_admaif.c | 4 +++- sound/soc/tegra/tegra210_dmic.c | 4 +++- sound/soc/tegra/tegra210_i2s.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/4 ASoC: tegra: Fix kcontrol put callback in ADMAIF
The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the ADMAIF driver accordingly
--- sound/soc/tegra/tegra210_admaif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra210_admaif.c +3 -1
@@ -460,8 +460,10 @@ static int tegra_admaif_put_control(struct snd_kcontrol *kcontrol, admaif->stereo_to_mono[ADMAIF_TX_PATH ][ec->reg] = value; else if (strstr(kcontrol->id.name, "Capture Stereo To Mono")) admaif->stereo_to_mono[ADMAIF_RX_PATH ][ec->reg] = value; + else + return 0; -return 0 ; +return 1 ; }static int tegra_admaif_dai_probe (struct snd_soc_dai *dai)
Signature · 1 line
2.7.4
PATCH 2/4 ASoC: tegra: Fix kcontrol put callback in I2S
In reply to Sameer PujarThe kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the I2S driver accordingly.
--- sound/soc/tegra/tegra210_i2s.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra210_i2s.c +3 -1
@@ -380,9 +380,11 @@ static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol, i2s->rx_fifo_th = value; }else if (strstr (kcontrol->id.name,"BCLK Ratio" )) { i2s->bclk_ratio = value; + }else { +return 0 ; } -return 0 ; +return 1 ; } static int tegra210_i2s_set_timing_params(struct device *dev,
Signature · 1 line
2.7.4
PATCH 3/4 ASoC: tegra: Fix kcontrol put callback in DMIC
In reply to Sameer PujarThe kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the DMIC driver accordingly.
--- sound/soc/tegra/tegra210_dmic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra210_dmic.c +3 -1
@@ -197,8 +197,10 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol, dmic->osr_val = value; else if (strstr(kcontrol->id.name, "LR Polarity Select")) dmic->lrsel = value; + else + return 0; -return 0 ; +return 1 ; }static const struct snd_soc_dai_ops tegra210_dmic_dai_ops = {
Signature · 1 line
2.7.4
PATCH 4/4 ASoC: tegra: Fix kcontrol put callback in DSPK
In reply to Sameer PujarThe kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the DSPK driver accordingly.
--- sound/soc/tegra/tegra186_dspk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra186_dspk.c +3 -1
@@ -67,8 +67,10 @@ static int tegra186_dspk_put_control(struct snd_kcontrol *kcontrol, dspk->mono_to_stereo = val; else if (strstr(kcontrol->id.name, "Stereo To Mono")) dspk->stereo_to_mono = val; + else + return 0; -return 0 ; +return 1 ; }static int __maybe_unused tegra186_dspk_runtime_suspend (struct device *dev)
Signature · 1 line
2.7.4
Jaroslav Kysela
maintainerQuoted 3 lines · Sameer Pujar
This series fixes kcontrol put callback in some of the Tegra drivers which are used on platforms based on Tegra210 and later. The callback is expected to return 1 whenever the HW update is done.
The logic is a little bit another. The 1 means change, so you should compare the register / cached value and return 1 only when a different value is set. Your implementation invokes the change events for duplicate updates.
Jaroslav
Signature · 2 lines
Jaroslav Kysela <[email protected]> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Quoted 11 lines · Jaroslav Kysela
External email: Use caution opening links or attachments
Quoted 3 lines · Sameer Pujar
This series fixes kcontrol put callback in some of the Tegra drivers which are used on platforms based on Tegra210 and later. The callback is expected to return 1 whenever the HW update is done.
The logic is a little bit another. The 1 means change, so you should compare the register / cached value and return 1 only when a different value is set. Your implementation invokes the change events for duplicate updates.
Sorry, I did not think the about duplicate updates. Thanks for the suggestion.