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: 628755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 306EBC4332F for ; Fri, 25 Nov 2022 05:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbiKYFIp (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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;