Skip to content

Commit 169c5e4

Browse files
vijendarmukundabroonie
authored andcommitted
ASoC: SOF: amd: refactor acp reset sequence
Below mentioned register sequence should be part of acp init sequence. 1) Set ACP clock mux selection register to ACP_ACLK clock source. 2) Enable ACP global interrupt enable register 3) Enable ACP error interrupt mask. ACP reset sequence should contain code related to asserting acp soft reset and release the soft reset. Move the rest of the registers programming to acp init sequence. Signed-off-by: Vijendar Mukunda <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent cc489cc commit 169c5e4

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

sound/soc/sof/amd/acp.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ static int acp_power_on(struct snd_sof_dev *sdev)
511511

512512
static int acp_reset(struct snd_sof_dev *sdev)
513513
{
514-
const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
515514
unsigned int val;
516515
int ret;
517516

@@ -532,14 +531,6 @@ static int acp_reset(struct snd_sof_dev *sdev)
532531
if (ret < 0)
533532
dev_err(sdev->dev, "timeout in releasing reset\n");
534533

535-
if (desc->acp_clkmux_sel)
536-
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
537-
538-
if (desc->ext_intr_enb)
539-
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_enb, 0x01);
540-
541-
if (desc->ext_intr_cntl)
542-
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_cntl, ACP_ERROR_IRQ_MASK);
543534
return ret;
544535
}
545536

@@ -570,6 +561,7 @@ static int acp_dsp_reset(struct snd_sof_dev *sdev)
570561

571562
static int acp_init(struct snd_sof_dev *sdev)
572563
{
564+
const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
573565
struct acp_dev_data *acp_data;
574566
int ret;
575567

@@ -586,6 +578,16 @@ static int acp_init(struct snd_sof_dev *sdev)
586578
ret = acp_reset(sdev);
587579
if (ret)
588580
return ret;
581+
582+
if (desc->acp_clkmux_sel)
583+
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
584+
585+
if (desc->ext_intr_enb)
586+
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_enb, 0x01);
587+
588+
if (desc->ext_intr_cntl)
589+
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_cntl, ACP_ERROR_IRQ_MASK);
590+
589591
switch (acp_data->pci_rev) {
590592
case ACP70_PCI_ID:
591593
case ACP71_PCI_ID:

0 commit comments

Comments
 (0)