From 9a8576911f4bc72e774d0b0abadd975a2bc0c718 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Mon, 31 Oct 2022 20:23:41 +0900 Subject: [PATCH] boards: cxd56xx: Fix power-off time of video driver Add a power-off time for image sensor by the device specification. --- boards/arm/cxd56xx/common/src/cxd56_isx012.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/boards/arm/cxd56xx/common/src/cxd56_isx012.c b/boards/arm/cxd56xx/common/src/cxd56_isx012.c index 553b3fcb95..4178d960c9 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_isx012.c +++ b/boards/arm/cxd56xx/common/src/cxd56_isx012.c @@ -51,10 +51,11 @@ # error "IMAGER_SLEEP must be defined in board.h !!" #endif -#define STANDBY_TIME (600*1000) /* TODO: (max100ms/30fps)*/ -#define DEVICE_STARTUP_TIME (6*1000) /* ms */ -#define SLEEP_CANCEL_TIME (13*1000) /* ms */ -#define POWER_CHECK_TIME (1*1000) /* ms */ +#define STANDBY_TIME (600 * 1000) /* TODO: (max100ms/30fps)*/ +#define DEVICE_STARTUP_TIME (6 * 1000) /* ms */ +#define SLEEP_CANCEL_TIME (13 * 1000) /* ms */ +#define POWER_CHECK_TIME (1 * 1000) /* ms */ +#define POWER_OFF_TIME (50 * 1000) /* ms */ #define POWER_CHECK_RETRY (10) @@ -103,6 +104,10 @@ int board_isx012_power_off(void) return -ENODEV; } + /* Need to wait for power-off to be reflected */ + + nxsig_usleep(POWER_OFF_TIME); + ret = -ETIMEDOUT; for (i = 0; i < POWER_CHECK_RETRY; i++) {