Re: [PATCH v3 2/4] media: i2c: Add ST VD55G0 global shutter sensor driver

From: Benjamin Mugnier

Date: Tue Nov 10 2026 - 05:09:51 EST


Hi Sergey,

Le 09/11/2026 à 14:27, Sergey Lebedev a écrit :
> Hi Sakari,
>
> On Mon, Nov 09, 2026 at 02:59:44PM +0200, Sakari Ailus wrote:
>>>>> +static const s64 vd55g0_ev_bias_menu[] = {
>>>>> + -3000, -2500, -2000, -1500, -1000, -500,
>>>>> + 0,
>>>>> + 500, 1000, 1500, 2000, 2500, 3000,
>>>>
>>>> Is this
>>>
>>> The sentence seems to have been cut off here. What did you mean? The
>>> table is vd55g1's, in the control's 0.001 EV units.
>>
>> Uh, yes. I meant to ask if this is a firmware limitation. I guess so?
>
> No, it is the driver's. The firmware has both a target and a
> compensation register (UM2829, 14.7.3, Table 39 [1]):
>
> AE_COMPENSATION VALUE 15:0 SFP 8.8 Compensation in EV
> AE_TARGET_PERCENTAGE VALUE 15:0 UI Percentage relative to saturation
>
> where "100 means saturated image". The driver writes the target from
> this table, 27 * 2^EV, as vd55g1 does:
>
> static const unsigned int index2exposure_target[] = {
> 3, 5, 7, 10, 14, 19, 27, 38, 54, 76, 108, 153, 216,
> };
>
> So +2.5 and +3 EV ask for 153 and 216, above saturation; I have not
> tested what the AE does there.
>
> v4 keeps vd55g1's table, unless you or Benjamin prefer the compensation
> register.

>From a user perspective they are mostly interchangeable. vd55g1 uses
AE_TARGET_PERCENTAGE while vd56g3 uses AE_COMPENSATION for instance.

The downstream driver uses AE_TARGET_PERCENTAGE and that's why you have
it here. It would make more sense to use AE_COMPENSATION semantic wise,
but this is not a deal breaker.

>
> [1] https://www.st.com/resource/en/user_manual/um2829-how-to-integrate-and-configure-the-vd55g0-device-from-a-hardware-and-software-perspective-stmicroelectronics.pdf
>
> Sergey

--
Regards,
Benjamin