On 15/09/2022 23:03, Dave Stevenson wrote:
Hi Bryan
On Thu, 15 Sept 2022 at 01:36, Bryan O'Donoghue
<bryan.odonoghue@xxxxxxxxxx> wrote:
The Sony imx477 uses the same silicon enabling reference code from Sony in
the available examples provided.
Have you had any conversations with Sony on whether the same register
settings are genuinely valid for all of these sensors?
There's alot to unpack here but... this shows me the main thing
https://github.com/raspberrypi/linux/blob/rpi-5.15.y/drivers/media/i2c/imx477.c#L37
The vendor driver reference code I have expects 0x0577. I've discussed
with Daniele previously - that imx412 and imx577 both return 0x0577 in
the chip id field and this imx412.c driver won't work with any chip
reporting anything else.
Your chip though is returning 0x0477 so it will need to have its own
upstream driver anyway.
So the conclusion I drew from the Nvidia/Leopard stack is wrong they
call the driver imx477 but pointedly and suspiciously comment out the
check for chip id.
And its pretty clear why, its so the "imx477" driver they have with work
with chips identifying as 0x0577 and 0x0477.
IMX477 is the sensor in the Raspberry Pi HQ camera, but the register
set that we have from Sony has many undocumented (to us at least)
registers for image quality tuning that aren't in the imx412 driver -
we're up at 417 registers vs imx412's 231 [1].
Raspberry Pi has previously had discussions with Sony regarding IMX378
vs IMX477, which is also in the same family. Whilst nearly identical
in register setup, they gave us 3 additional registers that have to be
set for IMX378 to avoid image quality issues. I wouldn't be surprised
if something similar weren't true for IMX412 and IMX577.
I'm not saying it's impossible to remove a load of duplicated register
settings by combining these sensors into one driver, but this current
patch looks a little simplistic, and probably needs to be looking to
have a struct for sensor specific registers, not just changing the
compatible string and advertised name. Or perhaps we extend that later
once the compatible string has been added?
Merging them does bring issues with regard to testing as it is
unlikely to be practical to test any new features across all variants.
No so you're right the init sequence for imx477 is different or
different enough that Sony spun new silicon for it so you can tweak it.
So, I'll drop the imx477 for V3, thanks for catching this and FWIW I
will take your suggestion will reach out to my board vendor and see if I
can convince them to share documentation with me or put me in contact
with a Sony person who is authorised to do so.
We should get a definitive answer on imx412 (v) imx577 - is it different
silicon or is it a packaging / optics filter level difference ?
---
bod