Skip to content

Commit 49c3723

Browse files
committed
drivers: video: introduce CONFIG_VIDEO_LOG_LEVEL
Zephyr drivers have typically one log level defined per class. The video drivers were making exception. This adds the missing log level for video drivers. Since all headers had to be modified, this also: - Update the log initialization to the new syntax from 5e34681 - Sort the #include list to something like #41543 Signed-off-by: Josuah Demangeon <[email protected]>
1 parent 7cf124b commit 49c3723

12 files changed

+36
-44
lines changed

drivers/video/Kconfig

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ menuconfig VIDEO
1313

1414
if VIDEO
1515

16+
module = VIDEO
17+
module-str = video
18+
source "subsys/logging/Kconfig.template.log_config"
19+
1620
config VIDEO_INIT_PRIORITY
1721
int "Video initialization priority"
1822
default 60

drivers/video/Kconfig.stm32_dcmi

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ config VIDEO_STM32_DCMI
1616
select USE_STM32_HAL_DMA_EX if $(DT_STM32_DCMI_HAS_DMA)
1717
help
1818
Enable driver for STM32 Digital camera interface periheral.
19-
20-
module = STM32_DCMI
21-
module-str = stm32_dcmi
22-
source "subsys/logging/Kconfig.template.log_config"

drivers/video/mt9m114.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
*/
77

88
#define DT_DRV_COMPAT aptina_mt9m114
9+
910
#include <zephyr/kernel.h>
1011
#include <zephyr/device.h>
11-
12+
#include <zephyr/logging/log.h>
1213
#include <zephyr/sys/byteorder.h>
13-
1414
#include <zephyr/drivers/video.h>
1515
#include <zephyr/drivers/i2c.h>
1616

17-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
18-
#include <zephyr/logging/log.h>
19-
LOG_MODULE_REGISTER(mt9m114);
17+
LOG_MODULE_REGISTER(video_mt9m114, CONFIG_VIDEO_LOG_LEVEL);
2018

2119
#define MT9M114_CHIP_ID_VAL 0x2481
2220

drivers/video/ov2640.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
*/
66

77
#define DT_DRV_COMPAT ovti_ov2640
8+
89
#include <zephyr/kernel.h>
910
#include <zephyr/device.h>
10-
11+
#include <zephyr/logging/log.h>
1112
#include <zephyr/drivers/video.h>
1213
#include <zephyr/drivers/i2c.h>
1314
#include <zephyr/drivers/gpio.h>
1415

15-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
16-
#include <zephyr/logging/log.h>
17-
LOG_MODULE_REGISTER(ov2640);
16+
LOG_MODULE_REGISTER(video_ov2640, CONFIG_VIDEO_LOG_LEVEL);
1817

1918
/* DSP register bank FF=0x00*/
2019
#define QS 0x44

drivers/video/ov5640.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66

77
#define DT_DRV_COMPAT ovti_ov5640
88

9+
#include <zephyr/kernel.h>
910
#include <zephyr/device.h>
11+
#include <zephyr/logging/log.h>
12+
#include <zephyr/sys/byteorder.h>
1013
#include <zephyr/drivers/i2c.h>
1114
#include <zephyr/drivers/gpio.h>
1215
#include <zephyr/drivers/video.h>
13-
#include <zephyr/kernel.h>
1416

15-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
16-
#include <zephyr/logging/log.h>
17-
LOG_MODULE_REGISTER(ov5640);
18-
19-
#include <zephyr/sys/byteorder.h>
17+
LOG_MODULE_REGISTER(video_ov5640, CONFIG_VIDEO_LOG_LEVEL);
2018

2119
#define CHIP_ID_REG 0x300a
2220
#define CHIP_ID_VAL 0x5640

drivers/video/ov7670.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
#include <zephyr/drivers/gpio.h>
1010
#include <zephyr/drivers/i2c.h>
1111
#include <zephyr/drivers/video.h>
12-
13-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
1412
#include <zephyr/logging/log.h>
15-
LOG_MODULE_REGISTER(ov7670);
13+
14+
LOG_MODULE_REGISTER(video_ov7670, CONFIG_VIDEO_LOG_LEVEL);
1615

