Skip to content

Commit 0ad3012

Browse files
committed
Properly get frequency in kernel 6.15 and up
From kernel 6.15+, `v4l2_get_link_freq()` supports a pad-based lookup via `struct media_pad *`. The in-kernel IVSC CSI driver also dropped its `V4L2_CID_LINK_FREQ` control in 6.15, so the old ctrl_handler path returns `-ENOENT`. Use the pad instead. Signed-off-by: Aditya Tewari <adityaatewari@gmail.com>
1 parent cde4eb4 commit 0ad3012

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/media/pci/intel/ipu-isys-csi2.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,17 @@ int ipu_isys_csi2_get_link_freq(struct ipu_isys_csi2 *csi2, s64 *link_freq)
102102
bpp = ipu_isys_mbus_code_to_bpp(csi2->asd.ffmt->code);
103103
lanes = csi2->nlanes;
104104

105-
ret = v4l2_get_link_freq(ext_sd->ctrl_handler, bpp, lanes * 2);
105+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
106+
/*
107+
* From kernel 6.15+, v4l2_get_link_freq() supports a pad-based
108+
* lookup via struct media_pad *. The IVSC CSI driver dropped its
109+
* V4L2_CID_LINK_FREQ control in 6.15, so the old ctrl_handler path
110+
* returns -ENOENT. Use the pad instead.
111+
*/
112+
ret = v4l2_get_link_freq(pipe->external, bpp, lanes * 2);
113+
+#else
114+
ret = v4l2_get_link_freq(ext_sd->ctrl_handler, bpp, lanes * 2);
115+
+#endif
106116
if (ret < 0) {
107117
dev_err(dev, "can't get link frequency (%lld)\n", ret);
108118
return ret;

0 commit comments

Comments
 (0)