From 0bc8d67738755f296f386aa79f152a383fdc6b42 Mon Sep 17 00:00:00 2001 From: sravanM Date: Fri, 12 Feb 2016 11:38:01 -0800 Subject: be paranoid about enabling the accelerometer interrupt before sleeping Change-Id: I7164606f092aba48f466bf1de72e37f5807a7acb --- build.sh | 4 ++++ drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 00000000000..ee585774081 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +export ARCH=arm +export CROSS_COMPILE=~/aosp/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- +make omap3_h1_defconfig +make LOADADDR=0x80008000 uImage diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c index eec6ec12c57..8b8f47d1714 100644 --- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c +++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c @@ -2204,7 +2204,7 @@ static int check_wai(struct lsm6ds3_data *cdata) { get_monotonic_boottime(&ts); current_time = ts.tv_sec; - dev_err(cdata->dev, "Last timestamp delta: %d \n", current_time-cdata->irq_timestamp); + dev_err(cdata->dev, "Last timestamp delta: %lli \n", current_time-cdata->irq_timestamp); if(current_time-cdata->irq_timestamp > 15/*minutes*/*60) { return st_lsm6ds3_reset(cdata, true); } @@ -2530,6 +2530,9 @@ int st_lsm6ds3_common_suspend(struct lsm6ds3_data *cdata) dev_info(cdata->dev, "before suspend 0x13 ctrl4: %x err:%i", reg_value, err); #endif + //ensure that the IRQ is enabled before we sleep + st_lsm6ds3_flush_works(); + return 0; } EXPORT_SYMBOL(st_lsm6ds3_common_suspend); -- cgit v1.2.3-70-g09d2