]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
sst: avoid unnecessary firmware reloading for MRST
authorFeng Tang <feng.tang@intel.com>
Fri, 8 Jul 2011 08:59:26 +0000 (09:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Jul 2011 21:02:25 +0000 (14:02 -0700)
SST HW on MRST doesn't need to reload the firmware during suspend/resume
cycle, so remove the extra workload. This also fix a bug that the firmware
sample rate can't be modified when there is no active playback/capture
stream.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/intel_sst/intel_sst.c
drivers/staging/intel_sst/intel_sst_common.h
drivers/staging/intel_sst/intel_sst_drv_interface.c

index c0c144a2cda10009182c8808478f057590911ab4..d892861346fc6cf21755e64fde55144a58da19a9 100644 (file)
@@ -545,7 +545,10 @@ static int intel_sst_runtime_suspend(struct device *dev)
        /* Move the SST state to Suspended */
        mutex_lock(&sst_drv_ctx->sst_lock);
        sst_drv_ctx->sst_state = SST_SUSPENDED;
-       sst_shim_write(sst_drv_ctx->shim, SST_CSR, csr.full);
+
+       /* Only needed by Medfield */
+       if (sst_drv_ctx->pci_id != SST_MRST_PCI_ID)
+               sst_shim_write(sst_drv_ctx->shim, SST_CSR, csr.full);
        mutex_unlock(&sst_drv_ctx->sst_lock);
        return 0;
 }
index f8e9da6b3097822eac4fe9a8cd7eb94bed467d2b..870981ba3c9787f1a976e04018af828f5710463f 100644 (file)
@@ -420,6 +420,8 @@ struct intel_sst_drv {
        unsigned int            max_streams;
        unsigned int            *fw_cntx;
        unsigned int            fw_cntx_size;
+
+       unsigned int            fw_downloaded;
 };
 
 extern struct intel_sst_drv *sst_drv_ctx;
index 1021477f238db29b5c244f76f35d493aee3018d4..69daa1404b68f740752921d1ca13c840fba92b6d 100644 (file)
@@ -53,6 +53,13 @@ int sst_download_fw(void)
        if (sst_drv_ctx->sst_state != SST_UN_INIT)
                return -EPERM;
 
+       /* Reload firmware is not needed for MRST */
+       if ( (sst_drv_ctx->pci_id == SST_MRST_PCI_ID) && sst_drv_ctx->fw_downloaded) {
+               pr_debug("FW already downloaded, skip for MRST platform\n");
+               sst_drv_ctx->sst_state = SST_FW_RUNNING;
+               return 0;
+       }
+
        snprintf(name, sizeof(name), "%s%04x%s", "fw_sst_",
                                        sst_drv_ctx->pci_id, ".bin");
 
@@ -71,6 +78,9 @@ int sst_download_fw(void)
        retval = sst_wait_timeout(sst_drv_ctx, &sst_drv_ctx->alloc_block[0]);
        if (retval)
                pr_err("fw download failed %d\n" , retval);
+       else
+               sst_drv_ctx->fw_downloaded = 1;
+
 end_restore:
        release_firmware(fw_sst);
        sst_drv_ctx->alloc_block[0].sst_id = BLOCK_UNINIT;