ALSA: hda: cs35l41: Check mailbox status of pause command after firmware load
authorStefan Binding <sbinding@opensource.cirrus.com>
Fri, 21 Jul 2023 15:18:08 +0000 (16:18 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 24 Jul 2023 09:00:00 +0000 (11:00 +0200)
Currently, we do not check the return status of the pause command,
immediately after we load firmware. If the pause has failed,
the firmware is not running.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230721151816.2080453-4-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c

index f9c97270db6f68a53cda149875ff04661753d76a..29f1dce45f1dc94a63aa727e874ac82e286871a9 100644 (file)
@@ -781,7 +781,12 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
                goto clean_dsp;
        }
 
-       cs35l41_set_cspl_mbox_cmd(cs35l41->dev, cs35l41->regmap, CSPL_MBOX_CMD_PAUSE);
+       ret = cs35l41_set_cspl_mbox_cmd(cs35l41->dev, cs35l41->regmap, CSPL_MBOX_CMD_PAUSE);
+       if (ret) {
+               dev_err(cs35l41->dev, "Error waiting for DSP to pause: %u\n", ret);
+               goto clean_dsp;
+       }
+
        cs35l41->firmware_running = true;
 
        return 0;