Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2090794rwj; Sun, 18 Dec 2022 22:33:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Sqy2mGxu2fJdMq85/5JUUhEzNKOgNkUDD/Zz3P13YWLBU2JhDdLdtvqpkoBuXxkuHPlee X-Received: by 2002:a62:e814:0:b0:577:271e:e66f with SMTP id c20-20020a62e814000000b00577271ee66fmr42195691pfi.27.1671431597914; Sun, 18 Dec 2022 22:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671431597; cv=none; d=google.com; s=arc-20160816; b=QZBl0g97jolUGDPT2MQoNEOLGjseHJ0m9p0YO9twJQ+WypvtGEpZrMimAMaRPCfNBw B9480vjmUWTPPja4mzqYJDvehKGa2IiKDyrsV2u+nCY7Y4UjERu1QnpR0uK3W4ADNayv 0/yqfAHD6KxvRq6mpNdTlGebpgbx2NLlOGG/ZTAx+64WQi8NnhA3vEjHMm/lEMAmi+BU H53SlEtxpsgL8zWDE3yzYS+ZnLHAdEhXETm7gUsWywJOlQkRjJ8wxwaxkYi335lkTIfz Uqp2fuX5TvzDecYtT54g/VgQZlF648E633oL9sDJhi2yGrboEAKv71/6++zzuQgnfxUC JOkQ== 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=2q9Xcd7aMC2/LQ4uvVnViFtiDawT6vCqs4MhqFJlA0k=; b=mAVx1O3SGj6+mLuva/slYHaIoH9HUm2/QrvN1aa5GdPG+9BEspIynvozRmnRvDtp9E VYW1t37xu8uTRqkh86yoKBCwrxQGlRPjiGVMd0ZRPRBlxG/12zCNzrwG2BvUkVxmca1c OSQm2Ajr3X4CxxKHIWTD5YLfaHczF4BXmAvpXQaCBl7MRBMykmkeJ5qoX5YI+/5iNXSb Qy5kV/lCfD+txC0nng1r6UTgzOXY69RNCURnv18DuwU6+YS52iW7q6fVwgFAn1+G0UXC olRFnhG6TXj+GyKI4BAiqXsz8giMu8eNCVG0JD5NFMhqhOo374DG+xl3n05igO4yPCoQ 4tbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=o5FBQNwu; 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 b10-20020a056a000cca00b005746b284963si10334938pfv.290.2022.12.18.22.33.09; Sun, 18 Dec 2022 22:33:17 -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=o5FBQNwu; 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 S231453AbiLSGQU (ORCPT + 70 others); Mon, 19 Dec 2022 01:16:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbiLSGP6 (ORCPT ); Mon, 19 Dec 2022 01:15:58 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4387C46; Sun, 18 Dec 2022 22:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1671430553; x=1702966553; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zlh+o5nICLTxuKGUQiTPG7BOp4qsCUFdozUMfdt2II8=; b=o5FBQNwu0VPHjzBThp6f4yu6QGyuwz7LgTZeHJ44xNy24Jw9EC8KtgkT ddpdzCPJ6xy5Ui/U7TIlFkFnqPwrLiGCoyWUpv002HnciEPrbVZxcQfzM La+8sunptnIue+Sul9yTXJUnTcKMmEjyBA7QUxgiF5jP6yEWJzdx1FqFF L31E1NCGnnKoRWS+J0FApFRJAXClutsXFtnsrLvbOV4IVgRAktruKpbqJ qj2nupCowREcYU7ZBUr0qFwJuM/jyQecoFbcbsbLJqtATFMvYLSkwdO4k bXpaeCCF/OKyQr29KcaVj3jeuKSelAsPVrclnPmgxRGk6eNQz9KxXzq8b g==; X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="192277833" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 18 Dec 2022 23:15:53 -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; Sun, 18 Dec 2022 23:15:52 -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; Sun, 18 Dec 2022 23:15:49 -0700 From: shravan kumar To: , , CC: , , "shravan kumar" , Sakari Ailus Subject: [PATCH v7 5/5] media: i2c: imx334: update pixel and link frequency Date: Mon, 19 Dec 2022 11:45:26 +0530 Message-ID: <20221219061526.3169369-6-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221219061526.3169369-1-shravan.chippa@microchip.com> References: <20221219061526.3169369-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 e6c97e5c42d2..4335c73f4d5c 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; -- 2.34.1