From patchwork Mon Dec 5 05:19:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 29538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2076375wrr; Sun, 4 Dec 2022 21:25:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf47F4O/GmiTXDOY+SrLLazrqaD8wUp3196F3hfkWWNdoZ/ed1jQ9nrWPQIWEU27LtSKz2WK X-Received: by 2002:a17:907:75ce:b0:7c0:f7af:cccd with SMTP id jl14-20020a17090775ce00b007c0f7afcccdmr2021597ejc.314.1670217928085; Sun, 04 Dec 2022 21:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670217928; cv=none; d=google.com; s=arc-20160816; b=b36ATMbI9gUZm9q88RJHait7vKOO2JWUtwbYP0denY8v2G6kWTghAGKglB1ZpvB0us J638lSOgqYw0CECDBo8W1lzEc6tHDsGIhzSzNoY73BvU4xJKylSNNts4K09HG+YYGEVG t4JInorXf4Et+XIiepv4t+d/1vwEOoIonO6R+zbacosjJP+N4PsPBssR4eX4Orihuo4y Rlx8bgxXe/oqQ+NPRLO8BDcJ8d1oMobEUsMnr7JtYGZ5uTbkM0sw+3ZayzcHiucAsdOG RyJ49kgvnZM6NooSGwdE8/u8Dbbj+rAisg3MHymNbQInATr1qnelggXdmHQdk8aKfRwV I+1w== 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=TirzkdbSCJym6PiOFlIQc5e9jpG7HogxdTYHUQJ9tDY=; b=ZZiIRmF9H8GcobsTDsLD6evBZyg0tCXpSLbwbYsPdkeKNxj7XsV8TwFJ4UzTBUGQLO rKd0BsLGVK1wdJnDKmD6LxS7XHQ9pk4jFuzl6gBXpz+TIbBTB1/3QSzM7gXEQSL6ZRCA jFnEhf4TpR2JGyg6OE9/X1PKW2DYuzx2qhsLG4U+WnYvrBjwJSoB7gWpN/L4Y6cPEoHz /qyxWMfv+lmqaAYbdh5fpLZ2Slre89Bouwg18Haw6lsv2GtAW/N7VNHMVSIjQvQFNUaI 3QQSEARPM/Gn3zjkYkADBjM4KrjoexdWoLocXs+bQOwH3K2Gojf760eDWcdemvcZfp+g E+uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Pix+f2m3; 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 xe8-20020a170907318800b007ae6f13645dsi11185758ejb.498.2022.12.04.21.25.04; Sun, 04 Dec 2022 21:25:28 -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=Pix+f2m3; 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 S231688AbiLEFU6 (ORCPT + 99 others); Mon, 5 Dec 2022 00:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbiLEFUa (ORCPT ); Mon, 5 Dec 2022 00:20:30 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3779B13F91; Sun, 4 Dec 2022 21:20:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670217617; x=1701753617; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mXhoSw88V/7yBb8oczsmPuNJJvEtejt3CszxH0XbUxo=; b=Pix+f2m3QxHXoRZXM2Pna9AkTv1gjctfmYnRxgJXF77YzBHZsXiYWv98 hEyAys1SYP8jwhR+DvFr7Iuett4LZiqbjeTCWqlLyj/kwDLPwHkJsxJRL fXpsq/7bPNbdhu+FAr39wlkJCJgXmwRU3u2pwtQnobW/4fCAsj7M8OHo2 oR9BICMKJxkYmeW2FnH1prCq5cceb3nM2vXOPmksvSWAWEf/nSHj4JOvK /9Ava2vHS/8RZU+5j23o2Rydg0uS//L2JIDx3LHXPGDyxE7PWbp84JNG0 0i8EkV/qRkndwTJukNzIAzRwX3dxq9oJ13aLVt3tZWp37ADau6MAb2rpB w==; X-IronPort-AV: E=Sophos;i="5.96,218,1665471600"; d="scan'208";a="126455461" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2022 22:20:15 -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; Sun, 4 Dec 2022 22:20:15 -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:20:13 -0700 From: shravan kumar To: , , CC: , , "Shravan Chippa" , Sakari Ailus Subject: [PATCH v6 5/5] media: i2c: imx334: update pixel and link frequency Date: Mon, 5 Dec 2022 10:49:37 +0530 Message-ID: <20221205051937.3897001-7-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, 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?1751350433843224743?= X-GMAIL-MSGID: =?utf-8?q?1751350433843224743?= 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 d5b566085da9..64ed77c4258c 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 */ @@ -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;