ASoC: SOF: amd: add conditional check for acp_clkmux_sel register
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>
Wed, 23 Aug 2023 07:33:37 +0000 (13:03 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 23 Aug 2023 12:27:17 +0000 (13:27 +0100)
Few AMD platforms require ACP ACLK as clock source.
Add conditional check for clock mux selection register for
switching between internal clock and ACP ACLK.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/amd/acp.c

index 61faae7..eceba9b 100644 (file)
@@ -423,7 +423,9 @@ static int acp_reset(struct snd_sof_dev *sdev)
        if (ret < 0)
                dev_err(sdev->dev, "timeout in releasing reset\n");
 
-       snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
+       if (desc->acp_clkmux_sel)
+               snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
+
        if (desc->ext_intr_enb)
                snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_enb, 0x01);