Commit 7ab94843 authored by Sakari Ailus's avatar Sakari Ailus Committed by Hans Verkuil

media: pci: ipu3-cio2: Obtain remote pad from endpoint

Use the endpoint fwnode to find out the remote pad, instead of using the
first source pad found. Also improve error messages.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarBingbu Cao <bingbu.cao@intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent ec178312
...@@ -1417,31 +1417,27 @@ static int cio2_notifier_complete(struct v4l2_async_notifier *notifier) ...@@ -1417,31 +1417,27 @@ static int cio2_notifier_complete(struct v4l2_async_notifier *notifier)
struct sensor_async_subdev *s_asd; struct sensor_async_subdev *s_asd;
struct v4l2_async_subdev *asd; struct v4l2_async_subdev *asd;
struct cio2_queue *q; struct cio2_queue *q;
unsigned int pad;
int ret; int ret;
list_for_each_entry(asd, &cio2->notifier.asd_list, asd_list) { list_for_each_entry(asd, &cio2->notifier.asd_list, asd_list) {
s_asd = to_sensor_asd(asd); s_asd = to_sensor_asd(asd);
q = &cio2->queue[s_asd->csi2.port]; q = &cio2->queue[s_asd->csi2.port];
for (pad = 0; pad < q->sensor->entity.num_pads; pad++) ret = media_entity_get_fwnode_pad(&q->sensor->entity,
if (q->sensor->entity.pads[pad].flags & s_asd->asd.match.fwnode,
MEDIA_PAD_FL_SOURCE) MEDIA_PAD_FL_SOURCE);
break; if (ret < 0) {
dev_err(dev, "no pad for endpoint %pfw (%d)\n",
if (pad == q->sensor->entity.num_pads) { s_asd->asd.match.fwnode, ret);
dev_err(dev, "failed to find src pad for %s\n", return ret;
q->sensor->name);
return -ENXIO;
} }
ret = media_create_pad_link( ret = media_create_pad_link(&q->sensor->entity, ret,
&q->sensor->entity, pad, &q->subdev.entity, CIO2_PAD_SINK,
&q->subdev.entity, CIO2_PAD_SINK, 0);
0);
if (ret) { if (ret) {
dev_err(dev, "failed to create link for %s\n", dev_err(dev, "failed to create link for %s (endpoint %pfw, error %d)\n",
q->sensor->name); q->sensor->name, s_asd->asd.match.fwnode, ret);
return ret; return ret;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment