summaryrefslogtreecommitdiff
path: root/board/kohaku/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'board/kohaku/board.h')
-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