linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Umang Jain <umang.jain@ideasonboard.com>
Cc: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bingbu Cao <bingbu.cao@intel.com>
Subject: Re: [libcamera-devel] [PATCH 2/2] media: imx258: Limit the max analogue gain to 480
Date: Fri, 23 Jul 2021 14:52:06 +0300	[thread overview]
Message-ID: <YPqtZl6deaxQGYhZ@pendragon.ideasonboard.com> (raw)
In-Reply-To: <YPqrp7BKNhzKN8xa@pendragon.ideasonboard.com>

On Fri, Jul 23, 2021 at 02:44:40PM +0300, Laurent Pinchart wrote:
> Hi Umang,
> 
> Thank you for the patch.
> 
> CC'ing Sakari. For future kernel patches, you can use the
> ./scripts/get_maintainer.pl script in the kernel sources to get a list
> of appropriate recipients. The list should be taken with a grain of salt
> though, it has a tendency to return too many recipients. For this
> particular patch, for instance, it also recommends Mauro and LKML.
> Whether to CC the subsystem maintainer on every patch depends on the
> subsystem (it's more common for small ones than big ones) and on the
> maintainer's preferences. LKML is a catch-all mailing list with very
> high traffic, and when more appropriate venues exist for patches, I
> usually recommend skipping LKML.

And expanding the CC list further to include Dave (for his contribution
to the discussion), and Krzysztof and Bingbu (for their contributions to
the driver, as reported by git log).

> On Fri, Jul 23, 2021 at 04:52:33PM +0530, Umang Jain wrote:
> > The range for analog gain mentioned in the datasheet is [0, 480].
> > The real gain formula mentioned in the datasheet is:
> > 
> > 	Gain = 512 / (512 – X)
> > 
> > Hence, values larger than 511 clearly makes no sense. The gain
> > register field is also documented to be of 9-bits in the datasheet.
> > 
> > Certainly, it is enough to infer that, the kernel driver currently
> > advertises an arbitrary analog gain max. Fix it by rectifying the
> > value as per the data sheet i.e. 480.
> > 
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/i2c/imx258.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
> > index 4e695096e5d0..81cdf37216ca 100644
> > --- a/drivers/media/i2c/imx258.c
> > +++ b/drivers/media/i2c/imx258.c
> > @@ -47,7 +47,7 @@
> >  /* Analog gain control */
> >  #define IMX258_REG_ANALOG_GAIN		0x0204
> >  #define IMX258_ANA_GAIN_MIN		0
> > -#define IMX258_ANA_GAIN_MAX		0x1fff
> > +#define IMX258_ANA_GAIN_MAX		480
> >  #define IMX258_ANA_GAIN_STEP		1
> >  #define IMX258_ANA_GAIN_DEFAULT		0x0
> >  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-07-23 11:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 11:22 [PATCH 0/2] IMX258 driver fixes Umang Jain
2021-07-23 11:22 ` [PATCH 1/2] media: imx258: Rectify mismatch of VTS value Umang Jain
2021-07-23 11:50   ` Laurent Pinchart
2021-07-26  2:20     ` Bingbu Cao
2021-07-23 11:22 ` [PATCH 2/2] media: imx258: Limit the max analogue gain to 480 Umang Jain
2021-07-23 11:44   ` [libcamera-devel] " Laurent Pinchart
2021-07-23 11:52     ` Laurent Pinchart [this message]
2021-07-23 12:29       ` Krzysztof Kozlowski
2021-07-23 12:36       ` Dave Stevenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YPqtZl6deaxQGYhZ@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bingbu.cao@intel.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=krzk@kernel.org \
    --cc=libcamera-devel@lists.libcamera.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=umang.jain@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).