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: 13110820 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 9CF9AC52D11 for ; Sat, 21 Jan 2023 03:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbjAUDhc (ORCPT ); Fri, 20 Jan 2023 22:37:32 -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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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);