From: Sakari Ailus Date: Mon, 16 Apr 2018 20:56:51 +0000 (-0400) Subject: media: smiapp: Query the V4L2 endpoint for a specific bus type X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4a2d1dc51bebeab3543c812c83e031a789e08e65;p=openwrt%2Fstaging%2Fblogic.git media: smiapp: Query the V4L2 endpoint for a specific bus type Instead of opportunistically trying to gather some information from the V4L2 endpoint, set the bus type and let the V4L2 fwnode framework figure out the configuration. Signed-off-by: Sakari Ailus Tested-by: Steve Longerbeam Tested-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 2d6059e3a577..58a45c353e27 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2771,7 +2771,13 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) if (!ep) return NULL; + bus_cfg.bus_type = V4L2_MBUS_CSI2_DPHY; rval = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); + if (rval == -ENXIO) { + bus_cfg = (struct v4l2_fwnode_endpoint) + { .bus_type = V4L2_MBUS_CCP2 }; + rval = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); + } if (rval) goto out_err;