Skip to contentSkip to conversation

misc improvment for j721e csi2rx

PATCH Superseded Julien Massot 2 participants 8 messages Dec 8, 2023 – Dec 12, 2023

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover misc improvment for j721e csi2rx

This small series:
- Fix media link issue when the remote subdevice has multiple output ports
- add support for Grey format patch 2 and 3

Julien Massot (3):
media: cadence: csi2rx: use match fwnode for media link
media: cadence: csi2rx: add Y8_1X8 format
media: ti: j721e-csi2rx: add GREY format

 drivers/media/platform/cadence/cdns-csi2rx.c          | 3 ++-
 drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/3 media: cadence: csi2rx: use match fwnode for media link

On some subdev the fwnode is the device node and not the endpoint node. Using the subdev fwnode doesn't allow to fetch the subdev pad we are connected to when the remote subdev has multiple output pads.

---
 drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/cadence/cdns-csi2rx.c +1 -1
index b751227fc8a0..b9356cc7a192 100644
@@ -464,7 +464,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
 	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
 
 	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
-							 s_subdev->fwnode,
+							 asd->match.fwnode,
 							 MEDIA_PAD_FL_SOURCE);
 	if (csi2rx->source_pad < 0) {
 		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",
Signature · 1 line
2.43.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] media: cadence: csi2rx: use match fwnode for media link

Hi Julien,

Thanks for the patch.

Please make sure to add the media maintainers in To/Cc, you can use get_maintainers.pl script for the full list.

Quoted 15 lines · Julien Massot

On some subdev the fwnode is the device node and not the endpoint node. Using the subdev fwnode doesn't allow to fetch the subdev pad we are connected to when the remote subdev has multiple output pads.

---
 drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/cadence/cdns-csi2rx.c +0 -0
index b751227fc8a0..b9356cc7a192 100644

drivers/media/platform/cadence/cdns-csi2rx.c static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, · line 468

Quoted 6 lines
drivers/media/platform/cadence/cdns-csi2rx.c +1 -1
@@ -464,7 +464,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
 	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
 
 	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
-							 s_subdev->fwnode,
+							 asd->match.fwnode,
 							 MEDIA_PAD_FL_SOURCE);

LGTM, this also fixes a similar issue I was seeing with getting fwnode pad ds90ub960 source which has multiple output pads.

Quoted 5 lines
drivers/media/platform/cadence/cdns-csi2rx.c +0 -0
 	if (csi2rx->source_pad < 0) {
 		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",
Signature · 1 line
2.43.0
Signature · 4 lines
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
#3 lore raw

Re: [PATCH 1/3] media: cadence: csi2rx: use match fwnode for media link

Quoted 33 lines · Jai Luthra

Hi Julien,

Thanks for the patch.

Please make sure to add the media maintainers in To/Cc, you can use get_maintainers.pl script for the full list.

Quoted 15 lines · Julien Massot

On some subdev the fwnode is the device node and not the endpoint node. Using the subdev fwnode doesn't allow to fetch the subdev pad we are connected to when the remote subdev has multiple output pads.

---
 drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/cadence/cdns-csi2rx.c +0 -0
index b751227fc8a0..b9356cc7a192 100644

drivers/media/platform/cadence/cdns-csi2rx.c static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, · line 468

Quoted 6 lines
drivers/media/platform/cadence/cdns-csi2rx.c +1 -1
@@ -464,7 +464,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
 	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
 
 	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
-							 s_subdev->fwnode,
+							 asd->match.fwnode,
 							 MEDIA_PAD_FL_SOURCE);

LGTM, this also fixes a similar issue I was seeing with getting fwnode pad ds90ub960 source which has multiple output pads.

Quoted 1 line

This should probably carry a fixes tag as well:

