Hi, On 05/03/19 19:51, Jacopo Mondi wrote: > Now that the adv748x subdevice supports internal routing, add an > has_route() operation used during media graph traversal. > > Signed-off-by: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx> > --- > drivers/media/i2c/adv748x/adv748x-afe.c | 26 +++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c b/drivers/media/i2c/adv748x/adv748x-afe.c > index 3f770f71413f..39ac55f0adbb 100644 > --- a/drivers/media/i2c/adv748x/adv748x-afe.c > +++ b/drivers/media/i2c/adv748x/adv748x-afe.c > @@ -463,6 +463,30 @@ static const struct v4l2_subdev_ops adv748x_afe_ops = { > .pad = &adv748x_afe_pad_ops, > }; > > +/* ----------------------------------------------------------------------------- > + * media_entity_operations > + */ > + > +static bool adv748x_afe_has_route(struct media_entity *entity, > + unsigned int pad0, unsigned int pad1) > +{ > + struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); > + struct adv748x_afe *afe = adv748x_sd_to_afe(sd); > + > + /* Only consider direct sink->source routes. */ > + if (pad0 > ADV748X_AFE_SINK_AIN7 || > + pad1 != ADV748X_AFE_SOURCE) > + return false; > + > + if (pad0 != afe->input) > + return false; > + > + return true; > +} > + > +static const struct media_entity_operations adv748x_afe_entity_ops = { > + .has_route = adv748x_afe_has_route, > +}; Missing empty line. > /* ----------------------------------------------------------------------------- > * Controls > */ -- Luca