From patchwork Thu May 24 15:09:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 10425001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 109266019D for ; Thu, 24 May 2018 15:15:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E421D29605 for ; Thu, 24 May 2018 15:15:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D49FC2967F; Thu, 24 May 2018 15:15:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA90229605 for ; Thu, 24 May 2018 15:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970881AbeEXPO6 (ORCPT ); Thu, 24 May 2018 11:14:58 -0400 Received: from smtp-1b.atlantis.sk ([80.94.52.26]:34303 "EHLO smtp-1b.atlantis.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966195AbeEXPO5 (ORCPT ); Thu, 24 May 2018 11:14:57 -0400 X-Greylist: delayed 321 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 May 2018 11:14:57 EDT Received: from gsql.ggedos.sk (off-7.infotel.telecom.sk [212.5.213.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-1b.atlantis.sk (Postfix) with ESMTPSA id 2CBFF8344A98; Thu, 24 May 2018 17:09:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rainbow-software.org; s=atlsmtp; t=1527174575; bh=IBGWAND07a60h5yVKDkP98t+gxnYAI7HivVZxggp0Mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HB5Erz4apELavZVDkscggwa8ouG+Rdm3jL0YPW9m9w1I0JfNGGgUVMj7GMRD44rn2 hTKJEi+5V/faTCVYee9StN/DiW8uWAgavm3h2dScDnQHKgayRaCAoEZeCoHk+SHK4k eGVpGBtcE6qYcyxKGWCRWkNW5V0ViLrODnLeMNNo= From: Ondrej Zary To: Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] gspca_zc3xx: Fix exposure with power line frequency for OV7648 Date: Thu, 24 May 2018 17:09:31 +0200 Message-Id: <20180524150931.26574-3-linux@rainbow-software.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180524150931.26574-1-linux@rainbow-software.org> References: <20180524150931.26574-1-linux@rainbow-software.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The 50Hz and 60Hz power line frequency settings disable short (1/120s and 1/100s) exposure times for banding filter, causing overexposed image near lamps. No flicker setting enables them (when banding filter is disabled and they're not used). Seems that the logic is just the wrong way around. Fix it. (This bug came from the Windows driver.) Signed-off-by: Ondrej Zary --- drivers/media/usb/gspca/zc3xx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/gspca/zc3xx.c b/drivers/media/usb/gspca/zc3xx.c index 9a78420e8ad8..299ea70bfb67 100644 --- a/drivers/media/usb/gspca/zc3xx.c +++ b/drivers/media/usb/gspca/zc3xx.c @@ -3188,7 +3188,9 @@ static const struct usb_action ov7620_50HZ[] = { * don't change autoexposure */ {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ {0xaa, 0x2b, 0x0096}, /* 00,2b,96,aa */ - {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */ +/* {0xaa, 0x75, 0x008a}, * 00,75,8a,aa */ + /* enable 1/120s & 1/100s exposures for banding filter */ + {0xaa, 0x75, 0x008e}, {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */ @@ -3208,7 +3210,9 @@ static const struct usb_action ov7620_60HZ[] = { * don't change autoexposure */ {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ - {0xaa, 0x75, 0x008a}, /* 00,75,8a,aa */ +/* {0xaa, 0x75, 0x008a}, * 00,75,8a,aa */ + /* enable 1/120s & 1/100s exposures for banding filter */ + {0xaa, 0x75, 0x008e}, {0xaa, 0x2d, 0x0005}, /* 00,2d,05,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */ @@ -3231,7 +3235,9 @@ static const struct usb_action ov7620_NoFliker[] = { * don't change autoexposure */ {0xdd, 0x00, 0x0100}, /* 00,01,00,dd */ {0xaa, 0x2b, 0x0000}, /* 00,2b,00,aa */ - {0xaa, 0x75, 0x008e}, /* 00,75,8e,aa */ +/* {0xaa, 0x75, 0x008e}, * 00,75,8e,aa */ + /* disable 1/120s & 1/100s exposures for banding filter */ + {0xaa, 0x75, 0x008a}, {0xaa, 0x2d, 0x0001}, /* 00,2d,01,aa */ {0xa0, 0x00, ZC3XX_R190_EXPOSURELIMITHIGH}, /* 01,90,00,cc */ {0xa0, 0x04, ZC3XX_R191_EXPOSURELIMITMID}, /* 01,91,04,cc */