diff options
author | yang-cy.chen <yang-cy.chen@mediatek.com> | 2015-08-24 15:49:10 +0800 |
---|---|---|
committer | Jin Qian <jinqian@google.com> | 2015-08-28 21:25:38 +0000 |
commit | b8af9a89ed2e78a1268612ea3f10ecabffe49ba6 (patch) | |
tree | b09e7b91b657dd2f4c782218f9c11a4415e61cad | |
parent | 329c91fc0b4044dbb34f2d582d46063ee9a7d962 (diff) | |
download | mediatek-b8af9a89ed2e78a1268612ea3f10ecabffe49ba6.tar.gz |
mediatek:Deactivate sensor before event reported
Description:
Change the driver to follow SMD definition of below's link,
the sensor must be deactivated before the event is reported through the HAL.
(https://source.android.com/devices/sensors/report-modes.html#one-shot)
Bug num:23206214
Change-Id: Icf62808b153e5013113b0716154de0207e6a4657
Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
(cherry picked from commit b84e5aaf213f57327f4edc6d95301d91ef0ca95b)
-rw-r--r-- | drivers/misc/mediatek/accelerometer/BMC156_ACC/bmc156_acc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/mediatek/accelerometer/BMC156_ACC/bmc156_acc.c b/drivers/misc/mediatek/accelerometer/BMC156_ACC/bmc156_acc.c index c6c21990d621..f7a4c857efe2 100644 --- a/drivers/misc/mediatek/accelerometer/BMC156_ACC/bmc156_acc.c +++ b/drivers/misc/mediatek/accelerometer/BMC156_ACC/bmc156_acc.c @@ -59,6 +59,7 @@ extern struct acc_hw* bmc156_get_cust_acc_hw(void); static int common_use = 0; static int sm_use = 0; static int motion_detect = 0; +static int enable_significant_motion(int en); extern void mt_eint_mask(unsigned int eint_num); extern void mt_eint_unmask(unsigned int eint_num); @@ -1064,9 +1065,10 @@ static void bmc156_eint_work(struct work_struct *work) struct i2c_client *client = bma255_i2c_client; motion_detect = (int)bma255_get_slope_int_status(client); +/*The sensor must be deactivated before the event is reported through the HAL*/ +enable_significant_motion(0); acc_report_motion_detect(motion_detect); GSE_LOG("[%s] motion:%d enable:%d power:%d common_use:%d sm_use:%d\n",__func__,motion_detect,enable_status,sensor_power,common_use,sm_use); -mt_eint_unmask(CUST_EINT_GSE_2_NUM); } static void bmc156_eint_func(void) |