summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJongpil Jung <jongpil19.jung@samsung.corp-partner.google.com>2019-08-06 18:47:05 +0900
committerCommit Bot <commit-bot@chromium.org>2019-08-13 23:09:13 +0000
commiteb0dbd82171e322621f8b43a0d73610ebffd4ac2 (patch)
treeb6b7f0bba1e18cb092f91eace668b383a4f7d84d
parent95d43c00aeead373dca72c814bd6109b39668386 (diff)
downloadchrome-ec-eb0dbd82171e322621f8b43a0d73610ebffd4ac2.tar.gz
kohaku: Update tuned parameters to get lux from BH1733
Tune parameters for equation to get lux from register value. How to tune parameters. Place system into dark chamber. Place halogen/led lamp. We can change lux from lamp. Read data0 and data1 from two different devices. Then we will get two equation from test. Solve equation to get/calculate constant value as light source. Parameter can be changed as chassis. BUG=b:130835790 BRANCH=none TEST=make -j BOARD=kohaku flash ec on kokaku and then check lux with ectool motionsense Change-Id: I01950a62a2a449728c2d99aae7f7551b3b9d8bea Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1739029 Tested-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
-rw-r--r--board/kohaku/board.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/board/kohaku/board.h b/board/kohaku/board.h
index 3670f5a27b..c13ba1c805 100644
--- a/board/kohaku/board.h
+++ b/board/kohaku/board.h
@@ -56,23 +56,31 @@
(BIT(LID_ACCEL) | BIT(BASE_ALS) | BIT(CLEAR_ALS))
/* Parameter to calculate LUX on Kohaku */
+#define CONFIG_ALS_BH1730_LUXTH_PARAMS
/*
- * TODO (b/130835790): These values are from Caroline. Do they need to be
- * changed for Kohaku?
+ * Calulation formula depends on characteristic of optical window.
+ * In case of kohaku, we can select two different formula
+ * as characteristic of optical window.
+ * BH1730_LUXTH1_1K is charateristic of optical window.
+ * 1. d1_1K/d0_1K * 1000 < BH1730_LUXTH1_1K
+ * 2. d1_1K/d0_1K * 1000 >= BH1730_LUXTH1_1K
+ * d0 and d1 are unsigned 16 bit. So, d1/d0 max is 65535
+ * To meet 2nd condition, make BH1730_LUXTH2_1K to (max+1)*1000
+ * Kohaku will not use both BH1730_LUXTH3_1K condition
+ * and BH1730_LUXTH4_1K condition.
*/
-#define CONFIG_ALS_BH1730_LUXTH_PARAMS
#define BH1730_LUXTH1_1K 270
-#define BH1730_LUXTH1_D0_1K 4000
-#define BH1730_LUXTH1_D1_1K 6364
-#define BH1730_LUXTH2_1K 740
-#define BH1730_LUXTH2_D0_1K 3088
-#define BH1730_LUXTH2_D1_1K 3010
+#define BH1730_LUXTH1_D0_1K 19200
+#define BH1730_LUXTH1_D1_1K 30528
+#define BH1730_LUXTH2_1K 655360000
+#define BH1730_LUXTH2_D0_1K 11008
+#define BH1730_LUXTH2_D1_1K 10752
#define BH1730_LUXTH3_1K 1030
-#define BH1730_LUXTH3_D0_1K 2056
-#define BH1730_LUXTH3_D1_1K 1608
+#define BH1730_LUXTH3_D0_1K 11008
+#define BH1730_LUXTH3_D1_1K 10752
#define BH1730_LUXTH4_1K 3670
-#define BH1730_LUXTH4_D0_1K 550
-#define BH1730_LUXTH4_D1_1K 149
+#define BH1730_LUXTH4_D0_1K 11008
+#define BH1730_LUXTH4_D1_1K 10752
/* USB Type C and USB PD defines */
#define CONFIG_USB_PD_COMM_LOCKED