Skip to content

Commit 658bb29

Browse files
fabioestevambroonie
authored andcommitted
ASoC: wm8962: Do not access WM8962_GPIO_BASE
According to the WM8962 datasheet, there is no register at address 0x200. WM8962_GPIO_BASE is just a base address for the GPIO registers and not a real register, so remove it from wm8962_readable_register(). Also, Register 515 (WM8962_GPIO_BASE + 3) does not exist, so skip its access. This fixes the following errors: wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16 wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16 Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent afd842c commit 658bb29

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sound/soc/codecs/wm8962.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static const struct reg_default wm8962_reg[] = {
151151
{ 40, 0x0000 }, /* R40 - SPKOUTL volume */
152152
{ 41, 0x0000 }, /* R41 - SPKOUTR volume */
153153

154+
{ 48, 0x0000 }, /* R48 - Additional control(4) */
154155
{ 49, 0x0010 }, /* R49 - Class D Control 1 */
155156
{ 51, 0x0003 }, /* R51 - Class D Control 2 */
156157

@@ -841,7 +842,6 @@ static bool wm8962_readable_register(struct device *dev, unsigned int reg)
841842
case WM8962_SPKOUTL_VOLUME:
842843
case WM8962_SPKOUTR_VOLUME:
843844
case WM8962_THERMAL_SHUTDOWN_STATUS:
844-
case WM8962_ADDITIONAL_CONTROL_4:
845845
case WM8962_CLASS_D_CONTROL_1:
846846
case WM8962_CLASS_D_CONTROL_2:
847847
case WM8962_CLOCKING_4:
@@ -956,7 +956,6 @@ static bool wm8962_readable_register(struct device *dev, unsigned int reg)
956956
case WM8962_EQ39:
957957
case WM8962_EQ40:
958958
case WM8962_EQ41:
959-
case WM8962_GPIO_BASE:
960959
case WM8962_GPIO_2:
961960
case WM8962_GPIO_3:
962961
case WM8962_GPIO_5:
@@ -3438,7 +3437,13 @@ static int wm8962_probe(struct snd_soc_component *component)
34383437
/* Save boards having to disable DMIC when not in use */
34393438
dmicclk = false;
34403439
dmicdat = false;
3441-
for (i = 0; i < WM8962_MAX_GPIO; i++) {
3440+
for (i = 1; i < WM8962_MAX_GPIO; i++) {
3441+
/*
3442+
* Register 515 (WM8962_GPIO_BASE + 3) does not exist,
3443+
* so skip its access
3444+
*/
3445+
if (i == 3)
3446+
continue;
34423447
switch (snd_soc_component_read(component, WM8962_GPIO_BASE + i)
34433448
& WM8962_GP2_FN_MASK) {
34443449
case WM8962_GPIO_FN_DMICCLK:

0 commit comments

Comments
 (0)