From patchwork Sat Jan 21 03:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 46759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp555200wrn; Fri, 20 Jan 2023 19:39:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXuNRey8vdHGc8oTwIhPj7/j5dhSKcvX4JA23Q3RAghcPv8m3GH751xLKErMOpHZsq/uiskk X-Received: by 2002:a05:6a00:181f:b0:58b:d244:b525 with SMTP id y31-20020a056a00181f00b0058bd244b525mr26657720pfa.17.1674272373250; Fri, 20 Jan 2023 19:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674272373; cv=none; d=google.com; s=arc-20160816; b=NBUzr6JfRC8frREk2K/Ro5Z5VTdV0IUwORXoghGlJJFYRAsFTXETJn7aMni3jFst9U ogV56KmrIQL6I1EcpPnW0+7Ry1f7jUlSJALZW6SO5r41yJMVOemMsRfc5/JgOx0INZhE FtTxJP3lSwG42Sgo+NsoKL5uLuyyMXcvidju7v7rt1BKKWqRsz6/GFGro2GEMz+yEO/b VUYi7lA2SBeRyGwlAO1MFfBWoSUKtLD/HiHVhjTUTEaWf/ZJ2Z6J2mwULDtrBVWnAEYK GUNKUvCRJzVsdhbKD7IkBHu1k21z+DuQJK+9cRaOj6bNhLo3bZXf/NZahyiOdSJ+GekY 1c/A== 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=98zli5z0ihr1kKdZJcboTe+jzjNLnmtVI/lc8cSGp60=; b=gvLz5EpneALf8gMIvoH0RczqaqMaGioD+qQKkSpfrL7KdAgtbpGxPTx/KadO2LQ+pg NyubguyG8z4LTmOewriA8jbPeN5Sy/QjT+ffxJMbz8yC9++2EE1h6t4Nj3RmGwf76CvK ypgLfXHIZscJ3SHGBjeVIF2VvIQI2xScV7QWaRRnqabs6YpCSZgsB113AujpAfEgMrrN MGDMc5IWNR0RVAD9S+ZIumhSptRT7kntLD7XWSoCqZlvs8G+VAnvflA2lktv4R98EGrJ m3bxquofug+cpSHXBftlidYx11WWRsZLNGyRvpMofkhdWzYAgbYWSB/NPWmLw/JEPsP2 B6FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=RuHfwOT1; 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 v27-20020aa799db000000b0058bb792cdeesi24778124pfi.317.2023.01.20.19.39.21; Fri, 20 Jan 2023 19:39:33 -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=RuHfwOT1; 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 S229450AbjAUDhd (ORCPT + 99 others); Fri, 20 Jan 2023 22:37:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjAUDhb (ORCPT ); Fri, 20 Jan 2023 22:37:31 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD9C79EBE; Fri, 20 Jan 2023 19:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674272251; x=1705808251; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IC4Krh/tkpVGXGBoGbbhsCsG+9lDFkR31NuApekcLbg=; b=RuHfwOT1NuZgns5F+O3g3ev4Hf00aSuNd27NqXB6sA9y3uuWclF/Gupw TT/W93IjcIBkK3kaOCmHfXk160kA7L/1eOEtPNqLj+lh+U6tOvUpmMuVR UL5Jw0jOng4nR6j2ST9tfuslyNbAInZiRgZ3+58phL9fCOcLhLkpyakUL RSNWqQ4I2TmgZJzZWnQlxVxVR4/Ww0gVzYfVFaQYaA84wQNOAQldsxL3t W1NycHTx26qwVCkecRS8ovlljoN3lsivUcMXJTtv6QEs4vWBiXwG0IJc4 MOzorKpufH0cH/bdJC8TUrwaPLgQsW0e9Xvt/1IhpNMeUrAmpEpSKGGAg g==; X-IronPort-AV: E=Sophos;i="5.97,234,1669100400"; d="scan'208";a="193243007" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jan 2023 20:37:30 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 20 Jan 2023 20:37:29 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 20 Jan 2023 20:37:23 -0700 From: shravan kumar To: , , , , , CC: , , , , , , , , Jacopo Mondi , Jacopo Mondi Subject: [PATCH RESEND v10 1/5] media: i2c: imx334: replace __v4l2_ctrl_s_ctrl to __v4l2_ctrl_modify_range Date: Sat, 21 Jan 2023 09:07:09 +0530 Message-ID: <20230121033713.3535351-2-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230121033713.3535351-1-shravan.chippa@microchip.com> References: <20230121033713.3535351-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,URIBL_BLOCKED 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?1755601827777279533?= X-GMAIL-MSGID: =?utf-8?q?1755601827777279533?= 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. Reviewed-by: Jacopo Mondi 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 7b0a9086447d..ebacba3059b3 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);