1716
/* Initialization register structure */
1817
struct ov7670_reg {

drivers/video/ov7725.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55
*/
66

77
#define DT_DRV_COMPAT ovti_ov7725
8+
89
#include <zephyr/kernel.h>
910
#include <zephyr/device.h>
10-
1111
#include <zephyr/sys/byteorder.h>
12-
12+
#include <zephyr/logging/log.h>
1313
#include <zephyr/drivers/video.h>
1414
#include <zephyr/drivers/i2c.h>
1515
#include <zephyr/drivers/gpio.h>
1616

17-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
18-
#include <zephyr/logging/log.h>
19-
LOG_MODULE_REGISTER(ov7725);
17+
LOG_MODULE_REGISTER(video_ov7725, CONFIG_VIDEO_LOG_LEVEL);
2018

2119
#define OV7725_REVISION 0x7721U
2220

drivers/video/video_common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
#include <zephyr/kernel.h>
76

7+
#include <zephyr/kernel.h>
88
#include <zephyr/drivers/video.h>
99

1010
K_HEAP_DEFINE(video_buffer_pool,

drivers/video/video_mcux_csi.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
#define DT_DRV_COMPAT nxp_imx_csi
88

99
#include <zephyr/kernel.h>
10+
#include <zephyr/irq.h>
11+
#include <zephyr/drivers/video.h>
12+
#include <zephyr/drivers/pinctrl.h>
1013

1114
#include <fsl_csi.h>
1215

1316
#ifdef CONFIG_HAS_MCUX_CACHE
1417
#include <fsl_cache.h>
1518
#endif
1619

17-
#include <zephyr/drivers/video.h>
18-
#include <zephyr/drivers/pinctrl.h>
19-
#include <zephyr/irq.h>
20-
2120
struct video_mcux_csi_config {
2221
CSI_Type *base;
2322
const struct device *source_dev;

drivers/video/video_mcux_mipi_csi2rx.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66

77
#define DT_DRV_COMPAT nxp_mipi_csi2rx
88

9-
#include <fsl_mipi_csi2rx.h>
10-
119
#include <zephyr/drivers/video.h>
1210
#include <zephyr/kernel.h>
13-
14-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
1511
#include <zephyr/logging/log.h>
16-
LOG_MODULE_REGISTER(mipi_csi);
12+
13+
#include <fsl_mipi_csi2rx.h>
14+
15+
LOG_MODULE_REGISTER(video_mipi_csi2rx, CONFIG_VIDEO_LOG_LEVEL);
1716

1817
/*
1918
* Two data lanes are set by default as 2-lanes camera sensors are

drivers/video/video_stm32_dcmi.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
#define DT_DRV_COMPAT st_stm32_dcmi
88

99
#include <errno.h>
10+
1011
#include <zephyr/kernel.h>
12+
#include <zephyr/irq.h>
13+
#include <zephyr/logging/log.h>
1114
#include <zephyr/drivers/video.h>
1215
#include <zephyr/drivers/pinctrl.h>
13-
#include <zephyr/irq.h>
1416
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
1517
#include <zephyr/drivers/clock_control.h>
1618
#include <zephyr/drivers/dma.h>
1719
#include <zephyr/drivers/dma/dma_stm32.h>
1820

1921
#include <stm32_ll_dma.h>
2022

21-
#include <zephyr/logging/log.h>
22-
LOG_MODULE_REGISTER(video_stm32_dcmi, CONFIG_STM32_DCMI_LOG_LEVEL);
23+
LOG_MODULE_REGISTER(video_stm32_dcmi, CONFIG_VIDEO_LOG_LEVEL);
2324

2425
K_HEAP_DEFINE(video_stm32_buffer_pool, CONFIG_VIDEO_BUFFER_POOL_SZ_MAX);
2526

drivers/video/video_sw_generator.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
#include <zephyr/kernel.h>
76

8-
#include <zephyr/drivers/video.h>
7+
#define DT_DRV_COMPAT zephyr_sw_generator
98

10-
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
9+
#include <zephyr/kernel.h>
10+
#include <zephyr/drivers/video.h>
1111
#include <zephyr/logging/log.h>
12-
LOG_MODULE_REGISTER(video_sw_generator);
12+
13+
LOG_MODULE_REGISTER(video_sw_generator, CONFIG_VIDEO_LOG_LEVEL);
1314

1415
#define VIDEO_PATTERN_COLOR_BAR 0
1516
#define VIDEO_PATTERN_FPS 30

0 commit comments

Comments
 (0)