Re: [PATCH v5 3/3] media: i2c: imx471: Add Sony IMX471 image sensor driver
From: Tarang Raval
Date: Wed Jun 24 2026 - 10:09:50 EST
Hi Kieran,
> Quoting Kate Hsuan (2026-06-24 04:35:08)
> > Add a new driver for Sony imx471 camera sensor. It is based on
> > Jimmy Su <jimmy.su@xxxxxxxxx> implementation and the driver can be found
> > in the following URL.
> > https://github.com/intel/ipu6-drivers/commits/master/drivers/media/i2c/imx471.c
> >
> > This sensor can be found on Lenovo X1 Carbon G14, X9-14 and X9-15 laptops
> > and it is a part of IPU7 solution. The driver was tested on Lenovo X1
> > Carbon G14, X9-14 and X9-15 laptops.
> >
> > Signed-off-by: Kate Hsuan <hpa@xxxxxxxxxx>
> > ---
>
> ... <snip>
>
> > +#define IMX471_REG_EXCK_FREQ CCI_REG16(0x0136)
> > +#define IMX471_EXCK_FREQ(n) ((n) * 256) /* n in MHz */
> >
>
> <snip>
>
> > +
> > +static const struct cci_reg_sequence imx471_global_regs[] = {
> > + { IMX471_REG_EXCK_FREQ, IMX471_EXCK_FREQ(19.2) },
>
>
> Does this work? Is this a compile time constant multiplying floating
> point with the compiler, or something happening in the kernel?
>
> I'll be happy if it does, but it catches my attention as something I
> thought we couldn't do.
I tested this with GCC. It evaluates the expression at compile time and
folds it into the integer constant 4915. The generated assembly/object
file contains .quad 4915 in the initialized data and no floating-point
instructions are emitted, so the kernel only ever sees the integer value.
Best Regards,
Tarang