diff options
-rw-r--r-- | board/nami/board.c | 23 | ||||
-rw-r--r-- | board/nami/board.h | 2 | ||||
-rw-r--r-- | board/nami/gpio.inc | 3 |
3 files changed, 20 insertions, 8 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index b2bc7a72c0..1c05f429fd 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -778,10 +778,20 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); static void setup_motion_sensors(void) { - if (oem == PROJECT_AKALI) { - motion_sensors[LID_ACCEL] = lid_accel_1; - motion_sensors[BASE_ACCEL].rot_standard_ref = NULL; - motion_sensors[BASE_GYRO].rot_standard_ref = NULL; + switch (oem) { + case PROJECT_AKALI: + if (sku & SKU_ID_MASK_CONVERTIBLE) { + /* Rotate axis for Akali 360 */ + motion_sensors[LID_ACCEL] = lid_accel_1; + motion_sensors[BASE_ACCEL].rot_standard_ref = NULL; + motion_sensors[BASE_GYRO].rot_standard_ref = NULL; + } else { + /* Clamshell Akali has no accel/gyro */ + motion_sensor_count = ARRAY_SIZE(motion_sensors) - 2; + } + break; + default: + break; } } @@ -867,8 +877,9 @@ static void board_init(void) gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L); gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L); - /* Enable Gyro interrupt for BMI160 */ - gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L); + /* Enable Accel/Gyro interrupt for convertibles. */ + if (sku & SKU_ID_MASK_CONVERTIBLE) + gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/nami/board.h b/board/nami/board.h index e7abfaac32..6899d6b85f 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -274,6 +274,8 @@ enum oem_id { PROJECT_COUNT, }; +#define SKU_ID_MASK_CONVERTIBLE (1 << 9) + /* TODO(crosbug.com/p/61098): Verify the numbers below. */ /* * delay to turn on the power supply max is ~16ms. diff --git a/board/nami/gpio.inc b/board/nami/gpio.inc index 6a6e2534e5..0a4708dda8 100644 --- a/board/nami/gpio.inc +++ b/board/nami/gpio.inc @@ -33,9 +33,8 @@ GPIO_INT(USB_C0_VBUS_WAKE_L, PIN(9, 7), GPIO_INT_BOTH | GPIO_PULL_UP,vbus0_evt) GPIO_INT(USB_C1_VBUS_WAKE_L, PIN(C, 5), GPIO_INT_BOTH | GPIO_PULL_UP,vbus1_evt) GPIO_INT(USB_C0_BC12_INT_L, PIN(D, 2), GPIO_INT_FALLING, usb0_evt) GPIO_INT(USB_C1_BC12_INT_L, PIN(D, 3), GPIO_INT_FALLING, usb1_evt) -GPIO_INT(ACCELGYRO3_INT_L, PIN(3, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) +GPIO_INT(ACCELGYRO3_INT_L, PIN(3, 6), GPIO_INT_FALLING | GPIO_PULL_UP, bmi160_interrupt) GPIO_INT(TABLET_MODE_L, PIN(7, 2), GPIO_INT_BOTH, tablet_mode_isr) -/* GPIO_INT(3AXIS_INT, PIN(9, 5),,) dnojiri: Revisit */ GPIO(ENABLE_BACKLIGHT_L, PIN(6, 7), GPIO_OUT_LOW) /* LCD backlight */ GPIO(PP3300_DX_WLAN, PIN(B, 1), GPIO_OUT_LOW) /* Enable WLAN 3.3V Power */ |