Skip to content

Commit a1e58ac

Browse files
ngphibangkartben
authored andcommitted
drivers: video: mipi_csi2rx: Explicitly set init priority
The MIPI CSI-2 Rx needs to be initialized after the camera sensor which is generally initialized with CONFIG_VIDEO_INIT_PRIORITY. This is currently true "by chance" due to the order the linker links the object files. This linker order is not easily controlled, so use an explicit priority value to ensure this requirement. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent 8cf519d commit a1e58ac

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/video/Kconfig.mcux_mipi_csi2rx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ config VIDEO_MCUX_MIPI_CSI2RX
88
default y
99
depends on DT_HAS_NXP_MIPI_CSI2RX_ENABLED
1010
select VIDEO_MCUX_CSI
11+
12+
config VIDEO_MCUX_MIPI_CSI2RX_INIT_PRIORITY
13+
int "NXP MCUX CSI-2 Rx init priority"
14+
default 61
15+
depends on VIDEO_MCUX_MIPI_CSI2RX
16+
help
17+
Initialization priority for the MIPI CSI-2 Rx device.

drivers/video/video_mcux_mipi_csi2rx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ static int mipi_csi2rx_init(const struct device *dev)
327327
}; \
328328
\
329329
DEVICE_DT_INST_DEFINE(n, &mipi_csi2rx_init, NULL, &mipi_csi2rx_data_##n, \
330-
&mipi_csi2rx_config_##n, POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \
330+
&mipi_csi2rx_config_##n, POST_KERNEL, \
331+
CONFIG_VIDEO_MCUX_MIPI_CSI2RX_INIT_PRIORITY, \
331332
&mipi_csi2rx_driver_api); \
332333
\
333334
VIDEO_DEVICE_DEFINE(mipi_csi2rx_##n, DEVICE_DT_INST_GET(n), SOURCE_DEV(n));

0 commit comments

Comments
 (0)