Patch "media: imx258: Limit the max analogue gain to 480" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: imx258: Limit the max analogue gain to 480

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-imx258-limit-the-max-analogue-gain-to-480.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit dff46ae68d5883194686ca22b7e1a52a17eb657f
Author: Umang Jain <umang.jain@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 23 13:22:33 2021 +0200

    media: imx258: Limit the max analogue gain to 480
    
    [ Upstream commit f809665ee75fff3f4ea8907f406a66d380aeb184 ]
    
    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@xxxxxxxxxxxxxxxx>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
    Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
    Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
index 68ce63333744..85395813c0f2 100644
--- a/drivers/media/i2c/imx258.c
+++ b/drivers/media/i2c/imx258.c
@@ -46,7 +46,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
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux