summaryrefslogtreecommitdiff
path: root/board/kohaku/board.c
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2019-06-20 14:44:12 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-25 08:21:27 +0000
commit71c5056bd1f27b52f99c1ed4cff01bdc8cee032e (patch)
treeab7610c82f8c3fb93178b2a3222a4494e7ee9994 /board/kohaku/board.c
parent734a3ea667ee4503dd2f8caf89c62fb7dd91f9e7 (diff)
downloadchrome-ec-71c5056bd1f27b52f99c1ed4cff01bdc8cee032e.tar.gz
kohaku: Add vsync pin and sync driver
VSYNC pin is added to rev1. We need to hook up driver/pin to enable ARCore. This pin doesn't exist on rev0, so I don't expect this patch to break rev0. BUG=b:135216932 BRANCH=none TEST=build kohaku Change-Id: I700d628f064315693911ec53319960491fe0608a Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1670163 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
Diffstat (limited to 'board/kohaku/board.c')
-rw-r--r--board/kohaku/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/kohaku/board.c b/board/kohaku/board.c
index 23b6124ad7..543c656a52 100644
--- a/board/kohaku/board.c
+++ b/board/kohaku/board.c
@@ -15,6 +15,7 @@
#include "driver/als_bh1730.h"
#include "driver/ppc/sn5s330.h"
#include "driver/bc12/max14637.h"
+#include "driver/sync.h"
#include "driver/tcpm/ps8xxx.h"
#include "driver/tcpm/tcpci.h"
#include "ec_commands.h"
@@ -279,6 +280,18 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
+
+ [VSYNC] = {
+ .name = "Camera VSYNC",
+ .active_mask = SENSOR_ACTIVE_S0,
+ .chip = MOTIONSENSE_CHIP_GPIO,
+ .type = MOTIONSENSE_TYPE_SYNC,
+ .location = MOTIONSENSE_LOC_CAMERA,
+ .drv = &sync_drv,
+ .default_range = 0,
+ .min_frequency = 0,
+ .max_frequency = 1,
+ },
};
unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
@@ -320,6 +333,8 @@ static void board_init(void)
{
/* Enable gpio interrupt for base accelgyro sensor */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
+ /* Enable gpio interrupt for camera vsync */
+ gpio_enable_interrupt(GPIO_WFCAM_VSYNC);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);