From patchwork Sun May 6 14:19:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10382811 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 D84AA60236 for ; Sun, 6 May 2018 14:19:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6D882892B for ; Sun, 6 May 2018 14:19:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB83D28970; Sun, 6 May 2018 14:19:54 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 5A7632892B for ; Sun, 6 May 2018 14:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751617AbeEFOTx (ORCPT ); Sun, 6 May 2018 10:19:53 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:41107 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbeEFOTv (ORCPT ); Sun, 6 May 2018 10:19:51 -0400 Received: by mail-pf0-f193.google.com with SMTP id v63so20814383pfk.8; Sun, 06 May 2018 07:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zPHI/aCudLBrv8sS+PH8r7jz/uhcmcWEDPOJSbmc9bY=; b=Ct9GZBeJ+OBiWorhECviDa9heG+Rk5gYkxGktN+ccEKUEIwSOK+MrJmTgiUUruez6N O+88FO8KUw+sB0e6jujLVtqjtjgT0vs1vbf/9muepwo5snzty4ZcheBCdgXzoWJoqMkE aBDyfMDZsReyzalcqzfrvko0uZjZu7g7rv9xMfUHShtFwCzMLoZp2OnWOpUuzU87Ol/S is6F4oYadvhjYJ+L6UgLGhdrW+C9/0eMU74uyK4LR24c06DTFuE7NBR1mdLooZ1dH5Lo CbugbhSfyi3W7w7JNXlZRE79ea61NQ8ZdJBMNDgkrsMNf1MSuQVPi/08Au1VUBGZXnNQ ilRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zPHI/aCudLBrv8sS+PH8r7jz/uhcmcWEDPOJSbmc9bY=; b=aRJjM7QJh4mwzJI1CTxmpEED+xuroTiBwysZ3aacRVFAY6hfHXs/aTh5MdhEx9qqgR C0zXmm8Q/SQIElZW4cR2SWHRvzx15SgwqnrL9Yk3BRckoBbQlxIMyim3A3av//iDTfYX kfkdANUvIvCwLCv4u3918LMCWUND2haLtRw5jwNh2ZbrD9gx3pcz/yINlDser/7jKaEe jJvV8iEE9L4sPy4c92Yp7yMZmBHYfXrJKch/5y0xqRPTinNEIHDRuxLm5Eo+hEkZ/9mX T5m2YDonYkCXOtI7BTgTpTWxAxwOWRH3VFcYCwMeV5ZYkLeGc1dGWFVjQpWvN90eaMzJ XpEQ== X-Gm-Message-State: ALQs6tBtstW/PVuu4c1+ZKdcXAMr012CPT4WKbCKk38l3rldLap4bXHk OOkDN6U23BhwUacFc3E+5CesGA== X-Google-Smtp-Source: AB8JxZqxxM7ZjotUi3zkCKTOMwpqmFo1VdwyC1kEpFJ8e9WNpBEupUyE34ksnM7Bf+a+PNzJX3aWrA== X-Received: by 2002:a65:47c8:: with SMTP id f8-v6mr14994305pgs.430.1525616390587; Sun, 06 May 2018 07:19:50 -0700 (PDT) Received: from localhost.localdomain ([240f:4:c2bc:1:141a:15e1:5268:11ce]) by smtp.gmail.com with ESMTPSA id s88sm58766771pfe.43.2018.05.06.07.19.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 May 2018 07:19:50 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Akinobu Mita , Jacopo Mondi , Laurent Pinchart , Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH v5 02/14] media: ov772x: correct setting of banding filter Date: Sun, 6 May 2018 23:19:17 +0900 Message-Id: <1525616369-8843-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525616369-8843-1-git-send-email-akinobu.mita@gmail.com> References: <1525616369-8843-1-git-send-email-akinobu.mita@gmail.com> 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 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); Cc: Jacopo Mondi Cc: Laurent Pinchart Cc: Hans Verkuil Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Acked-by: Jacopo Mondi Signed-off-by: Akinobu Mita --- * v5 - Add Acked-by: line drivers/media/i2c/ov772x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c index b62860c..e255070 100644 --- a/drivers/media/i2c/ov772x.c +++ b/drivers/media/i2c/ov772x.c @@ -1035,7 +1035,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);