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 <phibang.nguyen@nxp.com>
This commit is contained in:
parent
901f022cdb
commit
f82b0d5681
4 changed files with 6 additions and 10 deletions
|
@ -34,8 +34,6 @@
|
||||||
&nxp_mipi_csi {
|
&nxp_mipi_csi {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
|
|
||||||
sensor = <&ov5640>;
|
|
||||||
|
|
||||||
ports {
|
ports {
|
||||||
port@1 {
|
port@1 {
|
||||||
reg = <1>;
|
reg = <1>;
|
||||||
|
|
|
@ -16,6 +16,11 @@ LOG_MODULE_REGISTER(video_mipi_csi2rx, CONFIG_VIDEO_LOG_LEVEL);
|
||||||
|
|
||||||
#define DEFAULT_CAMERA_FRAME_RATE 30
|
#define DEFAULT_CAMERA_FRAME_RATE 30
|
||||||
|
|
||||||
|
#define DEVICE_DT_INST_GET_SENSOR_DEV(n) \
|
||||||
|
DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL( \
|
||||||
|
DT_STRING_TOKEN(DT_CHILD(DT_CHILD(DT_INST_CHILD(n, ports), port_1), endpoint), \
|
||||||
|
remote_endpoint_label))))
|
||||||
|
|
||||||
struct mipi_csi2rx_config {
|
struct mipi_csi2rx_config {
|
||||||
const MIPI_CSI2RX_Type *base;
|
const MIPI_CSI2RX_Type *base;
|
||||||
const struct device *sensor_dev;
|
const struct device *sensor_dev;
|
||||||
|
@ -204,7 +209,7 @@ static int mipi_csi2rx_init(const struct device *dev)
|
||||||
\
|
\
|
||||||
static const struct mipi_csi2rx_config mipi_csi2rx_config_##n = { \
|
static const struct mipi_csi2rx_config mipi_csi2rx_config_##n = { \
|
||||||
.base = (MIPI_CSI2RX_Type *)DT_INST_REG_ADDR(n), \
|
.base = (MIPI_CSI2RX_Type *)DT_INST_REG_ADDR(n), \
|
||||||
.sensor_dev = DEVICE_DT_GET(DT_INST_PHANDLE(n, sensor)), \
|
.sensor_dev = DEVICE_DT_INST_GET_SENSOR_DEV(n), \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
DEVICE_DT_INST_DEFINE(n, &mipi_csi2rx_init, NULL, &mipi_csi2rx_data_##n, \
|
DEVICE_DT_INST_DEFINE(n, &mipi_csi2rx_init, NULL, &mipi_csi2rx_data_##n, \
|
||||||
|
|
|
@ -10,12 +10,6 @@ compatible: "nxp,mipi-csi2rx"
|
||||||
|
|
||||||
include: [base.yaml]
|
include: [base.yaml]
|
||||||
|
|
||||||
properties:
|
|
||||||
sensor:
|
|
||||||
required: true
|
|
||||||
type: phandle
|
|
||||||
description: the connected camera sensor
|
|
||||||
|
|
||||||
child-binding:
|
child-binding:
|
||||||
child-binding:
|
child-binding:
|
||||||
child-binding:
|
child-binding:
|
||||||
|
|
|
@ -60,7 +60,6 @@
|
||||||
compatible = "nxp,mipi-csi2rx";
|
compatible = "nxp,mipi-csi2rx";
|
||||||
reg = <0x33334444 0x200>;
|
reg = <0x33334444 0x200>;
|
||||||
status = "okay";
|
status = "okay";
|
||||||
sensor = <&test_i2c_ov5640>;
|
|
||||||
|
|
||||||
ports {
|
ports {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue