summaryrefslogtreecommitdiff
path: root/board/bloog/board.c
diff options
context:
space:
mode:
authorDevin Lu <devin.lu@quantatw.com>2020-02-04 18:54:40 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-05 18:50:04 +0000
commit3bc390bf17a0a825166ec7f91b676de1a39556dc (patch)
tree676bd6301cd23b57f763f573dead84e1b4787723 /board/bloog/board.c
parentc1a9b3cdb8f24ece0c196c386ec76a56e6bf34fc (diff)
downloadchrome-ec-3bc390bf17a0a825166ec7f91b676de1a39556dc.tar.gz
Bipship: tuning lid accelerometer direction
This patch adds SKU IDs to support Bipship and tune lid accelerometer matrix. BUG=b:147021309, b:146163628 BRANCH=octopus TEST=check the screen rotation was normally. make sure x-y-z axis direction is indeed. Change-Id: Idf1bddef2a92804b4cc1d05796ff73b292fd4e4a Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2035441 Reviewed-by: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'board/bloog/board.c')
-rw-r--r--board/bloog/board.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/board/bloog/board.c b/board/bloog/board.c
index 4a5f9bb858..36e5057bc2 100644
--- a/board/bloog/board.c
+++ b/board/bloog/board.c
@@ -110,12 +110,18 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const mat33_fp_t lid_standrd_ref = {
+const mat33_fp_t lid_a_cover_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
+const mat33_fp_t lid_b_cover_ref = {
+ { FLOAT_TO_FP(-1), 0, 0},
+ { 0, FLOAT_TO_FP(-1), 0},
+ { 0, 0, FLOAT_TO_FP(1)}
+};
+
const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
@@ -139,7 +145,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &kx022_data,
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = KX022_ADDR1_FLAGS,
- .rot_standard_ref = &lid_standrd_ref,
+ .rot_standard_ref = &lid_a_cover_ref,
.default_range = 2, /* g */
.min_frequency = KX022_ACCEL_MIN_FREQ,
.max_frequency = KX022_ACCEL_MAX_FREQ,
@@ -219,11 +225,12 @@ int board_is_convertible(void)
/*
* Bloog: 33, 34, 35, 36
* Blooguard: 49, 50, 51, 52
+ * Bipship: 53, 54
* Unprovisioned: 255
*/
return sku_id == 33 || sku_id == 34 || sku_id == 35 || sku_id == 36
|| sku_id == 49 || sku_id == 50 || sku_id == 51 || sku_id == 52
- || sku_id == 255;
+ || sku_id == 53 || sku_id == 54 || sku_id == 255;
}
static void board_update_sensor_config_from_sku(void)
@@ -232,6 +239,11 @@ static void board_update_sensor_config_from_sku(void)
motion_sensor_count = ARRAY_SIZE(motion_sensors);
/* Enable Base Accel interrupt */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
+
+ /* Override sensor marix for Bipship. */
+ if (sku_id == 53 || sku_id == 54)
+ motion_sensors[LID_ACCEL].rot_standard_ref =
+ &lid_b_cover_ref;
} else {
motion_sensor_count = 0;
gmr_tablet_switch_disable();