From patchwork Wed Nov 20 19:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13881428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56CF5D743C7 for ; Wed, 20 Nov 2024 19:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zitwIFEHcuodW9TqUQcqtnx2dFAFSgL0NQQ869EFe3Y=; b=uC2A+F/pgU29Ujxzc9ufwALlXP r92c1K22NGC8rvjqPKijmKrxoaCiYoJSgPdE90kw80B3yg5KJS50riuliHQRQJFq8IbzuuDiu83HL AZil2NISm5wGwtOcFkhSO+1ibTPlEc9V38ZSJoPyig0nK+4MOd5Oi44RX7Jh5+9TnhLkspoZZJUkz aw8K+0PWkO9wEMZKB2BzIBIGSO0GPozTnhQQbtXF7oQRJahmqRfRrdkHCT/CYeKQdUDQStuh96g0L kwebc0wEs6g+bW7raM8YCi3MBXnexl6wsZ7WeKOtRloD6HNaeg9jbJXEi4r+h938O3Y+fbXWjUCLx AYF0jZQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDqHK-0000000G7Cl-49FP; Wed, 20 Nov 2024 19:22:18 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDqCl-0000000G627-1JcM for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2024 19:17:38 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3824446d2bcso26375f8f.2 for ; Wed, 20 Nov 2024 11:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732130253; x=1732735053; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zitwIFEHcuodW9TqUQcqtnx2dFAFSgL0NQQ869EFe3Y=; b=jP+sLJvpVT1TtYkP49oZT12HeUgcjaQtFuTdk2D7bMWAM0nSOEsDfc7mNA5W/oWRPO 2YqGPNuwXm/O7fGH/aTuvC7sOYsm/JRpjrjHJAMaEX8OdGS7HCfPuHv+ElJvQyFdUq1d Lsh8uk9LRzMfubg1mzyCW1yQAycBpysyBtdTeZweSR8oOXx+DNYyp8gfDz32UI3mrDKE LczBe7PFXdOfcBLeCHwrWD541Yot4Ambks1JT0hnaCyVXI97eHt6VLM5wLpqfegvk0Nh p2GqGuEX0ctaXkNcOr+zFz2rYkzikrbXhm6NTK+SyOTYjy3ejnWznjM9pGNU4f++FD36 F3lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732130253; x=1732735053; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zitwIFEHcuodW9TqUQcqtnx2dFAFSgL0NQQ869EFe3Y=; b=cJ5z4JD0SPEqGLJQ32vt4eJBWXL6dPgHxwSq+bqteEQNlpfPEsxJ7WdXejqdTcMEwz QfT1J8dFShFLkJ2DKlH3NjEri28vkR77RoPGY/5MjWqYaPzF85v4rC8bDhqe1iOMS1BY 0VvVG0nB+GRKuR1UVHQesuriHD3pSBeLe+TYC3KusecSoJPX39Vl7XekDVvm5jFekUHE Ea/v1GmgfO77T5fPueeZq53znqQG5kpFSobC3fvdFynkqCx13vQuJYGUHryUUrtd3TmD fgw0GfCbTAHUuqk3YYxhRjsxO1LL79f/WZYhvtm8B828Y/VLXlfau6uJUmu13xpaabC6 aWGg== X-Forwarded-Encrypted: i=1; AJvYcCUaqNqGvXde30ae94mSY1nEsGogUihgHCuVmJ5E7egqqT+gcH2AgnPjAVxi85vNOB9EneUBTOgKkdFEV1aUzFom@lists.infradead.org X-Gm-Message-State: AOJu0YwweKyW2ru+KVLibzTxvMP32xykpN99o6CTxJ8fJl5OMsrlEC6g yJDVG/Sre6U4jtR58U+iiF9IK/bh7t0MyGKYldgLKYj0ncdrm7CXVH3UDcQiHWY= X-Google-Smtp-Source: AGHT+IGDyoH11Pb2u0yiBU+8Fdfd66KoXkLqC8DdXiQbdQWJ60b113ZzD+VLCAp8swQ0TH5bSW7kRg== X-Received: by 2002:a05:6000:1fa3:b0:382:1b40:46ec with SMTP id ffacd0b85a97d-38254b25beamr4007449f8f.59.1732130253271; Wed, 20 Nov 2024 11:17:33 -0800 (PST) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3825a2c5ef2sm172457f8f.53.2024.11.20.11.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 11:17:32 -0800 (PST) From: Dave Stevenson Date: Wed, 20 Nov 2024 19:17:06 +0000 Subject: [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462 MIME-Version: 1.0 Message-Id: <20241120-media-imx290-imx462-v2-4-7e562cf191d8@raspberrypi.com> References: <20241120-media-imx290-imx462-v2-0-7e562cf191d8@raspberrypi.com> In-Reply-To: <20241120-media-imx290-imx462-v2-0-7e562cf191d8@raspberrypi.com> To: Manivannan Sadhasivam , Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Laurent Pinchart , Alexander Stein Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Dave Stevenson X-Mailer: b4 0.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241120_111736_030793_D25E1CCC X-CRM114-Status: GOOD ( 12.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org IMX462 is the successor to IMX290, and wants very minor changes to the register setup. Add the relevant configuration to support it. Signed-off-by: Dave Stevenson Reviewed-by: Laurent Pinchart --- drivers/media/i2c/imx290.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 7d794a509670..3bad7779d0d0 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -170,6 +170,8 @@ enum imx290_model { IMX290_MODEL_IMX290LQR, IMX290_MODEL_IMX290LLR, IMX290_MODEL_IMX327LQR, + IMX290_MODEL_IMX462LQR, + IMX290_MODEL_IMX462LLR, }; struct imx290_model_info { @@ -316,6 +318,50 @@ static const struct cci_reg_sequence imx290_global_init_settings_290[] = { { CCI_REG8(0x33b3), 0x04 }, }; +static const struct cci_reg_sequence imx290_global_init_settings_462[] = { + { CCI_REG8(0x300f), 0x00 }, + { CCI_REG8(0x3010), 0x21 }, + { CCI_REG8(0x3011), 0x02 }, + { CCI_REG8(0x3016), 0x09 }, + { CCI_REG8(0x3070), 0x02 }, + { CCI_REG8(0x3071), 0x11 }, + { CCI_REG8(0x309b), 0x10 }, + { CCI_REG8(0x309c), 0x22 }, + { CCI_REG8(0x30a2), 0x02 }, + { CCI_REG8(0x30a6), 0x20 }, + { CCI_REG8(0x30a8), 0x20 }, + { CCI_REG8(0x30aa), 0x20 }, + { CCI_REG8(0x30ac), 0x20 }, + { CCI_REG8(0x30b0), 0x43 }, + { CCI_REG8(0x3119), 0x9e }, + { CCI_REG8(0x311c), 0x1e }, + { CCI_REG8(0x311e), 0x08 }, + { CCI_REG8(0x3128), 0x05 }, + { CCI_REG8(0x313d), 0x83 }, + { CCI_REG8(0x3150), 0x03 }, + { CCI_REG8(0x317e), 0x00 }, + { CCI_REG8(0x32b8), 0x50 }, + { CCI_REG8(0x32b9), 0x10 }, + { CCI_REG8(0x32ba), 0x00 }, + { CCI_REG8(0x32bb), 0x04 }, + { CCI_REG8(0x32c8), 0x50 }, + { CCI_REG8(0x32c9), 0x10 }, + { CCI_REG8(0x32ca), 0x00 }, + { CCI_REG8(0x32cb), 0x04 }, + { CCI_REG8(0x332c), 0xd3 }, + { CCI_REG8(0x332d), 0x10 }, + { CCI_REG8(0x332e), 0x0d }, + { CCI_REG8(0x3358), 0x06 }, + { CCI_REG8(0x3359), 0xe1 }, + { CCI_REG8(0x335a), 0x11 }, + { CCI_REG8(0x3360), 0x1e }, + { CCI_REG8(0x3361), 0x61 }, + { CCI_REG8(0x3362), 0x10 }, + { CCI_REG8(0x33b0), 0x50 }, + { CCI_REG8(0x33b2), 0x1a }, + { CCI_REG8(0x33b3), 0x04 }, +}; + #define IMX290_NUM_CLK_REGS 2 static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = { [IMX290_CLK_37_125] = { @@ -1456,6 +1502,20 @@ static const struct imx290_model_info imx290_models[] = { .max_analog_gain = 98, .name = "imx327", }, + [IMX290_MODEL_IMX462LQR] = { + .colour_variant = IMX290_VARIANT_COLOUR, + .init_regs = imx290_global_init_settings_462, + .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462), + .max_analog_gain = 98, + .name = "imx462", + }, + [IMX290_MODEL_IMX462LLR] = { + .colour_variant = IMX290_VARIANT_MONO, + .init_regs = imx290_global_init_settings_462, + .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462), + .max_analog_gain = 98, + .name = "imx462", + }, }; static int imx290_parse_dt(struct imx290 *imx290) @@ -1654,6 +1714,12 @@ static const struct of_device_id imx290_of_match[] = { }, { .compatible = "sony,imx327lqr", .data = &imx290_models[IMX290_MODEL_IMX327LQR], + }, { + .compatible = "sony,imx462lqr", + .data = &imx290_models[IMX290_MODEL_IMX462LQR], + }, { + .compatible = "sony,imx462llr", + .data = &imx290_models[IMX290_MODEL_IMX462LLR], }, { /* sentinel */ }, };