From patchwork Fri Nov 25 05:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 25819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3775891wrr; Thu, 24 Nov 2022 21:10:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4djZAUhIbUMN05tn9uoxtah8xla71B4SiYVoHS3318sXv0IafJnhBGeCHIAosHYRVp7+Fw X-Received: by 2002:a17:90b:f06:b0:218:d86a:3cda with SMTP id br6-20020a17090b0f0600b00218d86a3cdamr13382228pjb.99.1669353050119; Thu, 24 Nov 2022 21:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669353050; cv=none; d=google.com; s=arc-20160816; b=qRA/vvKeRCjdxOvI/6qlD3D2bMVYwS/4H0u4pBOvYCWOvxxVHoFRkOpZ2ZX5D5+Pyh /x9U+mFr0EKEwbJ8wyLBr05QWgyzTV1QlvuOqny3EUtbnCnWxr6fdFhMUvWSfPfW8T2x FKlS/4eJZPeUEsS5oxdfbWClrIfMmUevtzuhi3mjDe/Q+CDTZWrAdkWkJCFyt3WK1lDH mxZGlT7yOl9qTCr5JsG5wh9jLOCsoq8QF2fIRh0HH/Zh3reb+UMVkMcY3gxqy1hTNBa4 htzU+q9+GARAc++v0ksQ+ykmS34P+llnYxvaRKITKO5kK50tSthiuQAam5X6Z47IXR2w 3Rtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cqPi0yZ9whQVbfwrfddEpRM9BQY1bmhG8OqwExUt4pQ=; b=Jk4cPj9YQz/72EU82CVCHz4qenq+xDdu8orpgzGnayxrchl5WNVNwm5233ZLnwy1sB 6qfgogs9FqJsq0npBBWc1cFFHvqTwqBIXqEiG00ORWfYWP3O3asmuyivYssGc0Zhb6tK FqkJVT+kK8SlA6QVkka7LBodtkpaHjIztgt9oXI5AT9AaOZGZ3Kael1R70YAWCUh0m72 tqMtuQJxr/N33Mx3E0zHEYMIBYhtfaoPuneTa+cvU9g3bMkmennTqB7mr6K7BXuFo6zg rskWQxy6jngJR64IuBUHuieQIvTt/A3Qtr3OpT9wd9TFWdE1cG5hQvLR0/bY0HUReQyc xDZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=GMvvG71F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bn10-20020a056a02030a00b004772cf9ae7esi3359066pgb.284.2022.11.24.21.10.37; Thu, 24 Nov 2022 21:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=GMvvG71F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbiKYFIp (ORCPT + 99 others); Fri, 25 Nov 2022 00:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiKYFIl (ORCPT ); Fri, 25 Nov 2022 00:08:41 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7231128E1C; Thu, 24 Nov 2022 21:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669352920; x=1700888920; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g8OBmYIK6Fvoc7i+MI8M2i9rEaNDQ9Z3VGMaSA83cJM=; b=GMvvG71FK+QVXIIRt+Z3hivGLSSO4z+Sbr7u9ha4f8LXk58qR3kBH+Ms cqyJrpQjvYz2xb5kYBcDjPtOfvBIm2ubuaej0oIbP/0LPBVKwYUKRnuQb ABiuqKaNVOYhRm3v3PxzU1wyCRSUOQ55+CGHNJ+NMkk8PI+xcb/wVPRLf u/09SowJBwkCGgUTiqNDC4VVSThx1RdNK2ByEEXc4zWMtQkS2tPqZV7CA MlbTbj9G9nfThr3zE5E0N1t1hsmDWR7TGBLi3yVvsN9LUWP0mk9motuk+ /Vhww7uV40RtJ5lRsYeRNy6QNiTWCSK5D64L+QxdPR6hawuQFCXC7KDZy g==; X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="188604162" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Nov 2022 22:08:38 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 24 Nov 2022 22:08:38 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 24 Nov 2022 22:08:36 -0700 From: shravan kumar To: , , CC: , , "Shravan Chippa" , Jacopo Mondi Subject: [PATCH v5 3/6] media: i2c: imx334: hblank set function modify Date: Fri, 25 Nov 2022 10:38:04 +0530 Message-ID: <20221125050807.1857479-4-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221125050807.1857479-1-shravan.chippa@microchip.com> References: <20221125050807.1857479-1-shravan.chippa@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750443543840137692?= X-GMAIL-MSGID: =?utf-8?q?1750443543840137692?= From: Shravan Chippa -If we one modes hblank will not change and it is readonly -If we have multipull modes and if we do mode switch, hblank value will change and __v4l2_ctrl_s_ctrl() returns error, so modified function from __v4l2_ctrl_s_ctrl() to __v4l2_ctrl_modify_range() will updated all values max, min default it is not showing any error while changing the mode and update value Suggested-by: Jacopo Mondi Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index acc9f9f15e47..d3bb62c162b3 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -382,7 +382,8 @@ static int imx334_update_controls(struct imx334 *imx334, if (ret) return ret; - ret = __v4l2_ctrl_s_ctrl(imx334->hblank_ctrl, mode->hblank); + ret = __v4l2_ctrl_modify_range(imx334->hblank_ctrl, IMX334_REG_MIN, + IMX334_REG_MAX, 1, mode->hblank); if (ret) return ret;