summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l56-shared.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-08 13:07:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-08 13:07:50 -0700
commita3d231e44ab827345d24973a621e9364949423a4 (patch)
treebc1b5c45b7441d0b28bdbf7707088af13cc31faa /sound/soc/codecs/cs35l56-shared.c
parentca9c7abf9502e108fae0e34181e01b1a20bc439f (diff)
parentecc8b4d0b6e19031733f28537971f8c5088dada2 (diff)
downloadlinux-stable-a3d231e44ab827345d24973a621e9364949423a4.tar.gz
linux-stable-a3d231e44ab827345d24973a621e9364949423a4.tar.bz2
linux-stable-a3d231e44ab827345d24973a621e9364949423a4.zip
Merge tag 'sound-fix-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of fixes for 6.6-rc1. All small and easy ones. - The corrections of the previous PCM iov_iter transitions - Regression fixes in MIDI 2.0 / USB changes - Various ASoC codec fixes for Cirrus, Realtek, WCD - ASoC AMD quirks and ASoC Intel AVS driver workaround" * tag 'sound-fix-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits) ALSA: hda/realtek - ALC287 I2S speaker platform support ASoC: amd: yc: Fix a non-functional mic on Lenovo 82TL ASoC: Intel: avs: Provide support for fallback topology ALSA: seq: Fix snd_seq_expand_var_event() call to user-space ALSA: usb-audio: Fix potential memory leaks at error path for UMP open ALSA: hda/cirrus: Fix broken audio on hardware with two CS42L42 codecs. ASoC: rt5645: NULL pointer access when removing jack ASoC: amd: yc: Add DMI entries to support Victus by HP Gaming Laptop 15-fb0xxx (8A3E) MAINTAINERS: Update the MAINTAINERS enties for TEXAS INSTRUMENTS ASoC DRIVERS ALSA: sb: Fix wrong argument in commented code ALSA: pcm: Fix error checks of default read/write copy ops ASoC: Name iov_iter argument as iterator instead of buffer ASoC: dmaengine: Drop unused iov_iter for process callback ALSA: hda/tas2781: Use standard clamp() macro ASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors ASoC: dt-bindings: fsl_easrc: Add support for imx8mp-easrc ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe() ASoC: cs35l45: Rename DACPCM1 Source control ASoC: cs35l45: Fix "Dead assigment" warning ASoC: cs35l45: Add support for Chip ID 0x35A460 ...
Diffstat (limited to 'sound/soc/codecs/cs35l56-shared.c')
-rw-r--r--sound/soc/codecs/cs35l56-shared.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index ae373f335ea8..98b1e63360ae 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -243,26 +243,27 @@ int cs35l56_wait_for_firmware_boot(struct cs35l56_base *cs35l56_base)
{
unsigned int reg;
unsigned int val;
- int ret;
+ int read_ret, poll_ret;
if (cs35l56_base->rev < CS35L56_REVID_B0)
reg = CS35L56_DSP1_HALO_STATE_A1;
else
reg = CS35L56_DSP1_HALO_STATE;
- ret = regmap_read_poll_timeout(cs35l56_base->regmap, reg,
- val,
- (val < 0xFFFF) && (val >= CS35L56_HALO_STATE_BOOT_DONE),
- CS35L56_HALO_STATE_POLL_US,
- CS35L56_HALO_STATE_TIMEOUT_US);
-
- if ((ret < 0) && (ret != -ETIMEDOUT)) {
- dev_err(cs35l56_base->dev, "Failed to read HALO_STATE: %d\n", ret);
- return ret;
- }
-
- if ((ret == -ETIMEDOUT) || (val != CS35L56_HALO_STATE_BOOT_DONE)) {
- dev_err(cs35l56_base->dev, "Firmware boot fail: HALO_STATE=%#x\n", val);
+ /*
+ * This can't be a regmap_read_poll_timeout() because cs35l56 will NAK
+ * I2C until it has booted which would terminate the poll
+ */
+ poll_ret = read_poll_timeout(regmap_read, read_ret,
+ (val < 0xFFFF) && (val >= CS35L56_HALO_STATE_BOOT_DONE),
+ CS35L56_HALO_STATE_POLL_US,
+ CS35L56_HALO_STATE_TIMEOUT_US,
+ false,
+ cs35l56_base->regmap, reg, &val);
+
+ if (poll_ret) {
+ dev_err(cs35l56_base->dev, "Firmware boot timed out(%d): HALO_STATE=%#x\n",
+ read_ret, val);
return -EIO;
}