Skip to content

Commit f82b0d5

Browse files
ngphibanghenrikbrixandersen
authored andcommitted
drivers: video: mipi_csi2rx: Drop sensor device phandle reference
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 <[email protected]>
1 parent 901f022 commit f82b0d5

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ LOG_MODULE_REGISTER(video_mipi_csi2rx, CONFIG_VIDEO_LOG_LEVEL);
1616

1717
#define DEFAULT_CAMERA_FRAME_RATE 30
1818

19+
#define DEVICE_DT_INST_GET_SENSOR_DEV(n) \
20+
DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL( \
21+
DT_STRING_TOKEN(DT_CHILD(DT_CHILD(DT_INST_CHILD(n, ports), port_1), endpoint), \
22+
remote_endpoint_label))))
23+
1924
struct mipi_csi2rx_config {
2025
const MIPI_CSI2RX_Type *base;
2126
const struct device *sensor_dev;
@@ -204,7 +209,7 @@ static int mipi_csi2rx_init(const struct device *dev)
204209
\
205210
static const struct mipi_csi2rx_config mipi_csi2rx_config_##n = { \
206211
.base = (MIPI_CSI2RX_Type *)DT_INST_REG_ADDR(n), \
207-
.sensor_dev = DEVICE_DT_GET(DT_INST_PHANDLE(n, sensor)), \
212+
.sensor_dev = DEVICE_DT_INST_GET_SENSOR_DEV(n), \
208213
}; \
209214
\
210215
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)