How to set V4L2_CID_LINK_FREQ and V4L2_CID_PIXEL_RATE?

Hi. The camera drivers require V4L2_CID_LINK_FREQ and V4L2_CID_PIXEL_RATE. How do I know what to set these values to in the driver? It seems that the V4L2_CID_PIXEL_RATE is based on the V4L2_CID_LINK_FREQ per this: https://linuxtv.org/downloads/v4l-dvb-apis/kapi/csi2.html but I’m not sure. How can I these correctly?

Thanks,
Kim

This is the number of pixel you transfer by second, camss driver uses it to adjust its CSI bus clock internally. It usually something like pixel_rate = pixel_width * pixel_height * framerate.

Hi Loic,
That makes sense, but that’s not what I see in mipi camera drivers. For instance, one driver that works, has a width of 1920 and height of 1080. Frame rate is 30. The PIXEL_RATE is set to 167160000. And this driver works.
There is a driver here: ov7251.c « i2c « media « drivers - working/qualcomm/kernel.git - Qualcomm Landing Team kernel
which shows the V4L2_CID_PIXEL_RATE set to 48MHz for three different frame rates of the same size. I have not tried that driver, but why is the pixel rate the same?
Thanks,
Kim