Skip to content

Commit 59e253e

Browse files
ngphibanghenrikbrixandersen
authored andcommitted
drivers: video: csi: Drop source device phandle reference
The peer remote device "source_dev" can be retrieved from the remote-endpoint-label. Direct reference via phandle is not needed. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent 1dd96ba commit 59e253e

File tree

7 files changed

+24
-28
lines changed

7 files changed

+24
-28
lines changed

boards/madmachine/mm_swiftio/mm_swiftio.dts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@
192192

193193
&csi {
194194
status = "okay";
195-
source = <&ov7725>;
196195
pinctrl-0 = <&pinmux_csi>;
197196
pinctrl-names = "default";
198197

boards/shields/dvp_fpc24_mt9m114/boards/mimxrt1060_evkb.overlay

Lines changed: 0 additions & 9 deletions
This file was deleted.

boards/shields/dvp_fpc24_mt9m114/boards/mimxrt1064_evk.overlay

Lines changed: 0 additions & 9 deletions
This file was deleted.

drivers/video/video_mcux_csi.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
#include <fsl_cache.h>
1818
#endif
1919

20+
#if defined(CONFIG_VIDEO_MCUX_MIPI_CSI2RX)
21+
#define DEVICE_DT_INST_GET_SOURCE_DEV(n) \
22+
DEVICE_DT_GET(DT_PARENT(DT_GPARENT(DT_NODELABEL(DT_STRING_TOKEN( \
23+
DT_CHILD(DT_INST_CHILD(n, port), endpoint), remote_endpoint_label)))))
24+
#else
25+
#define DEVICE_DT_INST_GET_SOURCE_DEV(n) \
26+
DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL(DT_STRING_TOKEN( \
27+
DT_CHILD(DT_INST_CHILD(n, port), endpoint), remote_endpoint_label))))
28+
#endif
29+
2030
struct video_mcux_csi_config {
2131
CSI_Type *base;
2232
const struct device *source_dev;
@@ -491,7 +501,7 @@ PINCTRL_DT_INST_DEFINE(0);
491501

492502
static const struct video_mcux_csi_config video_mcux_csi_config_0 = {
493503
.base = (CSI_Type *)DT_INST_REG_ADDR(0),
494-
.source_dev = DEVICE_DT_GET(DT_INST_PHANDLE(0, source)),
504+
.source_dev = DEVICE_DT_INST_GET_SOURCE_DEV(0),
495505
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
496506
};
497507

dts/arm/nxp/nxp_rt11xx.dtsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@
888888
reg = <0x40800000 0x4000>;
889889
interrupts = <56 1>;
890890
status = "disabled";
891-
source = <&mipi_csi2rx>;
892891

893892
port {
894893
csi_ep_in: endpoint {

dts/bindings/video/nxp,imx-csi.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ properties:
1414
interrupts:
1515
required: true
1616

17-
source:
18-
required: true
19-
type: phandle
20-
description: the connected source device,
21-
e.g., a mipi csi or a camera sensor
22-
2317
child-binding:
2418
child-binding:
2519
include: video-interfaces.yaml

tests/drivers/build_all/video/mimxrt1170_evk_mimxrt1176_cm7.overlay

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@
5353
status = "okay";
5454
interrupt-parent = <&nvic>;
5555
interrupts = <56 1>;
56-
source = <&test_mipi_csi2rx>;
56+
57+
port {
58+
test_csi_ep_in: endpoint {
59+
remote-endpoint-label = "test_mipi_csi2rx_ep_out";
60+
};
61+
};
5762
};
5863

5964
test_mipi_csi2rx: mipi_csi2rx@33334444 {
@@ -68,6 +73,13 @@
6873
#address-cells = <1>;
6974
#size-cells = <0>;
7075

76+
port@0 {
77+
reg = <0>;
78+
test_mipi_csi2rx_ep_out: endpoint {
79+
remote-endpoint-label = "test_csi_ep_in";
80+
};
81+
};
82+
7183
port@1 {
7284
reg = <1>;
7385

0 commit comments

Comments
 (0)