summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-03-29 07:44:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-05 18:41:13 -0700
commit211c2125201f5783ceeb18f34452b3ed90627e01 (patch)
tree8068d19de36cadee5fd95724757c6745bd3cb55d
parent54884c45c59c07a4c16fd131dc4641a27559c871 (diff)
downloadchrome-ec-211c2125201f5783ceeb18f34452b3ed90627e01.tar.gz
meowth: Add Sync support
BUG=b:73546254 BRANCH=master TEST=Check sync sensor is present with accelinfo. Change-Id: Id971d9f1908a2e04be325ac54d3ed600ee7901cd Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/986919 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/zoombini/board.c13
-rw-r--r--board/zoombini/board.h3
-rw-r--r--board/zoombini/gpio.inc1
3 files changed, 17 insertions, 0 deletions
diff --git a/board/zoombini/board.c b/board/zoombini/board.c
index d71bfceb96..d7c9b3f784 100644
--- a/board/zoombini/board.c
+++ b/board/zoombini/board.c
@@ -19,6 +19,7 @@
#include "driver/led/lm3630a.h"
#include "driver/pmic_tps650x30.h"
#include "driver/ppc/sn5s330.h"
+#include "driver/sync.h"
#include "driver/tcpm/ps8xxx.h"
#include "ec_commands.h"
#ifdef CONFIG_ESPI_VW_SIGNALS
@@ -282,6 +283,17 @@ 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,
+ },
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
@@ -468,6 +480,7 @@ static void board_init(void)
gpio_enable_interrupt(GPIO_USB_C2_PPC_INT_L);
#else
gpio_enable_interrupt(GPIO_SIXAXIS_INT_L);
+ gpio_enable_interrupt(GPIO_RCAM_VSYNC);
#endif /* defined(BOARD_ZOOMBINI) */
/* Enable TCPC interrupts. */
diff --git a/board/zoombini/board.h b/board/zoombini/board.h
index ec1d3d1d57..ec33030fae 100644
--- a/board/zoombini/board.h
+++ b/board/zoombini/board.h
@@ -54,6 +54,7 @@
#define CONFIG_ALS_OPT3001
#define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1
#define ALS_COUNT 1
+#define CONFIG_SYNC
/* FIFO size is in power of 2. */
#define CONFIG_ACCEL_FIFO 1024
@@ -66,6 +67,7 @@
/* Custom sensor option. */
#define CONFIG_ACCEL_LSM6DSM_INT_EVENT TASK_EVENT_CUSTOM(4)
+#define CONFIG_SYNC_INT_EVENT TASK_EVENT_CUSTOM(8)
#define CONFIG_BACKLIGHT_LID
@@ -284,6 +286,7 @@ enum sensor_id {
LID_ACCEL,
LID_GYRO,
LID_ALS,
+ VSYNC,
};
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ALS)
diff --git a/board/zoombini/gpio.inc b/board/zoombini/gpio.inc
index 2c299bd3c9..91e300d2ad 100644
--- a/board/zoombini/gpio.inc
+++ b/board/zoombini/gpio.inc
@@ -157,6 +157,7 @@ GPIO_INT(BASE_PWR_FLT_L, PIN(2, 4), GPIO_INT_FALLING, base_pwr_fault_interrupt)
/* MEMS Sensors. */
GPIO_INT(SIXAXIS_INT_L, PIN(5, 6), GPIO_INT_FALLING, lsm6dsm_interrupt)
+GPIO_INT(RCAM_VSYNC, PIN(E, 0), GPIO_INT_FALLING, sync_interrupt)
GPIO(ALS_INT_L, PIN(5, 0), GPIO_INPUT)