diff mbox series

[3/3] media: i2c: isl7998x: Implement get_mbus_config

Message ID 20240713154242.107903-3-marex@denx.de (mailing list archive)
State New
Headers show
Series [1/3] media: i2c: isl7998x: Enable VACTIVE and HDELAY shadow registers | expand

Commit Message

Marek Vasut July 13, 2024, 3:41 p.m. UTC
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@denx.de>
---
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: linux-media@vger.kernel.org
---
 drivers/media/i2c/isl7998x.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Francesco Dolcini July 14, 2024, 2:33 p.m. UTC | #1
Hello Marek,

On Sat, Jul 13, 2024 at 05:41:56PM +0200, Marek Vasut wrote:
> 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@denx.de>

We had a similar need and we did send a similar patch for ov5640 [1],
however it was rejected. I did not follow-up if anything changed that
makes this patch not required, or maybe I am misunderstanding all of it?
Any comment?

Francesco

[1] https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/
Marek Vasut July 14, 2024, 3:37 p.m. UTC | #2
On 7/14/24 4:33 PM, Francesco Dolcini wrote:
> Hello Marek,

Hi,

> On Sat, Jul 13, 2024 at 05:41:56PM +0200, Marek Vasut wrote:
>> 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@denx.de>
> 
> We had a similar need and we did send a similar patch for ov5640 [1],
> however it was rejected. I did not follow-up if anything changed that
> makes this patch not required, or maybe I am misunderstanding all of it?
> Any comment?

I am not sure what to make of that discussion, there was a lot of 
discussion, but no conclusion or hint how to move forward . So, what now?

> Francesco
> 
> [1] https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/
Francesco Dolcini July 14, 2024, 8:36 p.m. UTC | #3
On Sun, Jul 14, 2024 at 05:37:10PM +0200, Marek Vasut wrote:
> On 7/14/24 4:33 PM, Francesco Dolcini wrote:
> > On Sat, Jul 13, 2024 at 05:41:56PM +0200, Marek Vasut wrote:
> > > 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@denx.de>
> > 
> > We had a similar need and we did send a similar patch for ov5640 [1],
> > however it was rejected. I did not follow-up if anything changed that
> > makes this patch not required, or maybe I am misunderstanding all of it?
> > Any comment?
> 
> I am not sure what to make of that discussion, there was a lot of
> discussion, but no conclusion or hint how to move forward . So, what now?

That discusion was very confusing to me, but given I know little on the
topic I was hoping you could understand better than me ... 

BTW, I am not even sure this patch is about the same issue.

Francesco
diff mbox series

Patch

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 = {