]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
media: soc_camera: ov772x: correct setting of banding filter
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 10 Jun 2018 15:42:26 +0000 (11:42 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:56 +0000 (19:50 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 22216ec41e919682c15345e95928f266e8ba6f9e ]

The banding filter ON/OFF is controlled via bit 5 of COM8 register.  It
is attempted to be enabled in ov772x_set_params() by the following line.

ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, 1);

But this unexpectedly results disabling the banding filter, because the
mask and set bits are exclusive.

On the other hand, ov772x_s_ctrl() correctly sets the bit by:

ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, BNDF_ON_OFF);

The same fix was already applied to non-soc_camera version of ov772x
driver in the commit commit a024ee14cd36 ("media: ov772x: correct setting
of banding filter")

Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/i2c/soc_camera/ov772x.c

index 806383500313e029bcf9bbb14cdbac0f55fcefff..14377af7c888898b2c19e969c2475fe558ebdac3 100644 (file)
@@ -834,7 +834,7 @@ static int ov772x_set_params(struct ov772x_priv *priv,
         * set COM8
         */
        if (priv->band_filter) {
-               ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, 1);
+               ret = ov772x_mask_set(client, COM8, BNDF_ON_OFF, BNDF_ON_OFF);
                if (!ret)
                        ret = ov772x_mask_set(client, BDBASE,
                                              0xff, 256 - priv->band_filter);