summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-03-12 14:48:07 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-03-13 00:17:12 +0000
commit3c895ef86501e323825361e24c192ba42918eabc (patch)
treed81fd06cf78447dd960cf664f4c90bf3da11acee
parent3cb4d73726b385d91204593679514a73baef6c24 (diff)
downloadchrome-ec-3c895ef86501e323825361e24c192ba42918eabc.tar.gz
Revert "driver: OPT3001: Add attenuation factor."
This reverts commit e700bfc2edeb3e431277c6c87c2c3a9992145fd4. Change-Id: Ib0735f3eb28b28db1f8027f127b51a217249d5c6 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/959629 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/nami/board.c1
-rw-r--r--board/poppy/board.c1
-rw-r--r--board/reef/board.c1
-rw-r--r--board/zoombini/board.c2
-rw-r--r--driver/als_opt3001.c3
-rw-r--r--driver/als_opt3001.h1
6 files changed, 1 insertions, 8 deletions
diff --git a/board/nami/board.c b/board/nami/board.c
index e74cd33a61..d3479d59db 100644
--- a/board/nami/board.c
+++ b/board/nami/board.c
@@ -502,7 +502,6 @@ static struct opt3001_drv_data_t g_opt3001_data = {
.scale = 1,
.uscale = 0,
.offset = 0,
- .attenuation_factor = 1,
};
/* Matrix to rotate accelrator into standard reference frame */
const matrix_3x3_t base_standard_ref = {
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 7e2138c674..201561dd0f 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -680,7 +680,6 @@ static struct opt3001_drv_data_t g_opt3001_data = {
.scale = 1,
.uscale = 0,
.offset = 0,
- .attenuation_factor = 1,
};
/* Matrix to rotate accelrator into standard reference frame */
diff --git a/board/reef/board.c b/board/reef/board.c
index 603df62347..fa16408e21 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -786,7 +786,6 @@ static struct opt3001_drv_data_t g_opt3001_data = {
.scale = 1,
.uscale = 0,
.offset = 0,
- .attenuation_factor = 1,
};
/* FIXME(dhendrix): Copied from Amenia, probably need to tweak for Reef */
diff --git a/board/zoombini/board.c b/board/zoombini/board.c
index 8d4ecc795a..6ce0198e4a 100644
--- a/board/zoombini/board.c
+++ b/board/zoombini/board.c
@@ -208,8 +208,6 @@ static struct opt3001_drv_data_t g_opt3001_data = {
.scale = 1,
.uscale = 0,
.offset = 0,
- /* Meowth has a dark cover glass. */
- .attenuation_factor = 100,
};
/* Base Sensor mutex */
diff --git a/driver/als_opt3001.c b/driver/als_opt3001.c
index 344636580d..b3ab198496 100644
--- a/driver/als_opt3001.c
+++ b/driver/als_opt3001.c
@@ -147,8 +147,7 @@ int opt3001_read_lux(const struct motion_sensor_t *s, vector_3_t v)
/*
* lux = 2EXP[3:0] × R[11:0] / 100
*/
- data = (1 << (data >> 12)) * (data & 0x0FFF) *
- drv_data->attenuation_factor / 100;
+ data = (1 << (data >> 12)) * (data & 0x0FFF) / 100;
data += drv_data->offset;
if (data < 0)
data = 1;
diff --git a/driver/als_opt3001.h b/driver/als_opt3001.h
index 60cf115172..eeb05f3a10 100644
--- a/driver/als_opt3001.h
+++ b/driver/als_opt3001.h
@@ -53,7 +53,6 @@ struct opt3001_drv_data_t {
int16_t scale;
uint16_t uscale;
int16_t offset;
- int attenuation_factor;
};
extern const struct accelgyro_drv opt3001_drv;