[alsa-devel] [PATCH 0/3] ASoC: intel: add support for future acpi platforms
We have some SoCs which are ACPI based. Current driver supports Merrifield type PCI SoC. SO make some minor changes required for ACPI support in subsequent series
Subhransu S. Prusty (3): ASoC: Intel: mrfld: Replace pci_id with unique device id ASoC: Intel: mrfld - Define ipc_info structure ASoC: Intel: mrfld: Define sst_res_info for acpi
arch/x86/include/asm/platform_sst_audio.h | 28 ++++++++++++++++++++++++++++ sound/soc/intel/sst/sst.c | 10 +++++----- sound/soc/intel/sst/sst.h | 5 +++-- sound/soc/intel/sst/sst_pvt.c | 4 ++-- 4 files changed, 38 insertions(+), 9 deletions(-)
From: Subhransu S. Prusty subhransu.s.prusty@intel.com
In order to support both ACPI and PCI devices we need to use a genric device id in driver, so change all pci_id instances to device_id
Signed-off-by: Subhransu S. Prusty subhransu.s.prusty@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/intel/sst/sst.c | 10 +++++----- sound/soc/intel/sst/sst.h | 5 +++-- sound/soc/intel/sst/sst_pvt.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c index d88cdd9..fa34217 100644 --- a/sound/soc/intel/sst/sst.c +++ b/sound/soc/intel/sst/sst.c @@ -167,7 +167,7 @@ static struct intel_sst_ops mrfld_ops = { int sst_driver_ops(struct intel_sst_drv *sst) {
- switch (sst->pci_id) { + switch (sst->dev_id) { case SST_MRFLD_PCI_ID: sst->tstamp = SST_TIME_STAMP_MRFLD; sst->ops = &mrfld_ops; @@ -175,7 +175,7 @@ int sst_driver_ops(struct intel_sst_drv *sst)
default: dev_err(sst->dev, - "SST Driver capablities missing for pci_id: %x", sst->pci_id); + "SST Driver capablities missing for dev_id: %x", sst->dev_id); return -EINVAL; }; } @@ -210,7 +210,7 @@ static int intel_sst_probe(struct pci_dev *pci, return -ENOMEM;
sst_drv_ctx->dev = &pci->dev; - sst_drv_ctx->pci_id = pci->device; + sst_drv_ctx->dev_id = pci->device; if (!sst_pdata) return -EINVAL;
@@ -278,7 +278,7 @@ static int intel_sst_probe(struct pci_dev *pci,
/* map registers */ /* DDR base */ - if (sst_drv_ctx->pci_id == SST_MRFLD_PCI_ID) { + if (sst_drv_ctx->dev_id == SST_MRFLD_PCI_ID) { sst_drv_ctx->ddr_base = pci_resource_start(pci, 0); /* check that the relocated IMR base matches with FW Binary */ ddr_base = relocate_imr_addr_mrfld(sst_drv_ctx->ddr_base); @@ -357,7 +357,7 @@ static int intel_sst_probe(struct pci_dev *pci, dev_dbg(sst_drv_ctx->dev, "Registered IRQ 0x%x\n", pci->irq);
/* default intr are unmasked so set this as masked */ - if (sst_drv_ctx->pci_id == SST_MRFLD_PCI_ID) + if (sst_drv_ctx->dev_id == SST_MRFLD_PCI_ID) sst_shim_write64(sst_drv_ctx->shim, SST_IMRX, 0xFFFF0038);
pci_set_drvdata(pci, sst_drv_ctx); diff --git a/sound/soc/intel/sst/sst.h b/sound/soc/intel/sst/sst.h index bfcf51a..b65b9c0 100644 --- a/sound/soc/intel/sst/sst.h +++ b/sound/soc/intel/sst/sst.h @@ -337,7 +337,8 @@ struct sst_shim_regs64 { * struct intel_sst_drv - driver ops * * @sst_state : current sst device state - * @pci_id : PCI device id loaded + * @dev_id : device identifier, pci_id for pci devices and acpi_id for acpi + * devices * @shim : SST shim pointer * @mailbox : SST mailbox pointer * @iram : SST IRAM pointer @@ -371,7 +372,7 @@ struct sst_shim_regs64 { struct intel_sst_drv { int sst_state; int irq_num; - unsigned int pci_id; + unsigned int dev_id; void __iomem *ddr; void __iomem *shim; void __iomem *mailbox; diff --git a/sound/soc/intel/sst/sst_pvt.c b/sound/soc/intel/sst/sst_pvt.c index 9e5f69b..1c2e081 100644 --- a/sound/soc/intel/sst/sst_pvt.c +++ b/sound/soc/intel/sst/sst_pvt.c @@ -115,7 +115,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr) { unsigned long long val = 0;
- switch (sst->pci_id) { + switch (sst->dev_id) { case SST_MRFLD_PCI_ID: val = sst_shim_read64(sst->shim, addr); break; @@ -126,7 +126,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr) void write_shim_data(struct intel_sst_drv *sst, int addr, unsigned long long data) { - switch (sst->pci_id) { + switch (sst->dev_id) { case SST_MRFLD_PCI_ID: sst_shim_write64(sst->shim, addr, (u64) data); break;
From: Subhransu S. Prusty subhransu.s.prusty@intel.com
This will be used to abstract the differances in ipc offsets for different chips.
Signed-off-by: Subhransu S. Prusty subhransu.s.prusty@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- arch/x86/include/asm/platform_sst_audio.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/platform_sst_audio.h b/arch/x86/include/asm/platform_sst_audio.h index 268a96a..6021dee 100644 --- a/arch/x86/include/asm/platform_sst_audio.h +++ b/arch/x86/include/asm/platform_sst_audio.h @@ -102,6 +102,11 @@ struct sst_lib_dnld_info { bool mod_ddr_dnld; };
+struct sst_ipc_info { + int ipc_offset; + unsigned int mbox_recv_off; +}; + struct sst_platform_info { const struct sst_info *probe_data; const struct sst_ipc_info *ipc_info;
From: Subhransu S. Prusty subhransu.s.prusty@intel.com
To query resources in ACPI systems we need to define a data structure. This would be set as platform_info for the devices.
Signed-off-by: Subhransu S. Prusty subhransu.s.prusty@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- arch/x86/include/asm/platform_sst_audio.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/platform_sst_audio.h b/arch/x86/include/asm/platform_sst_audio.h index 6021dee..7249e6d 100644 --- a/arch/x86/include/asm/platform_sst_audio.h +++ b/arch/x86/include/asm/platform_sst_audio.h @@ -102,6 +102,27 @@ struct sst_lib_dnld_info { bool mod_ddr_dnld; };
+struct sst_res_info { + unsigned int shim_offset; + unsigned int shim_size; + unsigned int shim_phy_addr; + unsigned int ssp0_offset; + unsigned int ssp0_size; + unsigned int dma0_offset; + unsigned int dma0_size; + unsigned int dma1_offset; + unsigned int dma1_size; + unsigned int iram_offset; + unsigned int iram_size; + unsigned int dram_offset; + unsigned int dram_size; + unsigned int mbox_offset; + unsigned int mbox_size; + unsigned int acpi_lpe_res_index; + unsigned int acpi_ddr_index; + unsigned int acpi_ipc_irq_index; +}; + struct sst_ipc_info { int ipc_offset; unsigned int mbox_recv_off; @@ -110,7 +131,9 @@ struct sst_ipc_info { struct sst_platform_info { const struct sst_info *probe_data; const struct sst_ipc_info *ipc_info; + const struct sst_res_info *res_info; const struct sst_lib_dnld_info *lib_info; + const char *platform; }; int add_sst_platform_device(void); #endif
On Fri, Oct 24, 2014 at 01:49:45PM +0530, Vinod Koul wrote:
We have some SoCs which are ACPI based. Current driver supports Merrifield type PCI SoC. SO make some minor changes required for ACPI support in subsequent series
Applied all, thanks.
participants (2)
-
Mark Brown
-
Vinod Koul