From patchwork Fri Feb 28 10:33:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan kumar X-Patchwork-Id: 870364 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A46C25F79C; Fri, 28 Feb 2025 10:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738951; cv=none; b=r9R4QGKLwELTY6jFFxKiddxSoAnQoaoPfjPez8kK63Hqhux7YmEt/HiKxb9r6hQhu/Fxkb5bsEak9TSkjw2ieMjbEh19bcgm3YYZHmGeaOz/rzcPM2SDMDaN2LOFrZJtZT8Gz4WoBQInlpu/dmUyx9Npl96kJLNybPkzFEFQwnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738951; c=relaxed/simple; bh=Hky8Qk8JiIoZUf+pJpRuJDhL7afg4zq+xqLIU/ZiBc0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cIcnkZGXe3uYVBfNTnzj7UsuXZShQFAcnclFxnuQFtYL0g8V0yPeZMywe5ba0H8biWjLYHgRtWAH2T+6P2hYxuDcAPY8pXCMeLPp0NYfr4EeA6mFoqA82A1LcGeJo4ofakQWPYtsBZ89MRwoGfyPqv385oDbuUeT0CvDnnFV4qA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=hTmq3Ed6; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="hTmq3Ed6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1740738949; x=1772274949; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hky8Qk8JiIoZUf+pJpRuJDhL7afg4zq+xqLIU/ZiBc0=; b=hTmq3Ed6FKxhvCAZNiGmaUt38DiV/TJ6nZjBm6vNAv8chBa2+PZb6gmv D3Y5W/VzKaLMqyCUcCIwClk5x/pCXScHQeZkVYdg4hRRw/MP/5hkRaxVz Lziy/qRG8aI+RjsGnp+hlqIIke3L8ZX+iz/cVNZJZFYnRIBJfJSskTa4j YFkD85TwZm69g08DeQp0Gg1V+LIpeCj5wzu9xArLtxajXe02e+q+pQ7hI bGtK17IXOlc57VagCdmNcm20FbMBXRI1l74Vi4L2Mr0M+h2ZVEQggvSCB Sgtyjvgt8HldDg9FQKi09PRzFKLD2xdjPP7NOFAz38EGM0cCCNXgLP3/Q Q==; X-CSE-ConnectionGUID: EGT8tc8wQVmSwiJ/XsSdqg== X-CSE-MsgGUID: 3UhDHhBhS9+M44uBTt6/Og== X-IronPort-AV: E=Sophos;i="6.13,322,1732604400"; d="scan'208";a="38683419" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 28 Feb 2025 03:35:46 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.35; Fri, 28 Feb 2025 03:35:20 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 28 Feb 2025 03:35:16 -0700 From: shravan kumar To: , CC: , , , , , , Subject: [PATCH V6 1/3] media: i2c: imx334: Optimized 4k and 2k mode register arrays Date: Fri, 28 Feb 2025 16:03:30 +0530 Message-ID: <20250228103332.3647098-2-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250228103332.3647098-1-shravan.chippa@microchip.com> References: <20250228103332.3647098-1-shravan.chippa@microchip.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Shravan Chippa Optimized the resolution arrays by integrating a common register array. Adjusted the register array values for 1920x1080@30 and 3840x2160@30 resolutions to align with the common register array values. Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 132 +++++++++---------------------------- 1 file changed, 31 insertions(+), 101 deletions(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index a544fc3df39c..a800f2203592 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -167,8 +167,8 @@ static const s64 link_freq[] = { IMX334_LINK_FREQ_445M, }; -/* Sensor mode registers for 1920x1080@30fps */ -static const struct imx334_reg mode_1920x1080_regs[] = { +/* Sensor common mode registers values */ +static const struct imx334_reg common_mode_regs[] = { {0x3000, 0x01}, {0x3018, 0x04}, {0x3030, 0xca}, @@ -176,26 +176,10 @@ static const struct imx334_reg mode_1920x1080_regs[] = { {0x3032, 0x00}, {0x3034, 0x4c}, {0x3035, 0x04}, - {0x302c, 0xf0}, - {0x302d, 0x03}, - {0x302e, 0x80}, - {0x302f, 0x07}, - {0x3074, 0xcc}, - {0x3075, 0x02}, - {0x308e, 0xcd}, - {0x308f, 0x02}, - {0x3076, 0x38}, - {0x3077, 0x04}, - {0x3090, 0x38}, - {0x3091, 0x04}, - {0x3308, 0x38}, - {0x3309, 0x04}, - {0x30C6, 0x00}, + {0x30c6, 0x00}, {0x30c7, 0x00}, {0x30ce, 0x00}, {0x30cf, 0x00}, - {0x30d8, 0x18}, - {0x30d9, 0x0a}, {0x304c, 0x00}, {0x304e, 0x00}, {0x304f, 0x00}, @@ -210,7 +194,7 @@ static const struct imx334_reg mode_1920x1080_regs[] = { {0x300d, 0x29}, {0x314c, 0x29}, {0x314d, 0x01}, - {0x315a, 0x06}, + {0x315a, 0x0a}, {0x3168, 0xa0}, {0x316a, 0x7e}, {0x319e, 0x02}, @@ -330,24 +314,32 @@ static const struct imx334_reg mode_1920x1080_regs[] = { {0x3002, 0x00}, }; +/* Sensor mode registers for 1920x1080@30fps */ +static const struct imx334_reg mode_1920x1080_regs[] = { + {0x302c, 0xf0}, + {0x302d, 0x03}, + {0x302e, 0x80}, + {0x302f, 0x07}, + {0x3074, 0xcc}, + {0x3075, 0x02}, + {0x308e, 0xcd}, + {0x308f, 0x02}, + {0x3076, 0x38}, + {0x3077, 0x04}, + {0x3090, 0x38}, + {0x3091, 0x04}, + {0x3308, 0x38}, + {0x3309, 0x04}, + {0x30d8, 0x18}, + {0x30d9, 0x0a}, +}; + /* Sensor mode registers for 3840x2160@30fps */ static const struct imx334_reg mode_3840x2160_regs[] = { - {0x3000, 0x01}, - {0x3002, 0x00}, - {0x3018, 0x04}, - {0x37b0, 0x36}, - {0x304c, 0x00}, - {0x300c, 0x3b}, {0x300d, 0x2a}, {0x3034, 0x26}, {0x3035, 0x02}, - {0x314c, 0x29}, - {0x314d, 0x01}, {0x315a, 0x02}, - {0x3168, 0xa0}, - {0x316a, 0x7e}, - {0x3288, 0x21}, - {0x328a, 0x02}, {0x302c, 0x3c}, {0x302d, 0x00}, {0x302e, 0x00}, @@ -356,82 +348,13 @@ static const struct imx334_reg mode_3840x2160_regs[] = { {0x3077, 0x08}, {0x3090, 0x70}, {0x3091, 0x08}, - {0x30d8, 0x20}, - {0x30d9, 0x12}, {0x3308, 0x70}, {0x3309, 0x08}, - {0x3414, 0x05}, - {0x3416, 0x18}, - {0x35ac, 0x0e}, - {0x3648, 0x01}, - {0x364a, 0x04}, - {0x364c, 0x04}, - {0x3678, 0x01}, - {0x367c, 0x31}, - {0x367e, 0x31}, - {0x3708, 0x02}, - {0x3714, 0x01}, - {0x3715, 0x02}, - {0x3716, 0x02}, - {0x3717, 0x02}, - {0x371c, 0x3d}, - {0x371d, 0x3f}, - {0x372c, 0x00}, - {0x372d, 0x00}, - {0x372e, 0x46}, - {0x372f, 0x00}, - {0x3730, 0x89}, - {0x3731, 0x00}, - {0x3732, 0x08}, - {0x3733, 0x01}, - {0x3734, 0xfe}, - {0x3735, 0x05}, - {0x375d, 0x00}, - {0x375e, 0x00}, - {0x375f, 0x61}, - {0x3760, 0x06}, - {0x3768, 0x1b}, - {0x3769, 0x1b}, - {0x376a, 0x1a}, - {0x376b, 0x19}, - {0x376c, 0x18}, - {0x376d, 0x14}, - {0x376e, 0x0f}, - {0x3776, 0x00}, - {0x3777, 0x00}, - {0x3778, 0x46}, - {0x3779, 0x00}, - {0x377a, 0x08}, - {0x377b, 0x01}, - {0x377c, 0x45}, - {0x377d, 0x01}, - {0x377e, 0x23}, - {0x377f, 0x02}, - {0x3780, 0xd9}, - {0x3781, 0x03}, - {0x3782, 0xf5}, - {0x3783, 0x06}, - {0x3784, 0xa5}, - {0x3788, 0x0f}, - {0x378a, 0xd9}, - {0x378b, 0x03}, - {0x378c, 0xeb}, - {0x378d, 0x05}, - {0x378e, 0x87}, - {0x378f, 0x06}, - {0x3790, 0xf5}, - {0x3792, 0x43}, - {0x3794, 0x7a}, - {0x3796, 0xa1}, - {0x3e04, 0x0e}, {0x319e, 0x00}, {0x3a00, 0x01}, {0x3a18, 0xbf}, - {0x3a19, 0x00}, {0x3a1a, 0x67}, - {0x3a1b, 0x00}, {0x3a1c, 0x6f}, - {0x3a1d, 0x00}, {0x3a1e, 0xd7}, {0x3a1f, 0x01}, {0x3a20, 0x6f}, @@ -989,6 +912,13 @@ static int imx334_start_streaming(struct imx334 *imx334) const struct imx334_reg_list *reg_list; int ret; + ret = imx334_write_regs(imx334, common_mode_regs, + ARRAY_SIZE(common_mode_regs)); + if (ret) { + dev_err(imx334->dev, "fail to write common registers"); + return ret; + } + /* Write sensor mode registers */ reg_list = &imx334->cur_mode->reg_list; ret = imx334_write_regs(imx334, reg_list->regs, From patchwork Fri Feb 28 10:33:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan kumar X-Patchwork-Id: 869484 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE88725F7B1; Fri, 28 Feb 2025 10:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738951; cv=none; b=QrodKNmW5x05BOTYPKqca/gCS1ufzhEIzN8y/NB0qKpqRjObh4soeYDIJVMUuC7Y057FbhRO3vWhS0oTXcsYOLh9UTgX9V4WHrQTLrK6RdC6NI0OIzbhPWe9touxZLLZIX3VdGnJUGbknDcScmZs8nAdlBj0OGyVpHC8tQLf86M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738951; c=relaxed/simple; bh=/TumYJ27asLfRd0rL1BGVsrzFLAGEEw+uglJkmEtiLM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e6cXJ6WQGYLHVrpsa2ohwQ/9xOi8LrD8LNoLqQB27E4Nc7tyvCAxv+d8c/rtMFPbTGI0kUZafbg8/Qu5PhiCiPr82aqH5yghqLKK/UwRnytl8SFWSpObZdDT/l0XJUAuMjhumZ+1mFFAstD4/tOp3u/k840XHNCZ9LrxpzJRYtU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=co9KAQNj; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="co9KAQNj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1740738950; x=1772274950; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/TumYJ27asLfRd0rL1BGVsrzFLAGEEw+uglJkmEtiLM=; b=co9KAQNjQzz/QhA0CFaYHQlKdIefmaAEY0PZAuaBvhOAXS5soet016HA /xXnp4gxZfpDBvUQnNf9KV1y7u/fNIolcoFDcDdvF2kQiVWo5lNkhhIKq jQS5vjrb4kwuqnWGMDFugR8zaisrb9MCfR/6n+SLzyI58Cy+l/RB5U0JQ nO9mTPDkN+RkhYMnZFkxAGVuG9TfQ0B0S8lUaUUfz0rrXhHe4VEGtkfVS c1brbR0Ydi7ydN79GJsiLgGRcGFehVn3XgEwQXpZMQeaO7b0JuN7ItyiU 44Txs+5e8gwL2+SMmhvJzeFgWl1qZgvMngE9QzrySHd6Dg53v3/K0YDJS Q==; X-CSE-ConnectionGUID: EGT8tc8wQVmSwiJ/XsSdqg== X-CSE-MsgGUID: K36VVCg3QmabpI5NCU1q5g== X-IronPort-AV: E=Sophos;i="6.13,322,1732604400"; d="scan'208";a="38683421" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 28 Feb 2025 03:35:46 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.35; Fri, 28 Feb 2025 03:35:23 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 28 Feb 2025 03:35:20 -0700 From: shravan kumar To: , CC: , , , , , , Subject: [PATCH V6 2/3] media: i2c: imx334: update mode_3840x2160_regs array Date: Fri, 28 Feb 2025 16:03:31 +0530 Message-ID: <20250228103332.3647098-3-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250228103332.3647098-1-shravan.chippa@microchip.com> References: <20250228103332.3647098-1-shravan.chippa@microchip.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Shravan Chippa The 3840x2160 mode operates with the imx334 reset values. If we switch to other modes and then return to the 3840x2160 mode, it should function correctly. so updated the mode_3840x2160_regs array with the imx334 reset values. Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index a800f2203592..f80a8ce8f9c5 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -344,6 +344,12 @@ static const struct imx334_reg mode_3840x2160_regs[] = { {0x302d, 0x00}, {0x302e, 0x00}, {0x302f, 0x0f}, + {0x3074, 0xb0}, + {0x3075, 0x00}, + {0x308e, 0xb1}, + {0x308f, 0x00}, + {0x30d8, 0x20}, + {0x30d9, 0x12}, {0x3076, 0x70}, {0x3077, 0x08}, {0x3090, 0x70}, From patchwork Fri Feb 28 10:33:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan kumar X-Patchwork-Id: 870365 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D07D425DCE5; Fri, 28 Feb 2025 10:35:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738936; cv=none; b=L6ZpXaHgzO8z57sjUVZgBeBVSB6YoMQccH0epKUNjW/KLAH5NwHXIPRoUiy4uxrv3sAwRZr0QqkwWK89wc73CKulY09lisVs1ZqBsGm0uZW6R6K07O6pKPx4ckTanPJlZG0ewWxCb113yZQVQAC3XCJgn5vFkuA3vur76mirdoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740738936; c=relaxed/simple; bh=DHSdtp+XdtA3NPlxrJ57qvr55VazblL+nsCKRKoaPpo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dQa1LhN83WMRxgzvmRPw6vcVnEhCvyMV4lctFpjfvdZF46wH53z8sisncSbQvxXiqK+6UASF6YtupPJ48JtP1E56nX0WyU+/mRWL5UU2Fii7Bar2soxDLMa4jIoZmAh6Yk6gU1ixvTjKvfMmWb5fu0upyfEQxIs6aZCwOctGrfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=rA61Ea4E; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="rA61Ea4E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1740738934; x=1772274934; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DHSdtp+XdtA3NPlxrJ57qvr55VazblL+nsCKRKoaPpo=; b=rA61Ea4ETnupT3PKS7nHqTqebqA84e9tvRrVDM+o61kMhGejeg6tR3ii OxrG16MeT14Lfb7CjImMsG/lftNMFBzlPkIDSRsVV284Xy/NJupTljTUO ZnY+G4GXjlOGkbmf5gfIHHUnYvDLZigqKAVPLOmVCxAPbN4lRMzUQxPcQ h0SrePD0j8RUZxXUM2s27NwVjA1mch54ZITWZQXGkbOmOnItwCNTml6Kj DmfYtlB98dgrZJHbSargbkDqTxxbadUjii47k0jFBotTtaCphidikSMwl p137FVX/AKquTNpfho1gGNejW5OL+C5jPDDhlTNU75pk34gmasnZU5Bqo g==; X-CSE-ConnectionGUID: JknLepFYT8+gGnbGNwKrzg== X-CSE-MsgGUID: euHk0iX9RZ6/bFeHB0LeVg== X-IronPort-AV: E=Sophos;i="6.13,322,1732604400"; d="scan'208";a="205787153" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 28 Feb 2025 03:35:33 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.35; Fri, 28 Feb 2025 03:35:27 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 28 Feb 2025 03:35:24 -0700 From: shravan kumar To: , CC: , , , , , , Subject: [PATCH V6 3/3] media: i2c: imx334: add modes for 720p and 480p resolutions Date: Fri, 28 Feb 2025 16:03:32 +0530 Message-ID: <20250228103332.3647098-4-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250228103332.3647098-1-shravan.chippa@microchip.com> References: <20250228103332.3647098-1-shravan.chippa@microchip.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Shravan Chippa Added support for 1280x720@30 and 640x480@30 resolutions Signed-off-by: Shravan Chippa --- drivers/media/i2c/imx334.c | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index f80a8ce8f9c5..b8d63e0fad66 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -314,6 +314,46 @@ static const struct imx334_reg common_mode_regs[] = { {0x3002, 0x00}, }; +/* Sensor mode registers for 640x480@30fps */ +static const struct imx334_reg mode_640x480_regs[] = { + {0x302c, 0x70}, + {0x302d, 0x06}, + {0x302e, 0x80}, + {0x302f, 0x02}, + {0x3074, 0x48}, + {0x3075, 0x07}, + {0x308e, 0x49}, + {0x308f, 0x07}, + {0x3076, 0xe0}, + {0x3077, 0x01}, + {0x3090, 0xe0}, + {0x3091, 0x01}, + {0x3308, 0xe0}, + {0x3309, 0x01}, + {0x30d8, 0x30}, + {0x30d9, 0x0b}, +}; + +/* Sensor mode registers for 1280x720@30fps */ +static const struct imx334_reg mode_1280x720_regs[] = { + {0x302c, 0x30}, + {0x302d, 0x05}, + {0x302e, 0x00}, + {0x302f, 0x05}, + {0x3074, 0x84}, + {0x3075, 0x03}, + {0x308e, 0x85}, + {0x308f, 0x03}, + {0x3076, 0xd0}, + {0x3077, 0x02}, + {0x3090, 0xd0}, + {0x3091, 0x02}, + {0x3308, 0xd0}, + {0x3309, 0x02}, + {0x30d8, 0x30}, + {0x30d9, 0x0b}, +}; + /* Sensor mode registers for 1920x1080@30fps */ static const struct imx334_reg mode_1920x1080_regs[] = { {0x302c, 0xf0}, @@ -434,6 +474,32 @@ static const struct imx334_mode supported_modes[] = { .num_of_regs = ARRAY_SIZE(mode_1920x1080_regs), .regs = mode_1920x1080_regs, }, + }, { + .width = 1280, + .height = 720, + .hblank = 2480, + .vblank = 1170, + .vblank_min = 45, + .vblank_max = 132840, + .pclk = 297000000, + .link_freq_idx = 1, + .reg_list = { + .num_of_regs = ARRAY_SIZE(mode_1280x720_regs), + .regs = mode_1280x720_regs, + }, + }, { + .width = 640, + .height = 480, + .hblank = 2480, + .vblank = 1170, + .vblank_min = 45, + .vblank_max = 132840, + .pclk = 297000000, + .link_freq_idx = 1, + .reg_list = { + .num_of_regs = ARRAY_SIZE(mode_640x480_regs), + .regs = mode_640x480_regs, + }, }, };