Fixes 1fc3b37f34f69 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver")
Quoted 12 lines
Quoted 6 lines
drivers/media/platform/cadence/cdns-csi2rx.c +0 -0
 	if (csi2rx->source_pad < 0) {
 		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",
Signature · 1 line
2.43.0
Signature · 4 lines
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
Signature · 4 lines
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
#4 lore raw

PATCH 2/3 media: cadence: csi2rx: add Y8_1X8 format

In reply to Julien Massot

Add support for MEDIA_BUS_FMT_Y8_1X8 format.

---
 drivers/media/platform/cadence/cdns-csi2rx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/cadence/cdns-csi2rx.c +1 -0
index b9356cc7a192..d24880e27607 100644
@@ -114,6 +114,7 @@ static const struct csi2rx_fmt formats[] = {
 	{ .code	= MEDIA_BUS_FMT_SGBRG8_1X8, .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SGRBG8_1X8, .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SRGGB8_1X8, .bpp = 8, },
+	{ .code	= MEDIA_BUS_FMT_Y8_1X8,     .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SBGGR10_1X10, .bpp = 10, },
 	{ .code	= MEDIA_BUS_FMT_SGBRG10_1X10, .bpp = 10, },
 	{ .code	= MEDIA_BUS_FMT_SGRBG10_1X10, .bpp = 10, },
Signature · 1 line
2.43.0
Acked-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] media: cadence: csi2rx: add Y8_1X8 format

Quoted 22 lines · Julien Massot

Add support for MEDIA_BUS_FMT_Y8_1X8 format.

---
 drivers/media/platform/cadence/cdns-csi2rx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/cadence/cdns-csi2rx.c +1 -0
index b9356cc7a192..d24880e27607 100644
@@ -114,6 +114,7 @@ static const struct csi2rx_fmt formats[] = {
 	{ .code	= MEDIA_BUS_FMT_SGBRG8_1X8, .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SGRBG8_1X8, .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SRGGB8_1X8, .bpp = 8, },
+	{ .code	= MEDIA_BUS_FMT_Y8_1X8,     .bpp = 8, },
 	{ .code	= MEDIA_BUS_FMT_SBGGR10_1X10, .bpp = 10, },
 	{ .code	= MEDIA_BUS_FMT_SGBRG10_1X10, .bpp = 10, },
 	{ .code	= MEDIA_BUS_FMT_SGRBG10_1X10, .bpp = 10, },
Signature · 1 line
2.43.0
Signature · 4 lines
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
#6 lore raw

PATCH 3/3 media: ti: j721e-csi2rx: add GREY format

In reply to Julien Massot

Add Grey format to properly select RAW8 data type.

Tested with a ST VG5661 sensor.

---
 drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +6 -0
index ada61391c8d2..46d37401512b 100644
@@ -158,6 +158,12 @@ static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = {
 		.csi_dt			= MIPI_CSI2_DT_RAW8,
 		.bpp			= 8,
 		.size			= SHIM_DMACNTX_SIZE_8,
+	}, {
+		.fourcc			= V4L2_PIX_FMT_GREY,
+		.code			= MEDIA_BUS_FMT_Y8_1X8,
+		.csi_dt			= MIPI_CSI2_DT_RAW8,
+		.bpp			= 8,
+		.size			= SHIM_DMACNTX_SIZE_8,
 	}, {
 		.fourcc			= V4L2_PIX_FMT_SBGGR10,
 		.code			= MEDIA_BUS_FMT_SBGGR10_1X10,
Signature · 1 line
2.43.0
Acked-by on v1 3/3
#7 lore raw

Re: [PATCH 3/3] media: ti: j721e-csi2rx: add GREY format

Quoted 29 lines · Julien Massot

Add Grey format to properly select RAW8 data type.

Tested with a ST VG5661 sensor.

---
 drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +6 -0
index ada61391c8d2..46d37401512b 100644
@@ -158,6 +158,12 @@ static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = {
 		.csi_dt			= MIPI_CSI2_DT_RAW8,
 		.bpp			= 8,
 		.size			= SHIM_DMACNTX_SIZE_8,
+	}, {
+		.fourcc			= V4L2_PIX_FMT_GREY,
+		.code			= MEDIA_BUS_FMT_Y8_1X8,
+		.csi_dt			= MIPI_CSI2_DT_RAW8,
+		.bpp			= 8,
+		.size			= SHIM_DMACNTX_SIZE_8,
 	}, {
 		.fourcc			= V4L2_PIX_FMT_SBGGR10,
 		.code			= MEDIA_BUS_FMT_SBGGR10_1X10,
Signature · 1 line
2.43.0
Signature · 4 lines
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145