diff options
| author | sravan <sravan@mindtribe.com> | 2015-08-06 12:17:22 -0700 | 
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2015-08-07 17:38:59 -0700 | 
| commit | b66fe63ea9d50a1049d9142559121d16f86db9eb (patch) | |
| tree | 1269da3bb1fc50656f6be50ebf2afe717223f22b | |
| parent | b13b7246a4b40ab53ec22d33e935d25c8ee8d1fc (diff) | |
| download | olio-linux-3.10-b66fe63ea9d50a1049d9142559121d16f86db9eb.tar.xz olio-linux-3.10-b66fe63ea9d50a1049d9142559121d16f86db9eb.zip | |
fixing suspend blocking from fifo irq wakelock
Signed-off-by: mattis fjallstrom <mattis@acm.org>
Change-Id: I01ed81a3463ffda1cf0bb9dace028aa8c28fb8dc
| -rw-r--r-- | drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c | 9 | ||||
| -rw-r--r-- | include/linux/wakeup_reason.h | 2 | 
2 files changed, 3 insertions, 8 deletions
| diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c index 5e20cc722e8..a2df1d2990b 100644 --- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c +++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c @@ -106,15 +106,12 @@ static void st_lsm6ds3_irq_management(struct work_struct *data_work)  	cdata = container_of((struct work_struct *)data_work,  						struct lsm6ds3_data, data_work); -	  	if(cdata->first_irq_from_resume && last_wakeup_reason_test(cdata->irq)){ +		//take_wake_lock to give app enough time from wakeup  		woken_from_sleep = 1; +		wake_lock_timeout(&cdata->wlock,msecs_to_jiffies(1000));  	} -	if(!wake_lock_active(&cdata->wlock)) -		wake_lock(&cdata->wlock); - -  	mutex_lock(&cdata->fifo_lock);   	cdata->tf->read(cdata, ST_LSM6DS3_6D_SRC_ADDR, 1, &d6d_src_reg, true); @@ -225,8 +222,6 @@ static void st_lsm6ds3_irq_management(struct work_struct *data_work)  	}  	enable_irq(cdata->irq);  	mutex_unlock(&cdata->fifo_lock);  -	if(wake_lock_active(&cdata->wlock)) -		wake_unlock(&cdata->wlock);  	cdata->first_irq_from_resume = 0;  	return; diff --git a/include/linux/wakeup_reason.h b/include/linux/wakeup_reason.h index b58723ab7c7..e5f3e1f44ae 100644 --- a/include/linux/wakeup_reason.h +++ b/include/linux/wakeup_reason.h @@ -19,7 +19,7 @@  #define _LINUX_WAKEUP_REASON_H  void log_wakeup_reason(int irq); -int get_last_wakeup_reason(); +int get_last_wakeup_reason(void);  int last_wakeup_reason_test(int reason);  #endif /* _LINUX_WAKEUP_REASON_H */ |