Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sound/soc/amd/acp/soc_amd_sdw_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
#define ACP71_PCI_REV 0x71
#define ACP72_PCI_REV 0x72

/**
* struct amd_pdm_pdata - platform data passed via mach->pdata to machine driver
* @pdm_sel: active PDM controller (ACP7X_PDM_DMIC0 or ACP7X_PDM_DMIC1),
* non-zero when a PDM controller was identified via ACPI _DSD
*
* Carries the PDM controller selection for ACP7.B/7.F platforms, derived
* from the acp-audio-ep-port ACPI _DSD property and passed via mach->pdata
* to the machine driver.
*/
struct amd_pdm_pdata {
unsigned int pdm_sel;
};

#define SOC_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0))
#define ASOC_SDW_FOUR_SPK BIT(4)
#define ASOC_SDW_ACP_DMIC BIT(5)
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/amd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ config SND_SOC_SOF_AMD_ACP7X
depends on SND_SOC_SOF_PCI
depends on AMD_NODE
select SND_SOC_SOF_AMD_COMMON
select SND_SOC_SOF_AMD_SOUNDWIRE_LINK_BASELINE
help
Select this option for SOF support on AMD ACP7.B and ACP7.F PCI
revision based platforms.
Expand Down
17 changes: 17 additions & 0 deletions sound/soc/sof/amd/acp-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "acp.h"
#include "acp-dsp-offset.h"
#include <sound/sof/xtensa.h>
#include "../../amd/acp/soc_amd_sdw_common.h"

/**
* amd_sof_ipc_dump() - This function is called when IPC tx times out.
Expand Down Expand Up @@ -177,6 +178,7 @@ struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev)
struct acp_dev_data *acp_data = sdev->pdata->hw_pdata;
const struct sof_dev_desc *desc = sof_pdata->desc;
struct snd_soc_acpi_mach *mach = NULL;
struct amd_pdm_pdata *pdm_pdata;

if (desc->machines)
mach = snd_soc_acpi_find_machine(desc->machines);
Expand All @@ -188,7 +190,22 @@ struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev)
}
}

mach = devm_kmemdup(sdev->dev, mach, sizeof(*mach), GFP_KERNEL);
if (!mach) {
dev_err(sdev->dev, "failed to allocate machine entry copy\n");
return NULL;
}

mach->mach_params.subsystem_rev = acp_data->pci_rev;

if (acp_data->pdm_sel) {
pdm_pdata = devm_kzalloc(sdev->dev, sizeof(*pdm_pdata), GFP_KERNEL);
if (!pdm_pdata)
return NULL;
pdm_pdata->pdm_sel = acp_data->pdm_sel;
mach->pdata = pdm_pdata;
Comment thread
vijendarmukunda marked this conversation as resolved.
}

sof_pdata->tplg_filename = mach->sof_tplg_filename;
sof_pdata->fw_filename = mach->fw_filename;

Expand Down
17 changes: 17 additions & 0 deletions sound/soc/sof/amd/acp-dsp-offset.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,22 @@
#define ACP7X_IDMA_ERROR_MASK 0x1FF9FF
#define ACP7X_ZSC_DSP_CTRL 0x001014
#define ACP7X_PME_EN ACP70_PME_EN
/* SW enable base for SDW0; manager N uses ACP7X_SW_EN + (N * 0x2000) */
#define ACP7X_SW_EN 0x5200

/* ACP7X SoundWire IO registers (non-gsync, up to 4 managers SW0-SW3) */
#define ACP7X_EXTERNAL_SW_INTR_STAT 0x001A24
#define ACP7X_SW_WAKE_EN 0x001458
#define ACP7X_SW_PME_STS 0x001474
#define ACP7X_SDW_STAT BIT(23)
#define ACP7X_ERROR_IRQ BIT(29)
#define ACP7X_SW_WAKE_EN_MASK BIT(0)
#define ACP7X_SW_HOST_WAKE_MASK BIT(22)
#define ACP7X_SDW_HOST_WAKE_STAT BIT(24)
#define ACP7X_SW_FIFO_ERROR_REASON 0x50C4
#define ACP7X_SW_ERROR_REASON1 0x50CC
#define ACP7X_SW_ERROR_REASON2 0x50D4
#define ACP7X_EXTERNAL_SDW_STAT BIT(16)
#define ACP7X_SW_ERR_STAT_MASK BIT(11)

#endif
Loading
Loading