Skip to content

Commit b3b0388

Browse files
committed
drivers: video: csi: Remove source device phandle
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 <phibang.nguyen@nxp.com>
1 parent 2b855b8 commit b3b0388

File tree

7 files changed

+11
-28
lines changed

7 files changed

+11
-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
@@ -18,6 +18,16 @@
1818
#include <fsl_cache.h>
1919
#endif
2020

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

498508
static const struct video_mcux_csi_config video_mcux_csi_config_0 = {
499509
.base = (CSI_Type *)DT_INST_REG_ADDR(0),
500-
.source_dev = DEVICE_DT_GET(DT_INST_PHANDLE(0, source)),
510+
.source_dev = DEVICE_DT_INST_GET_SOURCE_DEV(0),
501511
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
502512
};
503513

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
status = "okay";
5454
interrupt-parent = <&nvic>;
5555
interrupts = <56 1>;
56-
source = <&test_mipi_csi2rx>;
5756
};
5857

5958
test_mipi_csi2rx: mipi_csi2rx@33334444 {

0 commit comments

Comments
 (0)