On Tue, 4 Jul 2023 at 11:28, Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx> wrote: > > Hi Dave > > On Tue, Jul 04, 2023 at 11:05:42AM +0100, Dave Stevenson wrote: > > Hi Jacopo > > > > On Mon, 3 Jul 2023 at 21:29, Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx> wrote: > > > > > > Document the suggested way to exposure controls for exposure and gain > > > for camera sensor drivers. > > > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx> > > > --- > > > .../driver-api/media/camera-sensor.rst | 19 +++++++++++++++++++ > > > 1 file changed, 19 insertions(+) > > > > > > diff --git a/Documentation/driver-api/media/camera-sensor.rst b/Documentation/driver-api/media/camera-sensor.rst > > > index ee4a7fe5f72a..dfe8f35aecea 100644 > > > --- a/Documentation/driver-api/media/camera-sensor.rst > > > +++ b/Documentation/driver-api/media/camera-sensor.rst > > > @@ -189,3 +189,22 @@ the ``V4L2_CID_VFLIP`` and ``V4L2_CID_HFLIP`` controls with the > > > a flip can potentially change the output buffer content layout. Flips should > > > also be taken into account when enumerating and handling media bus formats > > > on the camera sensor source pads. > > > + > > > +Exposure and Gain Control > > > +------------------------- > > > + > > > +Camera sensor drivers that allows applications to control the image exposure > > > > s/allows/allow > > > > > +and gain should do so by exposing dedicated controls to applications. > > > + > > > +Exposure time is controlled by registering the ``V4L2_CID_EXPOSURE`` control. > > > +The control definition does not specify a unit to allow maximum flexibility > > > +for multiple device types, but when used for camera sensor driver it should be > > > > s/driver/drivers > > > > > +expressed in unit of lines whenever possible. > > > > s/unit/units > > > > Possibly clarify that lines can be converted into units of time by > > using V4L2_CID_PIXEL_RATE and (image width + V4L2_CID_HBLANK). > > > > I think this might be useful yes. A few paragraph above the frame > duration calculation formula is expressed as well, so I guess adding > one for this is helpful too Possibly just reference that paragraph then for computing the line period then. > > > + > > > +Camera sensor driver should try whenever possible to distinguish between the > > > +analogue and digital gain control functions. Analogue gain is a multiplier > > > +factor applied to all color channels on the pixel array before they get > > > +converted in the digital domain. It should be be made controllable by > > > +registering the ``V4L2_CID_ANALOGUE_GAIN`` control, expressed as a device > > > +specific gain code. Digital gain control is optional and should be exposed to > > > +applications by registering ``V4L2_CID_DIGITAL_GAIN``. Camera sensor drivers are > > > > Something appears to be truncated here. > > Clearly a bad rebase. What I meant (I lost the original version) was > > Camera sensor drivers are discouraged from using ``V4L2_CID_GAIN`` > which doesn't allow to control the analogue and digital gain as it doesn't allow differentiation of analogue vs digital gain > components individually. > > How does this sound ? Otherwise it sounds fine. Dave