mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 14:42:34 -04:00
media: hi556: Return -EPROBE_DEFER if no endpoint is found
With ipu bridge, endpoints may only be created when ipu bridge has initialised. This may happen after the sensor driver has first probed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
bcbafe5a05
commit
7d968b5bad
@@ -1206,8 +1206,18 @@ static int hi556_check_hwcfg(struct device *dev)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
if (!fwnode)
|
/*
|
||||||
return -ENXIO;
|
* Sometimes the fwnode graph is initialized by the bridge driver,
|
||||||
|
* wait for this.
|
||||||
|
*/
|
||||||
|
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
|
||||||
|
if (!ep)
|
||||||
|
return -EPROBE_DEFER;
|
||||||
|
|
||||||
|
ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
|
||||||
|
fwnode_handle_put(ep);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
|
ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -1220,15 +1230,6 @@ static int hi556_check_hwcfg(struct device *dev)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
|
|
||||||
if (!ep)
|
|
||||||
return -ENXIO;
|
|
||||||
|
|
||||||
ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
|
|
||||||
fwnode_handle_put(ep);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (bus_cfg.bus.mipi_csi2.num_data_lanes != 2) {
|
if (bus_cfg.bus.mipi_csi2.num_data_lanes != 2) {
|
||||||
dev_err(dev, "number of CSI2 data lanes %d is not supported",
|
dev_err(dev, "number of CSI2 data lanes %d is not supported",
|
||||||
bus_cfg.bus.mipi_csi2.num_data_lanes);
|
bus_cfg.bus.mipi_csi2.num_data_lanes);
|
||||||
|
|||||||
Reference in New Issue
Block a user