aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2010-12-09 10:37:33 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:33 +0000
commit30ae9f452aa77c12708c8628cd865c1e9d598f59 (patch)
treec958b3ee97f90a528c7b232e9c0112c67c8ec85b
parent5fb2b15d7d37e9f1654a3ce68c504505e5980e43 (diff)
downloadmrst-s0i3-test-30ae9f452aa77c12708c8628cd865c1e9d598f59.tar.gz
mrst-s0i3-test-30ae9f452aa77c12708c8628cd865c1e9d598f59.tar.xz
mrst-s0i3-test-30ae9f452aa77c12708c8628cd865c1e9d598f59.zip
sst: Construct fw string name runtime
The firmware name for each platform is appended by PCI id of device. This patch makes use of pci id to construct the string rather than hardcode the string. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
-rw-r--r--drivers/staging/intel_sst/intel_sst_common.h3
-rw-r--r--drivers/staging/intel_sst/intel_sst_drv_interface.c11
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/intel_sst/intel_sst_common.h b/drivers/staging/intel_sst/intel_sst_common.h
index a82882423d2..e0c6339ca0a 100644
--- a/drivers/staging/intel_sst/intel_sst_common.h
+++ b/drivers/staging/intel_sst/intel_sst_common.h
@@ -33,10 +33,9 @@
/* driver names */
#define SST_DRV_NAME "intel_sst_driver"
-#define SST_FW_FILENAME_MRST "fw_sst_080a.bin"
-#define SST_FW_FILENAME_MFLD "fw_sst_082f.bin"
#define SST_MRST_PCI_ID 0x080A
#define SST_MFLD_PCI_ID 0x082F
+#define PCI_ID_LENGTH 4
#define SST_SUSPEND_DELAY 2000
enum sst_states {
diff --git a/drivers/staging/intel_sst/intel_sst_drv_interface.c b/drivers/staging/intel_sst/intel_sst_drv_interface.c
index 1ff6420302b..eeae06dbf48 100644
--- a/drivers/staging/intel_sst/intel_sst_drv_interface.c
+++ b/drivers/staging/intel_sst/intel_sst_drv_interface.c
@@ -46,13 +46,14 @@ int sst_download_fw(void)
{
int retval;
const struct firmware *fw_sst;
- const char *name;
+ char name[20];
+
if (sst_drv_ctx->sst_state != SST_UN_INIT)
return -EPERM;
- if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID)
- name = SST_FW_FILENAME_MRST;
- else
- name = SST_FW_FILENAME_MFLD;
+
+ snprintf(name, sizeof(name), "%s%04x%s", "fw_sst_",
+ sst_drv_ctx->pci_id, ".bin");
+
pr_debug("sst: Downloading %s FW now...\n", name);
retval = request_firmware(&fw_sst, name, &sst_drv_ctx->pci->dev);
if (retval) {