diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2015-09-23 12:30:14 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-02 12:55:51 -0700 |
commit | 229094b2455e093c95d07251a0021f3b637e813c (patch) | |
tree | 9f9000c571d4c4dca79737902d14fe4a6a84643f /driver/als_isl29035.c | |
parent | 2aebfda07f3fe4d3ee058022f088283b35f4f976 (diff) | |
download | chrome-ec-229094b2455e093c95d07251a0021f3b637e813c.tar.gz |
ALS: Disable the ALS task if all the ALS inits fail
BUG=none
TEST=Manually tested on Kunimitsu & Strago.
Removed the ALS sensor from DUT, using "taskinfo" console command
observed that the ALS task is not running.
BRANCH=none
Change-Id: I96cb720bd8d70033d433cdc2cd9cea9b56a3b389
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/301753
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/als_isl29035.c')
-rw-r--r-- | driver/als_isl29035.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/driver/als_isl29035.c b/driver/als_isl29035.c index f908e443bd..357cc99089 100644 --- a/driver/als_isl29035.c +++ b/driver/als_isl29035.c @@ -6,10 +6,7 @@ */ #include "driver/als_isl29035.h" -#include "common.h" -#include "hooks.h" #include "i2c.h" -#include "timer.h" /* I2C interface */ #define ILS29035_I2C_ADDR 0x88 @@ -23,17 +20,16 @@ #define ILS29035_REG_INT_HT_MSB 7 #define ILS29035_REG_ID 15 -static void isl29035_init(void) +int isl29035_init(void) { /* * Tell it to read continually. This uses 70uA, as opposed to nearly * zero, but it makes the hook/update code cleaner (we don't want to * wait 90ms to read on demand while processing hook callbacks). */ - (void)i2c_write8(I2C_PORT_ALS, ILS29035_I2C_ADDR, + return i2c_write8(I2C_PORT_ALS, ILS29035_I2C_ADDR, ILS29035_REG_COMMAND_I, 0xa0); } -DECLARE_HOOK(HOOK_CHIPSET_RESUME, isl29035_init, HOOK_PRIO_DEFAULT); int isl29035_read_lux(int *lux, int af) { |