From patchwork Thu Nov 14 16:01:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13875342 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D359B13B288 for ; Thu, 14 Nov 2024 16:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600108; cv=none; b=CzYggc2lw9HXYIzdsmNTiP9mfdKC8QhAXl6ZMAdky8SoXRP6MYuZDLBnZWg3+12Uqb0A4izDlfInzwjBPEG1yrKop3U6x+2Ls+erawk+BQrUXMTcxv7jb/yWjMOwzi4pWV+8jkeAJvIKRzgPQJBRPiNwWvIb6CHZ48vqZHZUacc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600108; c=relaxed/simple; bh=RgRcDTZ0cd2d3Z1miPXnLWTGyap0Y17dAsHzTAg8FY0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A4A0VoT4vmWAh3TeJpT756i5WF3OV4+5LM3faIl0U7ZeLafq3lwZ/Kf+Yqi9iyvAuukJHGSBznd0nWFhMrRpElC/0LynFYct+u53SKKCfEjI1WOp+3uv8X5xJZd81dHN2/r+sF9/ButIVAhVIjd+r9Gp5PEUEUEGNhxcqWTd0Ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=t5sW2ywD; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="t5sW2ywD" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-53da07b78dfso857750e87.0 for ; Thu, 14 Nov 2024 08:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1731600104; x=1732204904; darn=lists.linux.dev; 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=T7c9J9xmOBZy0E+gA1j8HfGDniMhcLFy7E+lLxJu1Tw=; b=t5sW2ywDZVHTEwPXusylv+tJsV6eBBo9hSpqgVhRPQC4ECCwoIze8mKMOGJei5F9zZ 1YAh4G97JQNWOiRivZEm6CBlZuhwkczu83EraTsXir4HkvxjBowe/Q5xTzQrYrVRZrpT QamfM/SMzg0ECo5N1RUMawDBAszK2WgH+aCjNzgTETG5kM/lC24vjl74bHKW5AY9JCcS RPapfbx3csVWFgKggZwOeWE8tmq3+cyW9yBpN5Yn0fGyoQ9RvLo/U6f/DnJp/feMPT2c yv1FN0EAc1wMaKPvGJ4vV5WI1u+dVCA4z1ykJwRKf4fxCpaQeeCWdaV2paIVdSlkYqe8 qxZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731600104; x=1732204904; 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=T7c9J9xmOBZy0E+gA1j8HfGDniMhcLFy7E+lLxJu1Tw=; b=V/XY+Ie3OdCAQHE12vcy9UJZ+flOYuqgKLcGapDPlVZqgK4hJJyKTKQHLfzeozrNBj 8MeBrQG1LFxnGmVAwzz8BfegQ6h9bFlGTj3lUdZ82T3kcGmlAUvhCs89uktyOJp6vRNT CiKrMm9nz3gI5uaLYglp6HmEUzUfOvVZ1YYnFrVPsRB21kbWAeIAn4seSVfUVfONXXTK xHLHPYwVaOg2ckJBE08+DvmSGo2v/0gi3jicfdTyotUch2DxAYougKU0DhNMvS04w5FF MudOMwWvhXtilZs+O6EtA/6FyV95PZs0QcKJa1jWvYzYPA5efINROYK/dt6JcNgXqlkz n3uw== X-Forwarded-Encrypted: i=1; AJvYcCVEuenmLuZjiXO/7YPP15oh/hWv8RyyU9RBxZ2P+06u+gLuEUCM0BkVf1sCM8Yh+mNTwVI=@lists.linux.dev X-Gm-Message-State: AOJu0YwXo2U/JB+rGdzGxXAOxxsKQYMKCwR4hs/ZHKjQUDV0F3oPR5H7 z+weQOfcXBcYdj9Yu8DZG6HNM1x7vTxXJfDVQLf3n7VgA7XR7jtwjEzHKRnep0g= X-Google-Smtp-Source: AGHT+IH2B2O4sDgX4PQFuQz83D5q69hXTp9OqNeMo5HRiiv9F39wpipZ5EJMNQCetw5Zzb0qXWSGxQ== X-Received: by 2002:a05:6512:3b1f:b0:539:f807:ad93 with SMTP id 2adb3069b0e04-53d9feddd90mr4485395e87.38.1731600103640; Thu, 14 Nov 2024 08:01:43 -0800 (PST) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-382200fe00esm1139024f8f.42.2024.11.14.08.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:01:43 -0800 (PST) From: Dave Stevenson Date: Thu, 14 Nov 2024 16:01:13 +0000 Subject: [PATCH 1/3] media: i2c: imx290: Limit analogue gain according to module Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241114-media-imx290-imx462-v1-1-c538a2e24786@raspberrypi.com> References: <20241114-media-imx290-imx462-v1-0-c538a2e24786@raspberrypi.com> In-Reply-To: <20241114-media-imx290-imx462-v1-0-c538a2e24786@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 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 The imx327 only supports up to 29.4dB of analogue gain, vs the imx290 going up to 30dB. Both are in 0.3dB steps. As we now have model specific config, fix this mismatch, and delete the comment referencing it. Signed-off-by: Dave Stevenson Reviewed-by: Laurent Pinchart --- drivers/media/i2c/imx290.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index ee698c99001d..da654deb444a 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -176,6 +176,7 @@ struct imx290_model_info { enum imx290_colour_variant colour_variant; const struct cci_reg_sequence *init_regs; size_t init_regs_num; + unsigned int max_analog_gain; const char *name; }; @@ -876,14 +877,10 @@ static int imx290_ctrl_init(struct imx290 *imx290) * up to 72.0dB (240) add further digital gain. Limit the range to * analog gain only, support for digital gain can be added separately * if needed. - * - * The IMX327 and IMX462 are largely compatible with the IMX290, but - * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital - * gain. When support for those sensors gets added to the driver, the - * gain control should be adjusted accordingly. */ v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, - V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0); + V4L2_CID_ANALOGUE_GAIN, 0, + imx290->model->max_analog_gain, 1, 0); /* * Correct range will be determined through imx290_ctrl_update setting @@ -1441,18 +1438,21 @@ static const struct imx290_model_info imx290_models[] = { .colour_variant = IMX290_VARIANT_COLOUR, .init_regs = imx290_global_init_settings_290, .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290), + .max_analog_gain = 100, .name = "imx290", }, [IMX290_MODEL_IMX290LLR] = { .colour_variant = IMX290_VARIANT_MONO, .init_regs = imx290_global_init_settings_290, .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290), + .max_analog_gain = 100, .name = "imx290", }, [IMX290_MODEL_IMX327LQR] = { .colour_variant = IMX290_VARIANT_COLOUR, .init_regs = imx290_global_init_settings_327, .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327), + .max_analog_gain = 98, .name = "imx327", }, }; From patchwork Thu Nov 14 16:01:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13875343 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34F3516ABC6 for ; Thu, 14 Nov 2024 16:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600109; cv=none; b=CnVd/fxElK9QLwU7CuBIDGyVhkrRYxMpwTnBDYM+HOl7UXs/ac7RysLQNTu0gLadleCyK90TzlHDUSvByBsjUhepZ9bhiMM/4c8rZxWnSU69/bZGGhAk3MC1u8patLjo6kK6SO+BgSZPLiRaJi2Iu0PUFsAiDXAQWbFk+si6FqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600109; c=relaxed/simple; bh=LLKUlHSRdQo0ASKheAI2lktC1qkTUKqGMf38rCFKTT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F+W0qimWpErlxhJz1FdSY32PtsgP4JRTnFTCxBJA7jwFU94SRTIkOmGaLYQ4axwRpVabk9k7fVerpqZjwB8i47fR9BQX5p7H8o42kdjmPZ6x0Q+7jhQWrvjjd8qtPbXtnh3MRbeZd3rj3WcvRdyoVQK5JZo95tAkz7fvt1lkaf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=IoSeTYtR; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IoSeTYtR" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3821c5f6eb1so473862f8f.3 for ; Thu, 14 Nov 2024 08:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1731600106; x=1732204906; darn=lists.linux.dev; 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=6sBEsvd+dgZ/xP6/kn7wo3kVN9KTyz4HVn9G9Q/OIqs=; b=IoSeTYtRn4Ii4rAcFOlKBY1DHVtB+kB2pnzEQ7AFiaK+GlGC7bccI5JXDNdYaRpBEA dYIojqg1hcmDTUCuEHBfbuy3j989GiBBQ+nkGEd7dtFjtaWpqRZBPYMRxxeOHtB0ibd4 G3/0bERRUDUb2iyTriddfywcmQuABvCRS4CtaTwcOiZYuMyzUfqAnlLmTnycV22+s9gn mMY3xgtbOTj2IFOzblAQRNdH/6lD9kMr3+ioomQPQhEG2ro0GQtIzcswivalcZfQs39y QLqx2u1a2AdGYGa9QDjD1MexyZYHKBYThh3MUL0l0lkigdaS0ohPGL82OVMr+Fzthv2P QGbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731600106; x=1732204906; 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=6sBEsvd+dgZ/xP6/kn7wo3kVN9KTyz4HVn9G9Q/OIqs=; b=n88mMmG1XkoM9iEr/N3ccSWVyUSlLF4bkLleummtGzIFnKVZEDn6mclhEIWaulDQnQ WiPHxyEfR1kBt8s1IVzk6S4uPviOxhJ9s9PNQlySK7yanTHRH1Zif4SDROIbJDcGNNqs nrz00Gf6CQimfVaLtydnTFATkm828LGM9iarkO7Ob33j7qJgyqevWyTY3AxSZjGVmSRr cx6DytflrgJYCjZJGca3ruASut+CJscDd28h7nNIGfSr+71NoEe5v1UBkSEF88qsCqvW CJKstAs/ZGmcOJzxNPyI+Npk4panz3IzOrfTMg3/0z0Lr0XWaL3pUs1uPw2/HFw1yYu4 MMig== X-Forwarded-Encrypted: i=1; AJvYcCUZTVge9oxTVmjz5FUgyorkDpWQh6BQ6p9QWzCIxNwZ0OagUwKHsfXtmBTl4DkLNXn3f3M=@lists.linux.dev X-Gm-Message-State: AOJu0YwXTrCfzcJZ0cAoGliXznjgAxGBI+jlHW4MFrU+S/gruxpkB3n0 eSpqREVmuy6r6LiCimBNijL0G/x4V47rvu8oQVMDxt/WIB//PKfAnHZDvqfER3Y= X-Google-Smtp-Source: AGHT+IG4Sy0eRFWGgQ022WtiTP8SuksgBmcBl+ihey6/w0qCP+GyJB1dxeBjLookfEv7e1llkV/zYw== X-Received: by 2002:a05:6000:18a9:b0:37d:4ebe:164f with SMTP id ffacd0b85a97d-381f1883d96mr22287017f8f.46.1731600104522; Thu, 14 Nov 2024 08:01:44 -0800 (PST) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-382200fe00esm1139024f8f.42.2024.11.14.08.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:01:44 -0800 (PST) From: Dave Stevenson Date: Thu, 14 Nov 2024 16:01:14 +0000 Subject: [PATCH 2/3] media: dt-bindings: media: i2c: Add IMX462 to the IMX290 binding Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241114-media-imx290-imx462-v1-2-c538a2e24786@raspberrypi.com> References: <20241114-media-imx290-imx462-v1-0-c538a2e24786@raspberrypi.com> In-Reply-To: <20241114-media-imx290-imx462-v1-0-c538a2e24786@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 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 IMX462 is the successor to IMX290, which is supportable by the existing IMX290 driver via a new compatible string. Signed-off-by: Dave Stevenson Acked-by: Conor Dooley Reviewed-by: Laurent Pinchart --- Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml index bf05ca48601a..fa69bd21c8da 100644 --- a/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml +++ b/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml @@ -33,6 +33,8 @@ properties: - sony,imx290lqr # Colour - sony,imx290llr # Monochrome - sony,imx327lqr # Colour + - sony,imx462lqr # Colour + - sony,imx462llr # Monochrome - const: sony,imx290 deprecated: true From patchwork Thu Nov 14 16:01:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13875344 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E7F517332C for ; Thu, 14 Nov 2024 16:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600112; cv=none; b=YhQ5sJESxvGu51TWFfa3Wy0DXdWlG8VQfGIyl02ERaeW2FESYs7gDDlHZpDPPzsGeVbmMhEOjdRJg1WMQdVmPbq/GFnf6311wuHQBQiH2nkTEzIf15M6mqoeWiiUHBYwab3hH0LSwlLYjWbzFT9gKTe949M3ji9M0Y0nLkQF+aI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731600112; c=relaxed/simple; bh=2p5+br6JIn+rJJ5IqmSnGy2w4CU6wjDoK+kbpSR+fYo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NFFpy2X7hYZoLuMgCCVgobcpmD2VxrZRFPiHNedLXNY3LHCtb3zyquN9TzzUGdWkWj0mh6Y1lpfC7YPucEMmB0dSQU0G4VY++V4vC8kx0U0Bx77Q7vaOWj2qhWJnBi2tn+aiyFyeiT18vATANgIZ2ULTXOiouxLeXPdYVaZ0cLc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=IhRj/+pj; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IhRj/+pj" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43168d9c6c9so7153755e9.3 for ; Thu, 14 Nov 2024 08:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1731600107; x=1732204907; darn=lists.linux.dev; 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=v2eGZqhXUh+UAPCtYMe67IF8Tywre6OlhMFZoVB/+W0=; b=IhRj/+pjKeqhT0pG+Jna7YI1EONdUvoyWvRAqeVRJbpcQh4Ciry6Ca34DSKchs64MI lgswsGvAFuvrhq+qUVtcCfTX634HOh4YIh8G3q2aY/u7EWMq3o2kX1ZwmAE0Qcj9imE2 V1PlZvCXx9rWyXIH4L+KHvFrhQOmt2fNvKFdLLgZrZ3xKZBmQPRCCDiseNhX2YB3DduR QZUMJMX/fcFZnR+lZ0c1lLhzZx0QD2fhDFcttXnwGBLbJ/BinNo8Gkc7NOz5ROLfkMFa 21W+zNNN5bW2927gqlx7ZmVREjqWKQQ/BkITP+EJ8Mp1MScWvumnYPI0uFHElhRaEK44 nGQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731600107; x=1732204907; 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=v2eGZqhXUh+UAPCtYMe67IF8Tywre6OlhMFZoVB/+W0=; b=WHWUxdom7wWFtDNIaZUB/mbJllpidlA1iWfoYZKDq8sUAMgd8RXOzSKxy8+E+mm8pM 9Ps76KgY8ENA8XI+bNwYM/YesG27kYhy3gtY2u38bi7ROdh27epx/QFXCMob0Or3bZVl IPo8ffT8TO5KiyFXi9X8BWoiM/vDissEFvzH+k+p0n41v5LnBB3k3zbi8lJoQy+wV02w 93RhexD3kBrdAsWMofUYRhHSR/gBIL50CCDqR/wCVDijK6LSleejBIhWRq/wKFQ4+Fhq uA/eDENAsSc5KLiM5xN1/L3jFKI7QrKxD59ThAcwcRv3YqaSX8frnJhzBkKMNEAWQ0Yn DBjQ== X-Forwarded-Encrypted: i=1; AJvYcCWQA80Qji4nXteEZKYhlOVKqKBPDpuCoOM4Y53oal04spSl8OtdiU9rhFxFkqHIXtn1K3E=@lists.linux.dev X-Gm-Message-State: AOJu0YwaBeynFJPX5uOKB017xuWSN+d0LGgAW1R2WkEYLZo3QylLLTVF 0K4XS/RgQDXKG+wxc+Ntg/VmJ8nXBR7ikiuwK9IME5/WWQmny6n4Ep2vNL0I9zg= X-Google-Smtp-Source: AGHT+IE41nl/kifwf5C3HD2lfOIE9l4CR33KFQ7CwfYgwG7tlg4gz09KKD06z7z6kibfjOlL9Rmy5w== X-Received: by 2002:a05:6000:1f82:b0:382:222b:1320 with SMTP id ffacd0b85a97d-382222b168dmr586958f8f.22.1731600105381; Thu, 14 Nov 2024 08:01:45 -0800 (PST) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-382200fe00esm1139024f8f.42.2024.11.14.08.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:01:45 -0800 (PST) From: Dave Stevenson Date: Thu, 14 Nov 2024 16:01:15 +0000 Subject: [PATCH 3/3] media: i2c: imx290: Add configuration for IMX462 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241114-media-imx290-imx462-v1-3-c538a2e24786@raspberrypi.com> References: <20241114-media-imx290-imx462-v1-0-c538a2e24786@raspberrypi.com> In-Reply-To: <20241114-media-imx290-imx462-v1-0-c538a2e24786@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 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 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 --- 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 da654deb444a..f1780cc5d7cc 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] = { @@ -1455,6 +1501,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) @@ -1653,6 +1713,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 */ }, };