Hi Sakari, On Wed, Oct 12, 2022 at 10:02:00PM +0300, Sakari Ailus wrote: > On Fri, Oct 07, 2022 at 04:56:01PM +0300, Laurent Pinchart wrote: > > On Wed, Oct 05, 2022 at 09:06:07PM +0200, Jacopo Mondi wrote: > > > Rework the PLL computation procedure to take into account the currently > > > configured format bpp and the number of data lanes. > > > > > > Comment the PLL configuration procedure with information provided by the > > > sensor chip manual and remove the hardcoded divider from the pixel clock > > > calculation. > > > > > > The PLL configuration procedure has been verified by forcing a pixel > > > rate of 414 MHz and verify that the effective output pixel rate matches > > > the expected 60 frames per second. > > > > This is the kind of code that would benefit from testing with kunit. > > > > > Do not modify the default pixel rate for the moment as it will be made > > > configurable through V4L2_CID_LINK_FREQ in subsequent patches. > > > > > > Signed-off-by: Jacopo Mondi <jacopo@xxxxxxxxxx> > > > > I think we should extract the PLL calculation code from the CCS driver > > into a library. Sakari ? :-) > > It already is a module. I think there is another driver using it, written > by you. :-) Oh indeed. I wonder how I missed that. > Some PLLs are as in CCS but there are different ones, too, especially in > Omnivision sensors. Sometimes CCS PLL calculator can be used on non-CCS sensors > by fixing one of the multipliers or divisors to 1. I think the AR0521 PLL could match, but I also think there are some mistakes in the documentation, so this would need to be checked. -- Regards, Laurent Pinchart