alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers
       [not found] <CGME20200731173856eucas1p292d2bc7319aa6a9af9b0e48b89ae803b@eucas1p2.samsung.com>
@ 2020-07-31 17:38 ` Sylwester Nawrocki
  2020-08-17  9:25   ` Charles Keepax
  2020-08-18 16:55   ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Sylwester Nawrocki @ 2020-07-31 17:38 UTC (permalink / raw)
  To: broonie, ckeepax
  Cc: simon, alsa-devel, b.zolnierkie, patches, lgirdwood, m.szyprowski

The driver supports WM1811, WM8994, WM8958 devices but according to
documentation and the regmap definitions the WM8958_DSP2_* registers
are only available on WM8958. In current code these registers are
being accessed as if they were available on all the three chips.

When starting playback on WM1811 CODEC multiple errors like:
"wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5"
can be seen, which is caused by attempts to read an unavailable
WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent
commit "e2329ee ASoC: soc-component: add soc_component_err()".

This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling
is only done for WM8958.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/codecs/wm8958-dsp2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 68a3b48..3bce9a1 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -412,8 +412,12 @@ int wm8958_aif_ev(struct snd_soc_dapm_widget *w,
 		  struct snd_kcontrol *kcontrol, int event)
 {
 	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+	struct wm8994 *control = dev_get_drvdata(component->dev->parent);
 	int i;
 
+	if (control->type != WM8958)
+		return 0;
+
 	switch (event) {
 	case SND_SOC_DAPM_POST_PMU:
 	case SND_SOC_DAPM_PRE_PMU:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers
  2020-07-31 17:38 ` [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers Sylwester Nawrocki
@ 2020-08-17  9:25   ` Charles Keepax
  2020-08-18 16:55   ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2020-08-17  9:25 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: simon, alsa-devel, b.zolnierkie, patches, lgirdwood, broonie,
	m.szyprowski

On Fri, Jul 31, 2020 at 07:38:34PM +0200, Sylwester Nawrocki wrote:
> The driver supports WM1811, WM8994, WM8958 devices but according to
> documentation and the regmap definitions the WM8958_DSP2_* registers
> are only available on WM8958. In current code these registers are
> being accessed as if they were available on all the three chips.
> 
> When starting playback on WM1811 CODEC multiple errors like:
> "wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5"
> can be seen, which is caused by attempts to read an unavailable
> WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent
> commit "e2329ee ASoC: soc-component: add soc_component_err()".
> 
> This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling
> is only done for WM8958.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---

Sorry for the delay.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers
  2020-07-31 17:38 ` [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers Sylwester Nawrocki
  2020-08-17  9:25   ` Charles Keepax
@ 2020-08-18 16:55   ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-08-18 16:55 UTC (permalink / raw)
  To: ckeepax, Sylwester Nawrocki
  Cc: simon, alsa-devel, b.zolnierkie, patches, lgirdwood, m.szyprowski

On Fri, 31 Jul 2020 19:38:34 +0200, Sylwester Nawrocki wrote:
> The driver supports WM1811, WM8994, WM8958 devices but according to
> documentation and the regmap definitions the WM8958_DSP2_* registers
> are only available on WM8958. In current code these registers are
> being accessed as if they were available on all the three chips.
> 
> When starting playback on WM1811 CODEC multiple errors like:
> "wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5"
> can be seen, which is caused by attempts to read an unavailable
> WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent
> commit "e2329ee ASoC: soc-component: add soc_component_err()".
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: wm8994: Avoid attempts to read unreadable registers
      commit: f082bb59b72039a2326ec1a44496899fb8aa6d0e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-18 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200731173856eucas1p292d2bc7319aa6a9af9b0e48b89ae803b@eucas1p2.samsung.com>
2020-07-31 17:38 ` [PATCH RFC] ASoC: wm8994: Avoid attempts to read unreadable registers Sylwester Nawrocki
2020-08-17  9:25   ` Charles Keepax
2020-08-18 16:55   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).