* [PATCH 1/2] sst: report correct jack event
@ 2011-07-08 8:59 Alan Cox
2011-07-08 8:59 ` [PATCH 2/2] sst: avoid unnecessary firmware reloading for MRST Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2011-07-08 8:59 UTC (permalink / raw)
To: greg, linux-kernel
From: Lu Guanqun <guanqun.lu@intel.com>
The status of jack event is compared bitwise:
[in sound/core/jack.c:snd_jack_report()]
for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++) {
int testbit = 1 << i;
if (jack->type & testbit)
input_report_switch(jack->input_dev,
jack_switch_types[i],
status & testbit);
}
So in order to report the correct events, 3 should be passed instead of 1.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/staging/intel_sst/intelmid_v2_control.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intelmid_v2_control.c b/drivers/staging/intel_sst/intelmid_v2_control.c
index 000378a..46ab55e 100644
--- a/drivers/staging/intel_sst/intelmid_v2_control.c
+++ b/drivers/staging/intel_sst/intelmid_v2_control.c
@@ -1090,7 +1090,7 @@ static void nc_pmic_irq_cb(void *cb_data, u8 intsts)
if (intsts & 0x1) {
pr_debug("SST DBG:MAD headset detected\n");
/* send headset detect/undetect */
- present = (value == 0x1) ? 1 : 0;
+ present = (value == 0x1) ? 3 : 0;
jack_event_flag = 1;
mjack->jack.type = SND_JACK_HEADSET;
hp_automute(SND_JACK_HEADSET, present);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] sst: avoid unnecessary firmware reloading for MRST
2011-07-08 8:59 [PATCH 1/2] sst: report correct jack event Alan Cox
@ 2011-07-08 8:59 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2011-07-08 8:59 UTC (permalink / raw)
To: greg, linux-kernel
From: Feng Tang <feng.tang@intel.com>
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>
---
drivers/staging/intel_sst/intel_sst.c | 5 ++++-
drivers/staging/intel_sst/intel_sst_common.h | 2 ++
.../staging/intel_sst/intel_sst_drv_interface.c | 10 ++++++++++
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intel_sst.c b/drivers/staging/intel_sst/intel_sst.c
index c0c144a..d892861 100644
--- a/drivers/staging/intel_sst/intel_sst.c
+++ b/drivers/staging/intel_sst/intel_sst.c
@@ -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;
}
diff --git a/drivers/staging/intel_sst/intel_sst_common.h b/drivers/staging/intel_sst/intel_sst_common.h
index f8e9da6..870981b 100644
--- a/drivers/staging/intel_sst/intel_sst_common.h
+++ b/drivers/staging/intel_sst/intel_sst_common.h
@@ -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;
diff --git a/drivers/staging/intel_sst/intel_sst_drv_interface.c b/drivers/staging/intel_sst/intel_sst_drv_interface.c
index 1021477..69daa14 100644
--- a/drivers/staging/intel_sst/intel_sst_drv_interface.c
+++ b/drivers/staging/intel_sst/intel_sst_drv_interface.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-08 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 8:59 [PATCH 1/2] sst: report correct jack event Alan Cox
2011-07-08 8:59 ` [PATCH 2/2] sst: avoid unnecessary firmware reloading for MRST Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).