aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/sep/sep_driver.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-12-08 10:57:25 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-08 10:57:25 +0000
commiteedd536b968e5b8f52112ffb33e48b7bc8d5cba1 (patch)
treed1a207ad79f6b0717b0bc6c0975ff58f9b92163d /drivers/staging/sep/sep_driver.c
parentd8da9fe1a3c920d1d91bcf258c748dbf06f3604a (diff)
downloadmrst-s0i3-test-eedd536b968e5b8f52112ffb33e48b7bc8d5cba1.tar.gz
mrst-s0i3-test-eedd536b968e5b8f52112ffb33e48b7bc8d5cba1.tar.xz
mrst-s0i3-test-eedd536b968e5b8f52112ffb33e48b7bc8d5cba1.zip
Signed-off-by: Mark A. Allyn <mark.a.allyn@intel.com>
Diffstat (limited to 'drivers/staging/sep/sep_driver.c')
-rw-r--r--drivers/staging/sep/sep_driver.c55
1 files changed, 23 insertions, 32 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index 8eed123dc78..617c2650a39 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -1252,50 +1252,41 @@ static int sep_set_current_caller_id(struct sep_device *sep)
static void sep_send_command_handler(struct sep_device *sep)
{
- dbg("sep:sep_send_command_handler start\n");
+ dev_dbg(&sep->pdev->dev, "sep_send_command_handler start\n");
+
+ dev_dbg(&sep->pdev->dev, "calling test and set for "
+ " in_use_flags SEP_SEND_MSG_LOCK_BIT 0\n");
+ if (test_and_set_bit(SEP_SEND_MSG_LOCK_BIT, &sep->in_use_flags)) {
+
+ dev_warn(&sep->pdev->dev,
+ "cannot send msg while awaiting reply\n");
+ goto end_function;
+ }
- mutex_lock(&sep_mutex);
sep_set_time(sep);
- /* FIXME: flush cache */
- flush_cache_all();
+ /* only Medfield has caller id */
+ if (sep->mrst == 0)
+ sep_set_current_caller_id(sep);
sep_dump_message(sep);
+
/* update counter */
+ spin_lock_irqsave(&snd_rply_lck, snd_rply_lck_flag);
sep->send_ct++;
- /* send interrupt to SEP */
- sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2);
- dbg("SEP Driver:<-------- sep_send_command_handler end\n");
- mutex_unlock(&sep_mutex);
- return;
-}
+ spin_unlock_irqrestore(&snd_rply_lck, snd_rply_lck_flag);
-/**
- * sep_send_reply_command_handler - kick off a command reply
- * @sep: sep being signalled
- *
- * This function raises interrupt to SEP that signals that is has a new
- * command from the host
- */
+ dev_dbg(&sep->pdev->dev, "sep_send_command_handler"
+ "send_ct %lx reply_ct %lx\n", sep->send_ct, sep->reply_ct);
-static void sep_send_reply_command_handler(struct sep_device *sep)
-{
- dbg("sep:sep_send_reply_command_handler start\n");
+ /* send interrupt to SEP */
+ sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2);
- /* flash cache */
- flush_cache_all();
+end_function:
- sep_dump_message(sep);
+ dev_dbg(&sep->pdev->dev, "sep_send_command_handler end\n");
- mutex_lock(&sep_mutex);
- sep->send_ct++; /* update counter */
- /* send the interrupt to SEP */
- sep_write_reg(sep, HW_HOST_HOST_SEP_GPR2_REG_ADDR, sep->send_ct);
- /* update both counters */
- sep->send_ct++;
- sep->reply_ct++;
- mutex_unlock(&sep_mutex);
- dbg("sep: sep_send_reply_command_handler end\n");
+ return;
}
/*