Skip to content

Commit 78b9f25

Browse files
ngphibangnashif
authored andcommitted
drivers: video: Use video interfaces binding for ov7670 and smartdma
Have ov7670 and video smartdma use video interfaces binding. With this, we can fix the chicken-egg issue in init priority and don't need the workaround anymore. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent cc17b71 commit 78b9f25

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 {
100100
reset-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
101101
pwdn-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
102102
reg = <0x21>;
103+
104+
port {
105+
ov7670_ep_out: endpoint {
106+
remote-endpoint-label = "sdma_ep_in";
107+
};
108+
};
103109
};
104110
};
105111

@@ -112,10 +118,15 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 {
112118
compatible = "nxp,video-smartdma";
113119
pinctrl-0 = <&pinmux_smartdma_camera>;
114120
pinctrl-names = "default";
115-
sensor = <&ov7670>;
116121
vsync-pin = <4>;
117122
hsync-pin = <11>;
118123
pclk-pin = <5>;
124+
125+
port {
126+
sdma_ep_in: endpoint {
127+
remote-endpoint-label = "ov7670_ep_out";
128+
};
129+
};
119130
};
120131
};
121132

drivers/video/video_mcux_smartdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static DEVICE_API(video, nxp_video_sdma_api) = {
365365
.flush = nxp_video_sdma_flush
366366
};
367367

368-
#define SOURCE_DEV(inst) DEVICE_DT_GET(DT_INST_PHANDLE(inst, sensor))
368+
#define SOURCE_DEV(inst) DEVICE_DT_GET(DT_NODE_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(inst, 0, 0)))
369369

370370
#define NXP_VIDEO_SDMA_INIT(inst) \
371371
PINCTRL_DT_INST_DEFINE(inst); \

dts/bindings/video/nxp,video-smartdma.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ compatible: "nxp,video-smartdma"
88
include: [base.yaml, pinctrl-device.yaml]
99

1010
properties:
11-
sensor:
12-
required: true
13-
type: phandle
14-
description: phandle of connected sensor device
1511
vsync-pin:
1612
required: true
1713
type: int
@@ -27,3 +23,7 @@ properties:
2723
type: int
2824
description: |
2925
GPIO0 pin index to use for PCLK input. Only pins 0-15 may be used.
26+
27+
child-binding:
28+
child-binding:
29+
include: video-interfaces.yaml

dts/bindings/video/ovti,ov7670.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ properties:
1818
receives this as an active high signal
1919
2020
include: i2c-device.yaml
21+
22+
child-binding:
23+
child-binding:
24+
include: video-interfaces.yaml
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=40000
22
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=2
3-
# Workaround for issue where SDMA driver needs to start before camera, so that
4-
# clock output will be generated for camera device
5-
CONFIG_CHECK_INIT_PRIORITIES=n

0 commit comments

Comments
 (0)