mbox series

[RESEND,0/4] media: i2c: imx214: Add support for 23.88MHz clock

Message ID 20250308-imx214_clk_freq-v1-0-467a4c083c35@apitzsch.eu
Headers show
Series media: i2c: imx214: Add support for 23.88MHz clock | expand

Message

André Apitzsch via B4 Relay March 8, 2025, 9:47 p.m. UTC
The imx214 driver currently supports only a 24MHz external clock. But
there are devices, like Qualcomm-MSM8916-based phones, which cannot
provide this frequency. To make the sensor usable by those devices, add
support for 23.88MHz clock.

Signed-off-by: André Apitzsch <git@apitzsch.eu>
---
André Apitzsch (4):
      media: i2c: imx214: Calculate link bit rate from clock frequency
      media: i2c: imx214: Prepare for variable clock frequency
      media: i2c: imx214: Read clock frequency from device tree
      media: i2c: imx214: Add support for 23.88MHz clock

 drivers/media/i2c/imx214.c | 188 +++++++++++++++++++++++++++++++++++----------
 1 file changed, 146 insertions(+), 42 deletions(-)
---
base-commit: 942a51cca29ed20f23ba37f34ff52a6af32ab6c4
change-id: 20250205-imx214_clk_freq-3bf6a05de35a

Best regards,

Comments

André Apitzsch March 10, 2025, 10:35 p.m. UTC | #1
Hi Sakari,

Am Montag, dem 10.03.2025 um 11:11 +0000 schrieb Sakari Ailus:
> Hi André,
> 
> On Sat, Mar 08, 2025 at 10:47:54PM +0100, André Apitzsch via B4 Relay
> wrote:
> > The imx214 driver currently supports only a 24MHz external clock.
> > But
> > there are devices, like Qualcomm-MSM8916-based phones, which cannot
> > provide this frequency. To make the sensor usable by those devices,
> > add
> > support for 23.88MHz clock.
> > 
> > Signed-off-by: André Apitzsch <git@apitzsch.eu>
> > ---
> > André Apitzsch (4):
> >       media: i2c: imx214: Calculate link bit rate from clock
> > frequency
> >       media: i2c: imx214: Prepare for variable clock frequency
> >       media: i2c: imx214: Read clock frequency from device tree
> >       media: i2c: imx214: Add support for 23.88MHz clock
> > 
> >  drivers/media/i2c/imx214.c | 188
> > +++++++++++++++++++++++++++++++++++----------
> >  1 file changed, 146 insertions(+), 42 deletions(-)
> 
> Thanks for the patches.
> 
> Do you think the driver could use the CCS PLL calculator? The PLL
> appears to be compliant. The AR0234 driver will do the same. (The
> sensor might just work with the CCS driver, too, but that's another
> discussion.)
> 
Using the CCS PLL calculator seems quite complicated compared to
switching to the CCS driver. That's why I looked at the later first.
But for it to work, quirks already need to be applied in
ccs_power_on(), to disable writing to COMPRESSION_MODE, and in
ccs_identify_module(), to change the MODULE_MANUFACTURER_ID register.

I'll check if CCS PLL calculator could be used.

Best regards,
André