From patchwork Fri Nov 25 05:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 25823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3776757wrr; Thu, 24 Nov 2022 21:13:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4k35AF1H7HLtZxob9FeP7PfuxmL/JXikKDULeTkFIyAmW2ZaXdkrK//owN2YKKn4b2XB7/ X-Received: by 2002:a17:90a:5d08:b0:218:770c:9a40 with SMTP id s8-20020a17090a5d0800b00218770c9a40mr21657526pji.158.1669353183227; Thu, 24 Nov 2022 21:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669353183; cv=none; d=google.com; s=arc-20160816; b=HPL7wuSdQq83WG9PAg1lqk9hqjJPrlLajqjKZztn0tLRMS67RoqAzivrA/Q/A0wRSG hOM0M22WishtyyCOGofuYo+MnpQCmruBKIbe3/+h4leVyv6UDZgHr87BXaK+Fi8JpuZd JAuJEQMLSxIPRiQ7tfKDaO0adUmD4O26KJOPOrmg5xSSek5Ome/pQ/HiW4iCk1a4jIOW GO/sN1C6C3ZudhifgYKzjfyFgE91Beot6FdemZYpd77YDVajxNXX14ox8LGsSMU1STOC xuGMRyFDBj2up7rIH/kcGfiTDRg3RJLnxDQEXM8Qyy08ensc1tlhrlvNKMhGmcRuxzTC LipQ== 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=HulUvQDP3Yo2K+EA3YnkFq6QTTFDox7hhmYSVQbx6Nk=; b=B+Wdeg+44DSqlfIIeXn4Ch1MTAeBhsPm+nOTYRYQmnCqQvLa6LEeCu3/mX4v3oFfmR 3x5xZ+ONkHG5dB1i4W5t8iCnMtC1fwmQo0mQsCJ8GQxcOaPc74Ljj6+TjkqsMBalGYsw EB6uEZfOrR75pvPV6mmT24GTOjhwwDjacE/D0D60WrQVx9QIwkLyKXWIqaksdKTCSCZu uIdFfPannPH//5vu6dc7wDPebe/AMxSXaMNmrkxBnHFXZUzQG/5aOC2OKrNyuInFFNCn m5LBVY49QQ38n4Heg4HQi8742TKvnmASrUrXgTVpw7fjS6PuNtfxmgPD0xvQ8z3gw3+D rpqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="WfDy/eKG"; 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 q11-20020a656a8b000000b0046ec7beb578si2946050pgu.94.2022.11.24.21.12.50; Thu, 24 Nov 2022 21:13:03 -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="WfDy/eKG"; 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 S229658AbiKYFJR (ORCPT + 99 others); Fri, 25 Nov 2022 00:09:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiKYFJE (ORCPT ); Fri, 25 Nov 2022 00:09:04 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB48028727; Thu, 24 Nov 2022 21:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669352944; x=1700888944; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GMVRwSHQ1d1bppR8aOD0mgZ9k9ac8N+YUIDRalV7lhM=; b=WfDy/eKGqfqKvwKKd0X5RS2nIj2/UD4EbcJFBQHBhy5dRGF8/dlPIwH6 lfrNyyxdyl+OjZhdFmaTIMdGb2z2CLBy/ccQ6MKCJi7FjzC6/Bar2QIEP dlm+/Kq9IJ7g99Of0fiRcuCiAff8dc6fEJe5Az9EkEz6ocZ6PSm1r6pYn MahK9PS20iS/3/DgWnNd+ULM6w8tJJeoIis2YyMkk60rrsdslOOTG18bD wb08N8s0bpLb/a8hZOeOxMBfqae33vq3qdKj2V3DaIIa81l6WpM+b2B6I aHIFEIbBEMsdbi6I4PLJDCMjKYJsC6X7kA81gT3+9vD/+pVwm8fNVMUH0 Q==; X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="185123096" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Nov 2022 22:09:03 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) 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:09:02 -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:09:00 -0700 From: shravan kumar To: , , CC: , , "Shravan Chippa" , Sakari Ailus Subject: [PATCH v5 6/6] media: i2c: imx334: updating pixel and link frequency Date: Fri, 25 Nov 2022 10:38:07 +0530 Message-ID: <20221125050807.1857479-7-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?1750443683103194242?= X-GMAIL-MSGID: =?utf-8?q?1750443683103194242?= From: Shravan Chippa -Update pixel_rate and link frequency for 1920x1080@30 Add dummy ctrl cases for pixel_rate and link frequency to avoid error while changing the modes dynamically Suggested-by: Sakari Ailus Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 0e5575604d87..ec77835d94a2 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -50,6 +50,7 @@ /* CSI2 HW configuration */ #define IMX334_LINK_FREQ 1782000000 +#define IMX334_LINK_FREQ_891M 891000000 #define IMX334_NUM_DATA_LANES 4 #define IMX334_REG_MIN 0x00 @@ -145,6 +146,7 @@ struct imx334 { static const s64 link_freq[] = { IMX334_LINK_FREQ, + IMX334_LINK_FREQ_891M, }; /* Sensor mode registers */ @@ -471,7 +473,7 @@ static const struct imx334_mode supported_modes[] = { .vblank_min = 90, .vblank_max = 132840, .pclk = 74250000, - .link_freq_idx = 0, + .link_freq_idx = 1, .reg_list = { .num_of_regs = ARRAY_SIZE(mode_1920x1080_regs), .regs = mode_1920x1080_regs, @@ -601,6 +603,11 @@ static int imx334_update_controls(struct imx334 *imx334, if (ret) return ret; + ret = __v4l2_ctrl_modify_range(imx334->pclk_ctrl, mode->pclk, + mode->pclk, 1, mode->pclk); + if (ret) + return ret; + ret = __v4l2_ctrl_modify_range(imx334->hblank_ctrl, IMX334_REG_MIN, IMX334_REG_MAX, 1, mode->hblank); if (ret) @@ -700,6 +707,10 @@ static int imx334_set_ctrl(struct v4l2_ctrl *ctrl) pm_runtime_put(imx334->dev); + break; + case V4L2_CID_PIXEL_RATE: + case V4L2_CID_LINK_FREQ: + ret = 0; break; default: dev_err(imx334->dev, "Invalid control %d", ctrl->id);