From 6611bf99c46b4af08c031b7336457b2fc14927e1 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 27 Jun 2023 18:46:04 +0900 Subject: [PATCH] drivers: video: isx012: Fix system clock to HV mode ISX012 doesn't work if CONFIG_CPUFREQ_RELEASE_LOCK is enabled without this changes. --- boards/arm/cxd56xx/common/src/cxd56_isx012.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/arm/cxd56xx/common/src/cxd56_isx012.c b/boards/arm/cxd56xx/common/src/cxd56_isx012.c index 4178d960c9..697a8ef380 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_isx012.c +++ b/boards/arm/cxd56xx/common/src/cxd56_isx012.c @@ -37,6 +37,7 @@ #include "cxd56_i2c.h" #include +#include /**************************************************************************** * Pre-processor Definitions @@ -59,6 +60,14 @@ #define POWER_CHECK_RETRY (10) +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static struct pm_cpu_freqlock_s g_hv_lock = + PM_CPUFREQLOCK_INIT(PM_CPUFREQLOCK_TAG('I', 'S', 0), + PM_CPUFREQLOCK_FLAG_HV); + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -163,6 +172,10 @@ struct i2c_master_s *board_isx012_initialize(void) { _info("Initializing ISX012...\n"); + /* Fix system clock to HV mode */ + + up_pm_acquire_freqlock(&g_hv_lock); + #ifdef IMAGER_ALERT cxd56_gpio_config(IMAGER_ALERT, true); #endif @@ -184,6 +197,10 @@ int board_isx012_uninitialize(struct i2c_master_s *i2c) _info("Uninitializing ISX012...\n"); + /* Release system clock */ + + up_pm_release_freqlock(&g_hv_lock); + /* Initialize i2c device */ ret = isx012_uninitialize();