summaryrefslogtreecommitdiff
path: root/board/dalboz
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-03-27 20:28:18 -0600
committerCommit Bot <commit-bot@chromium.org>2020-03-28 19:29:55 +0000
commit3fd849f1ba5c22836d3c23bce213dc87f87bcb36 (patch)
tree52b2c261f1deca1f72c89947e298c4d74b7d801f /board/dalboz
parent9f3ade325ef2111c078009e2d223e33f1abac871 (diff)
downloadchrome-ec-3fd849f1ba5c22836d3c23bce213dc87f87bcb36.tar.gz
Zork: Clean up FW_CONFIG hook functions
BUG=b:150239200 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I01238a98e17cd0a6320986e12bba32c08e1244fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125588 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/dalboz')
-rw-r--r--board/dalboz/board.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/board/dalboz/board.c b/board/dalboz/board.c
index 8fd80d29a4..d44f5ea6f7 100644
--- a/board/dalboz/board.c
+++ b/board/dalboz/board.c
@@ -21,6 +21,7 @@
#include "pwm_chip.h"
#include "switch.h"
#include "system.h"
+#include "tablet_mode.h"
#include "task.h"
#include "usb_charge.h"
@@ -152,7 +153,7 @@ void pcal6408_interrupt(enum gpio_signal signal)
hook_call_deferred(&pcal6408_handler_data, 0);
}
-static void setup_usb_db(void)
+static void setup_fw_config(void)
{
if (ec_config_get_usb_db() == DALBOZ_DB_D_OPT2_USBA_HDMI) {
ccprints("DB OPT2 HDMI");
@@ -184,14 +185,19 @@ static void setup_usb_db(void)
/* Enable BC 1.2 interrupts */
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL);
gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_ODL);
-}
-DECLARE_HOOK(HOOK_INIT, setup_usb_db, HOOK_PRIO_INIT_I2C + 2);
-void board_update_sensor_config_from_sku(void)
-{
- /* Enable Gyro interrupts */
- gpio_enable_interrupt(GPIO_6AXIS_INT_L);
+ if (ec_config_has_lid_angle_tablet_mode()) {
+ /* Enable Gyro interrupts */
+ gpio_enable_interrupt(GPIO_6AXIS_INT_L);
+ } else {
+ motion_sensor_count = 0;
+ /* Device is clamshell only */
+ tablet_set_mode(0);
+ /* Gyro is not present, don't allow line to float */
+ gpio_set_flags(GPIO_6AXIS_INT_L, GPIO_INPUT | GPIO_PULL_DOWN);
+ }
}
+DECLARE_HOOK(HOOK_INIT, setup_fw_config, HOOK_PRIO_INIT_I2C + 2);
const struct pwm_t pwm_channels[] = {
[PWM_CH_KBLIGHT] = {