Skip to content

Commit 2b855b8

Browse files
committed
drivers: video: mipi_csi2rx: Remove sensor device phandle
The peer remote device "sensor_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 1385de9 commit 2b855b8

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

boards/shields/nxp_btb44_ov5640/nxp_btb44_ov5640.overlay

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
&nxp_mipi_csi {
3535
status = "okay";
3636

37-
sensor = <&ov5640>;
38-
3937
ports {
4038
port@1 {
4139
reg = <1>;

drivers/video/video_mcux_mipi_csi2rx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ LOG_MODULE_REGISTER(video_mipi_csi2rx, CONFIG_VIDEO_LOG_LEVEL);
2020

2121
#define ABS(a, b) (a > b ? a - b : b - a)
2222

23+
#define DEVICE_DT_INST_GET_SENSOR_DEV(n) \
24+
DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL(DT_STRING_TOKEN( \
25+
DT_CHILD(DT_CHILD(DT_INST_CHILD(n, ports), port_1), endpoint), remote_endpoint_label))))
26+
2327
struct mipi_csi2rx_config {
2428
const MIPI_CSI2RX_Type *base;
2529
const struct device *sensor_dev;
@@ -322,7 +326,7 @@ static int mipi_csi2rx_init(const struct device *dev)
322326
\
323327
static const struct mipi_csi2rx_config mipi_csi2rx_config_##n = { \
324328
.base = (MIPI_CSI2RX_Type *)DT_INST_REG_ADDR(n), \
325-
.sensor_dev = DEVICE_DT_GET(DT_INST_PHANDLE(n, sensor)), \
329+
.sensor_dev = DEVICE_DT_INST_GET_SENSOR_DEV(n), \
326330
}; \
327331
\
328332
DEVICE_DT_INST_DEFINE(n, &mipi_csi2rx_init, NULL, &mipi_csi2rx_data_##n, \

dts/bindings/video/nxp,mipi-csi2rx.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ compatible: "nxp,mipi-csi2rx"
1010

1111
include: [base.yaml]
1212

13-
properties:
14-
sensor:
15-
required: true
16-
type: phandle
17-
description: the connected camera sensor
18-
1913
child-binding:
2014
child-binding:
2115
child-binding:

tests/drivers/build_all/video/mimxrt1170_evk_mimxrt1176_cm7.overlay

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
compatible = "nxp,mipi-csi2rx";
6161
reg = <0x33334444 0x200>;
6262
status = "okay";
63-
sensor = <&test_i2c_ov5640>;
6463

6564
ports {
6665
#address-cells = <1>;

0 commit comments

Comments
 (0)