Commit 39581031 authored by Subhransu S. Prusty's avatar Subhransu S. Prusty Committed by Mark Brown

ASoC: Intel: mrfld: Replace pci_id with unique device id

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: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7f266801
...@@ -167,7 +167,7 @@ static struct intel_sst_ops mrfld_ops = { ...@@ -167,7 +167,7 @@ static struct intel_sst_ops mrfld_ops = {
int sst_driver_ops(struct intel_sst_drv *sst) int sst_driver_ops(struct intel_sst_drv *sst)
{ {
switch (sst->pci_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
sst->tstamp = SST_TIME_STAMP_MRFLD; sst->tstamp = SST_TIME_STAMP_MRFLD;
sst->ops = &mrfld_ops; sst->ops = &mrfld_ops;
...@@ -175,7 +175,7 @@ int sst_driver_ops(struct intel_sst_drv *sst) ...@@ -175,7 +175,7 @@ int sst_driver_ops(struct intel_sst_drv *sst)
default: default:
dev_err(sst->dev, 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; return -EINVAL;
}; };
} }
...@@ -210,7 +210,7 @@ static int intel_sst_probe(struct pci_dev *pci, ...@@ -210,7 +210,7 @@ static int intel_sst_probe(struct pci_dev *pci,
return -ENOMEM; return -ENOMEM;
sst_drv_ctx->dev = &pci->dev; sst_drv_ctx->dev = &pci->dev;
sst_drv_ctx->pci_id = pci->device; sst_drv_ctx->dev_id = pci->device;
if (!sst_pdata) if (!sst_pdata)
return -EINVAL; return -EINVAL;
...@@ -278,7 +278,7 @@ static int intel_sst_probe(struct pci_dev *pci, ...@@ -278,7 +278,7 @@ static int intel_sst_probe(struct pci_dev *pci,
/* map registers */ /* map registers */
/* DDR base */ /* 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); sst_drv_ctx->ddr_base = pci_resource_start(pci, 0);
/* check that the relocated IMR base matches with FW Binary */ /* check that the relocated IMR base matches with FW Binary */
ddr_base = relocate_imr_addr_mrfld(sst_drv_ctx->ddr_base); ddr_base = relocate_imr_addr_mrfld(sst_drv_ctx->ddr_base);
...@@ -357,7 +357,7 @@ static int intel_sst_probe(struct pci_dev *pci, ...@@ -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); dev_dbg(sst_drv_ctx->dev, "Registered IRQ 0x%x\n", pci->irq);
/* default intr are unmasked so set this as masked */ /* 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); sst_shim_write64(sst_drv_ctx->shim, SST_IMRX, 0xFFFF0038);
pci_set_drvdata(pci, sst_drv_ctx); pci_set_drvdata(pci, sst_drv_ctx);
......
...@@ -337,7 +337,8 @@ struct sst_shim_regs64 { ...@@ -337,7 +337,8 @@ struct sst_shim_regs64 {
* struct intel_sst_drv - driver ops * struct intel_sst_drv - driver ops
* *
* @sst_state : current sst device state * @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 * @shim : SST shim pointer
* @mailbox : SST mailbox pointer * @mailbox : SST mailbox pointer
* @iram : SST IRAM pointer * @iram : SST IRAM pointer
...@@ -371,7 +372,7 @@ struct sst_shim_regs64 { ...@@ -371,7 +372,7 @@ struct sst_shim_regs64 {
struct intel_sst_drv { struct intel_sst_drv {
int sst_state; int sst_state;
int irq_num; int irq_num;
unsigned int pci_id; unsigned int dev_id;
void __iomem *ddr; void __iomem *ddr;
void __iomem *shim; void __iomem *shim;
void __iomem *mailbox; void __iomem *mailbox;
......
...@@ -115,7 +115,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr) ...@@ -115,7 +115,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr)
{ {
unsigned long long val = 0; unsigned long long val = 0;
switch (sst->pci_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
val = sst_shim_read64(sst->shim, addr); val = sst_shim_read64(sst->shim, addr);
break; break;
...@@ -126,7 +126,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr) ...@@ -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, void write_shim_data(struct intel_sst_drv *sst, int addr,
unsigned long long data) unsigned long long data)
{ {
switch (sst->pci_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
sst_shim_write64(sst->shim, addr, (u64) data); sst_shim_write64(sst->shim, addr, (u64) data);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment