This is used e.g. by imx6-mipi-csi2.c to determine the CSI2 lane count. Implement the callback in isl7998x driver so it can be used with i.MX6 CSI2 receiver. Signed-off-by: Marek Vasut <marex@xxxxxxx> --- Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> Cc: Michael Tretter <m.tretter@xxxxxxxxxxxxxx> Cc: Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx> Cc: linux-media@xxxxxxxxxxxxxxx --- drivers/media/i2c/isl7998x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c index 7d2799e498520..560f4845b5e62 100644 --- a/drivers/media/i2c/isl7998x.c +++ b/drivers/media/i2c/isl7998x.c @@ -1045,6 +1045,17 @@ static int isl7998x_set_fmt(struct v4l2_subdev *sd, return 0; } +static int isl7998x_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_mbus_config *cfg) +{ + struct isl7998x *isl7998x = sd_to_isl7998x(sd); + + cfg->type = V4L2_MBUS_CSI2_DPHY; + cfg->bus.mipi_csi2.num_data_lanes = isl7998x->nr_mipi_lanes; + + return 0; +} + static int isl7998x_set_ctrl(struct v4l2_ctrl *ctrl) { struct isl7998x *isl7998x = container_of(ctrl->handler, @@ -1104,6 +1115,7 @@ static const struct v4l2_subdev_pad_ops isl7998x_subdev_pad_ops = { .enum_frame_size = isl7998x_enum_frame_size, .get_fmt = isl7998x_get_fmt, .set_fmt = isl7998x_set_fmt, + .get_mbus_config = isl7998x_get_mbus_config, }; static const struct v4l2_subdev_ops isl7998x_subdev_ops = { -- 2.43.0