From patchwork Mon Dec 5 05:19:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 29535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2076078wrr; Sun, 4 Dec 2022 21:23:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yl8GgGsSOs/+4H7Jvbzr+LU7idSEAuDxYD5KVKG5OEhXDgnBy/rEX+2w8XnJ4EBbn7AE9 X-Received: by 2002:a05:6402:4515:b0:461:cf2b:627b with SMTP id ez21-20020a056402451500b00461cf2b627bmr14607305edb.73.1670217839425; Sun, 04 Dec 2022 21:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670217839; cv=none; d=google.com; s=arc-20160816; b=gdTDI/sbmrc0x7v+Q8gOOkajW4QtOlre7HIDQ4s2Lo01QKoev1TKtbFZyJz51p887D L/fTQYujfeoJ5goPCdnGAg5u6xJJRah4QXKECSsO17ziFpBCtEWHiwnYgDdAs20YNhjS 3Am8a4c24J1wRst9KFJmjtmu9AJvZvfuaJAtlIClhUXBdczgSFfmWrbWkLy/HVr1OIEM kCkuaRdriXvcI2ETV04uXmsRBog4eXBlUoibl5vw4Nd6EjRRXFMjz9VihM6utJTIkWeB BolzWSeowHqxpHj4c1e1g0k1IJWnOtrGfH6MRwu/yPi7nS13wmOzcqXAEucsKRk1CT1A z4Lw== 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=iclWbWphq1AjeEOfInG5jgMTLhbz0kYJaZ446wyIzMg=; b=Yq6nbgHs73Mo+Bl58al7eBOtly4W2wQVhcP+Nfwx4QsfJXilwmyYZIfyA3bV4zkvLt 8Yk9Z/hCWhpPJ8xn1TRXZA6FmM1SjZR0uFfEr/qFyW11HHlxhnoqWwImsUDFFLmc2EEE ZK2vK1NDJcHDAtOi4SXLZ8+2D+YsrcJRVTE4lfwhKfeR6aBHA97sHBokOolFJldYNQ2v o0UmeNuYQzqJvxwJa+XikzPxcy+g+nXgC8VNBq7jmxdSSVFwdsQd+wz3KuvhQ3+bLu3P A6T8qWwg6ZI9Ygcs+pJwCaTj/t9I3Xughmfi9zj9oT82HCFf4gC9VgjBI1rllsB7Hruv znCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=edbBy1VE; 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 ss28-20020a170907c01c00b007adc8c49d83si9359621ejc.477.2022.12.04.21.23.35; Sun, 04 Dec 2022 21:23:59 -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=edbBy1VE; 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 S231602AbiLEFUJ (ORCPT + 99 others); Mon, 5 Dec 2022 00:20:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbiLEFUB (ORCPT ); Mon, 5 Dec 2022 00:20:01 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FD8AFCEA; Sun, 4 Dec 2022 21:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670217599; x=1701753599; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qsJvK2VpBu4Gb2ZvUzYx5074zsrdEggN0+SM/yXO0po=; b=edbBy1VEfC0r9nrKbEExqCo8Ll5HauQO/+sqcFXWGCzh8RsV7hkCB2l6 cv5AXkQUWBHfX9p5A2E2iIxBg4/FjQl5id2iWsUAmKhV+Wfhwbz8m6d5U 7YzhqPkSr8+OxMNhDuhj7BHC1HD8oypwZgoSxSi/zOeHsqm3slxyBNf2A dJ/SAbj67hd3LRO7eHLacMeSSG4UqgXfdoFtKvYWE7ogFKIRiAv8v9/iG R/XIi0M9SM/aDcP2ADOTeN3DzgSYkEjXHm8ioG7BHM5IG474jxbGUNJTh 3AdElTydz/ukCVUsdyd5zeQ8HgY8DpWoHABuTT4WvSbwEeN2n4js2PaT+ w==; X-IronPort-AV: E=Sophos;i="5.96,218,1665471600"; d="scan'208";a="202580518" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2022 22:19:58 -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; Sun, 4 Dec 2022 22:19:57 -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; Sun, 4 Dec 2022 22:19:55 -0700 From: shravan kumar To: , , CC: , , "Shravan Chippa" , Jacopo Mondi Subject: [PATCH v6 2/5] media: i2c: imx334: replace __v4l2_ctrl_s_ctrl to __v4l2_ctrl_modify_range Date: Mon, 5 Dec 2022 10:49:33 +0530 Message-ID: <20221205051937.3897001-3-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221205051937.3897001-1-shravan.chippa@microchip.com> References: <20221205051937.3897001-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, RCVD_IN_MSPIKE_H2,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?1751350340891386865?= X-GMAIL-MSGID: =?utf-8?q?1751350340891386865?= From: Shravan Chippa For evry mode we will get new set of values for hbalnk so use __v4l2_ctrl_modify_range() to support multi modes for hblank. The hblank value is readonly in the driver. because of this the function returns error if we try to change. so added dumy return case in imx334_set_ctrl function Suggested-by: Jacopo Mondi Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index acc9f9f15e47..a742b60ea3b0 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, mode->hblank, + mode->hblank, 1, mode->hblank); if (ret) return ret; @@ -480,6 +481,9 @@ static int imx334_set_ctrl(struct v4l2_ctrl *ctrl) pm_runtime_put(imx334->dev); + break; + case V4L2_CID_HBLANK: + ret = 0; break; default: dev_err(imx334->dev, "Invalid control %d", ctrl->id);