Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1983095rwl; Thu, 5 Jan 2023 23:41:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXu94N+Pfg0Yi7X+pLiC43BF1tGzatQxOtRcc7wyghB72UNr/yxqwVmSyllIM5s7+oCJDrLm X-Received: by 2002:a05:6a00:706:b0:580:d409:396c with SMTP id 6-20020a056a00070600b00580d409396cmr48468162pfl.6.1672990892499; Thu, 05 Jan 2023 23:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672990892; cv=none; d=google.com; s=arc-20160816; b=hYlhF8sChBbvcuhpdhm2T7Qha8yMk29n3FlawzTjv+50IY/qeduM0B9dRwC0rV6b8o 9AzCKrSVxmykvjVjsS1gkIyvZO5ODFVoFNI1XM6b3i/yoI8Vb8ZvMl+cn3e7qr4ABDtg 3YDf9UGF5wxNOuEhD1d7EabOvtR6lPhYZlZ5Ea8mfQdnJv2Jj8BW3URT1Uh6C0iy8CIo 9hN2dmavqJE5wLCAzajup6m2iFC/rUcLrrYjCh+zFzYhc3mUXG2cxl5MbolFBmBxWNa1 VNR8Po3kWaV5rdULntgU5VMY0G0JlhaDFLQ7AwRtLt/7/KOMWCs1JVKUA0wA3gW4yP66 PFIw== 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=ULy97/E/y1QLI5fVccu7RD7+QBdolRkMKNXUSNQNN9k=; b=KMqKNKSq1ReR+iGLK05hSRljJqNo5pXZhZupVTROmy2OWU4voMdU60i59w3KihjN0M xNbnZCa1dZ4i3nFERkaKDqdLZCqZMOC2fhsrrpnlR4S5H+v2vKE8K8OmW3xs0vLkc3FL kY2/LZI+I0rd/hSm2CM4kyKY7+y7gZVyEG5gG9WF6dmyboVZyVtz6Zhbgh1t/9hbpQDc e33iUxIiBYGOnyxaRDiNc5InRoOSrueBKhMBiXXHb8zBxKuN58L0Hqe+e4ejmZo2EVmK L19rDfq7DMkebwSREMbVaOkFfHBApI4Gks/qlv7rJF4WyZbZNgELY6uHWLZ9F/AZ4c49 zQLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=B20JRYT8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x29-20020aa78f1d000000b0054342bb20e2si642944pfr.66.2023.01.05.23.41.25; Thu, 05 Jan 2023 23:41:32 -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=B20JRYT8; 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 S231980AbjAFHaF (ORCPT + 54 others); Fri, 6 Jan 2023 02:30:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbjAFHaA (ORCPT ); Fri, 6 Jan 2023 02:30:00 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84F9D6F943; Thu, 5 Jan 2023 23:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1672990199; x=1704526199; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DffC9CPOpTvTI4x91/PB9XTl2Oj+dLxT5MUVwREgeSs=; b=B20JRYT8GB2SSwUINvmP3dLitHDPovckdxTgJQUiw5b9vPqrk2HfOdvw VYCVHTnTbO4k3+gTj+8BAwIrdj0lkKB3XVZ1D+QKFZRxL8yLeHSDWvj1r VBALeGbwkENlsz/De9OjPCeMzRBMiqJ06EG7f3kPHsvrcRzvw0S7kmdyy qszvEy8P7CbiqN4ZWXCQtv7EK7jhtHb/cGgnfaW8MpTyhGbBYpNgAEIne 8+eExpcH7uAMkflyFL0fQylsW3zxsknd4ERRFY5BbhcxkWNju+nU2XqVc KwBZsu6D9xj5RismjYyL+VidWDBa59uDvof1Txl1QEDz6QGI9WfUQyn3d Q==; X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="206640385" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jan 2023 00:29:58 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 00:29:58 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 6 Jan 2023 00:29:56 -0700 From: shravan kumar To: , , CC: , , "shravan kumar" , Sakari Ailus Subject: [PATCH v8 4/4] media: i2c: imx334: update pixel and link frequency Date: Fri, 6 Jan 2023 12:59:31 +0530 Message-ID: <20230106072931.2317597-5-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106072931.2317597-1-shravan.chippa@microchip.com> References: <20230106072931.2317597-1-shravan.chippa@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 From: Shravan Chippa Update pixel_rate and link frequency for 1920x1080@30 while changing mode. 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 0315e1c9541d..8c3ba660abae 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -50,6 +50,7 @@ /* CSI2 HW configuration */ #define IMX334_LINK_FREQ 891000000 +#define IMX334_LINK_FREQ_445M 445500000 #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_445M, }; /* Sensor mode registers */ @@ -468,7 +470,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, @@ -598,6 +600,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, mode->hblank, mode->hblank, 1, mode->hblank); if (ret) @@ -698,6 +705,8 @@ 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: case V4L2_CID_HBLANK: ret = 0; break; -- 2.34.1