From patchwork Wed Nov 20 19:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13881425 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 115C6D743C6 for ; Wed, 20 Nov 2024 19:19:42 +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=QgfFBue2AkaNv5wDd17S+yzXIWjDIT3WyGaTAc0rklw=; b=vtZChRfSItZS+cEm2W3BE7TjJR kO6IS1aDq/wNb5w+ZpM79ucZDN5wRyp9591hGprtip8UgvbpGY2KVNQMoEfeC3iSytQHTPuy78pS7 IFK9aMbUUEZJTht8Rd1ZvAWyXek+seTYVeCnIEReOMyAtAtSjkkbp7eEo51IAISzNq4soTT3Bt7j3 OUzcIvFI/ykkG9JImC803GN58DHYZ7LcEJqxdnJT35Ed50p/TbGc+8rCsDxP2/3FqdoN4RNyZgPhy XQnI/M1TT4u8kxcNkfxs1vzrJyxW+rRzdremNTIVGzGLFKPrx8U+ocJmPiD/V/fcWpSqebYDbo+L2 H1/Y7C0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDqEc-0000000G6Pd-0YyH; Wed, 20 Nov 2024 19:19:30 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDqCi-0000000G60t-2GOk for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2024 19:17:33 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3823eaad37aso816703f8f.0 for ; Wed, 20 Nov 2024 11:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732130250; x=1732735050; 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=QgfFBue2AkaNv5wDd17S+yzXIWjDIT3WyGaTAc0rklw=; b=b/eJ5vY3vLCSu2ZTbGAWZRPc+6cMlHsnQ9oy9hJWZdmMq2hACj01a5Dv9LCsxoRJAv u3eDyisd4ZewkKaPi0ZqG5SEy86bT+PiizEHg1H3NT3xDucTtXDKIgjH+gWbR5geroIG 4bE5xoeVzF5CDNlV2BZ0RbXe0qLqPFuUtCOyBJFrm+rnD5Lyq/70Y/TU1JDpcwY1pSdI x1LyCt5hg3vVuGOT4JYn79lXHVOSK0IBlPXpKfel/mYNHEuflmMnuOoFzAd8BPT+Gp6E tayS+AQS+zQ6VCQimqcev+dvuu3hKDZw7pVRC2MwJT34qrR+HW+/43b9OoW6Tx1ZVugV c4Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732130250; x=1732735050; 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=QgfFBue2AkaNv5wDd17S+yzXIWjDIT3WyGaTAc0rklw=; b=lRDeavaF13JVfwhKGHb6DezgPIvlIOR6dH3pY+BjclgBGWYSGxaGRctoS29p2lMIkc mzUfOa7F0L/skJKKtJHDiLNm6HQZuH3cPVwMmUsw4b5EMH6DE0j72okGtAnppz0ADwUq k6TENFX6nFnRErRtbu8PDT84iu7SuqlauTMTkF9wM4lw/pVbRGw5ZzNdqJTWFnMRuDfU 7Ev4EUPPRrp3UFdbQ0gF6J+kFJY7l2l+JgtEOzwrElgJMzmMevzeoIGOnf19YposCNVX /PCKdY9XuwQTmZs3HNi7lwSyTG6YttbyYDsCEGPBaXS56avkM/t3YsYMSJPXxLR0ado6 4nKw== X-Forwarded-Encrypted: i=1; AJvYcCWRpp/dQQtHR7B9b4CiCbo358M92W9xFvHyAj2PeIqO+d74QubwlziCXtIsTM0wkHlzfTxJ+xUsjomLJ/IbT+mA@lists.infradead.org X-Gm-Message-State: AOJu0Yy8OnZVZxlxmbtMZL3Kvvh6fN4qQWhAbzxpvVBscCb+WQYaHc6B bzAffWq9TNaTOs4AhuxWp5LKf8qOT+OwopqLOmjphv5m3Rpbk0g4MVDzy1Kj5pQ= X-Google-Smtp-Source: AGHT+IGRjU3aR6hDFtQjH3HQ8wJcv1fdKmnNHnvgyBmRdYlp1FR7+auWuZyFrR8i92B4uErsUqc05A== X-Received: by 2002:a5d:584f:0:b0:381:ed32:d604 with SMTP id ffacd0b85a97d-38259ccea2fmr432108f8f.10.1732130249896; Wed, 20 Nov 2024 11:17:29 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 11:17:29 -0800 (PST) From: Dave Stevenson Date: Wed, 20 Nov 2024 19:17:03 +0000 Subject: [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module MIME-Version: 1.0 Message-Id: <20241120-media-imx290-imx462-v2-1-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_111732_581097_4103605E X-CRM114-Status: GOOD ( 14.96 ) 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 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 Wed Nov 20 19:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13881426 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 9885FD743C7 for ; Wed, 20 Nov 2024 19:20:40 +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=w9/cR/dqviroqX2VCS26LbceoYUIdqbcsui+WHfkKVw=; b=feT0mZchKGKgvfDS/MDVCnDWVC f4ZA9PiCAXmA3Q8524jSQvpGiiDblzSmjpz5FIcByUuzYcJX3rFcc7wIhWtOCFn4z+RGCWEbZirLf ZYA6A0op6MJfgKwCnkyXuXdSUqQkLhH3hOvtH6Dt2JszJSP/0zPxdvR4YWWXyt2o3iS0YAiWCHQFq ngai6Ite60UcaL366Optd4bloLmG4QoRACMtw4xDRgz9Kz1SCZRv1TvnCbpQTW8OgRT6TiFNT33GA ntXzk0OzCy00FtKvtHsMpFpQPb2bV5XL8TqLIOipM4kqGkHka6S0SZR1NM1JEtBsWM3B+kIx2iZDh n8UCtNaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDqFW-0000000G6nm-3CHT; Wed, 20 Nov 2024 19:20:26 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDqCi-0000000G61A-3gj1 for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2024 19:17:33 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3822ec43fb0so23130f8f.3 for ; Wed, 20 Nov 2024 11:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732130251; x=1732735051; 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=w9/cR/dqviroqX2VCS26LbceoYUIdqbcsui+WHfkKVw=; b=Qyn5smVmkrmJa7SfP/s3/XxLA4DScDuNRxd52jv4RFPZiNea20ViG0UH3ar7K7AirC EK0P00wtZ/X6Mm7Op//R2EYg3xlb4Ujw8xwLe9Qbm+nDxJBDTfYK3GPjytg3rViTEpcw qJLg9jT9hjVidNX54Qm7XOqvsxQaqHS8Mz5ToQ0AThCjK+CX7Ahu8BM7xhZAn55MLu4h a1+NTHiOFgp2qhT89wMWSXYSDsM/2Vxjp6Q+z6hDQa5zaxz7mjuACmH1QQVvsgAFNZUU OI0Eyqg8T371OmzPytpeyi1jwHpVKmZAwPWHZytyRUWQrnCs+tvWDkIAZ+YqRoiev2K3 sclQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732130251; x=1732735051; 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=w9/cR/dqviroqX2VCS26LbceoYUIdqbcsui+WHfkKVw=; b=BwSFcTedVGzXRYWhuiMaO1EFbdPlIJPxJqdXLbVy6a9/M72I+vQE1+MgkssMGA2h9I gCH8zPRPBapKb7zcSoGzR5fNEbU+zsJwqvUCdPa32/ONxHcZ390yU6u/H2tt8aowpx01 n7niPuVoaM9D5XrP3+y5I3cfm7S7HwVhtj3rxNR0aa+wy7k3Qvk3ywDvbPo99pkQ8nbS 86hevril3MbdlLnsm+a+yugek+dfsPyS6j0DdvZWFZV5Oxd8yZR/hYldxOMLxMdwvFWB GnQadYz7pQTuPe1bnyq6g9bfIo6O+PQh2lKw8fCL+TdAzqW0Cwd+zG4QIIKvol6ONSUX qZRA== X-Forwarded-Encrypted: i=1; AJvYcCXEY63CSurYeNuvlGOm6yKJu8lOrvg29b6lje7+XIa2vXuVvbve+wT0qs1kUWM7OGf2pM7QanzXXFoOJ591cWaT@lists.infradead.org X-Gm-Message-State: AOJu0YwtNt+V3zRUq+yQTm1/U5JD6+GmIjEmGJXLxWtjH21GKdoveM6a gori13MILnF/WhNj8CUcbrvmOY0Lj97bZg0ONGBs8T0gYBVh+izpm28gKvdgApE= X-Google-Smtp-Source: AGHT+IHPj9lIQrPiRfD7rVN0tVOtOkEexmIO3vjJFqQ8BVd0pibyDdS6UXNk2coAs2i3XgIY5wW6Sw== X-Received: by 2002:a5d:5f52:0:b0:382:47d0:64be with SMTP id ffacd0b85a97d-38254afc606mr2848672f8f.29.1732130250837; Wed, 20 Nov 2024 11:17:30 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 11:17:30 -0800 (PST) From: Dave Stevenson Date: Wed, 20 Nov 2024 19:17:04 +0000 Subject: [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290 MIME-Version: 1.0 Message-Id: <20241120-media-imx290-imx462-v2-2-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_111732_920070_19296E13 X-CRM114-Status: GOOD ( 13.57 ) 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 Reviewing the datasheets, register 0x3011 is meant to be 0x02 on imx327 and 0x00 on imx290. Move it out of the common registers, and set it appropriately in the sensor specific sections. (Included for imx290 to be explicit, rather than relying on the default value). Fixes: 2d41947ec2c0 ("media: i2c: imx290: Add support for imx327 variant") Signed-off-by: Dave Stevenson Reviewed-by: Laurent Pinchart --- drivers/media/i2c/imx290.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index da654deb444a..7d794a509670 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -268,7 +268,6 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = { { IMX290_WINWV, 1097 }, { IMX290_XSOUTSEL, IMX290_XSOUTSEL_XVSOUTSEL_VSYNC | IMX290_XSOUTSEL_XHSOUTSEL_HSYNC }, - { CCI_REG8(0x3011), 0x02 }, { CCI_REG8(0x3012), 0x64 }, { CCI_REG8(0x3013), 0x00 }, }; @@ -276,6 +275,7 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = { static const struct cci_reg_sequence imx290_global_init_settings_290[] = { { CCI_REG8(0x300f), 0x00 }, { CCI_REG8(0x3010), 0x21 }, + { CCI_REG8(0x3011), 0x00 }, { CCI_REG8(0x3016), 0x09 }, { CCI_REG8(0x3070), 0x02 }, { CCI_REG8(0x3071), 0x11 }, @@ -329,6 +329,7 @@ static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = { }; static const struct cci_reg_sequence imx290_global_init_settings_327[] = { + { CCI_REG8(0x3011), 0x02 }, { CCI_REG8(0x309e), 0x4A }, { CCI_REG8(0x309f), 0x4A }, { CCI_REG8(0x313b), 0x61 }, From patchwork Wed Nov 20 19:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13881427 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 BBCD9D743C7 for ; Wed, 20 Nov 2024 19:21:34 +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=tlfK6fVkxSaaorM3DUmPJkAs0WHL/MQZMzNEpDjn1Qs=; b=AOMT+drLBJ+D+/O4c0FI0UXVye yxnQBsI1L4z2OFg1v8NVxbJaPSauJ172eHInMKD9tJg1DVBXQbY2Bphl3nkc5R63yx33XmrIrkccK 0hBp3p4oxi5f+r//pCOgXwqO+Bo2T6EC3oJ5PeumbNcpc7OBAsj6O5y88+y4UkhXF4iyrLXsymmUS uljmX+npjL3wO2eZxZYaF9G9NvsnEGed9TjfdcxmhNlmUyi3WnorsuBTuzSIO47gx2ovKHEsl9mEK 4RZW3NcsA5yAjwN5WxLAJ7hPxxYlMwL2Vrc/srE8H25f0wtksIC/T9uvZ/RUlCz4mAjmqzvv6EU6x 2WPdnzag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDqGR-0000000G76a-1gx2; Wed, 20 Nov 2024 19:21:23 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDqCk-0000000G61l-1Zio for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2024 19:17:36 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-432d9b8558aso7524225e9.0 for ; Wed, 20 Nov 2024 11:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732130252; x=1732735052; 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=tlfK6fVkxSaaorM3DUmPJkAs0WHL/MQZMzNEpDjn1Qs=; b=M7N3v7vfEcJGuzWi4LbPTJHzqQKw53h2drn5KCOMtUwyoAVASEunemBasPIk9oOd2Q 0F+SYPzyFi8iQXp2yNb/uTW3v0Y//lQGLdUC0fAzjjqQ6CxJjg1XhHG+fh9v7UvLiG6G P+oYHCzXrHG2wLy7LAQV7EHziBCNpW+TbZx03aBOs6Gb6mN/4vGyCIr9k54mDTfV4Wk/ YkIjtuIdoPMIyBWhS9Kbwyv9qPIsGJFXkZKWhXEr4lGyWlSnDEjE2AJIHoa/cnw30cDC quQpObTYN58RzBdn5SmyvdZZ4AlG28m7/0AsiBvNIouer2tsGpvafbIsv/ckUg6ajUh6 hYiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732130252; x=1732735052; 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=tlfK6fVkxSaaorM3DUmPJkAs0WHL/MQZMzNEpDjn1Qs=; b=XAzrUJR2VvWjm77nv7zDl/O12tPqI0yXW7hXi4XHPZiF2SM0aDK2Nj90XvuPw0/fIA kY9tZM4+Mxc3fZDIej/q3tsPQcLCtyRpYb21WUiJclWatvYTOOkVr+AobikRHPXkfVlO OekOCcmdboWPAlwtSfBolB2KmMMqN40zHdzVMZ+IRcdiHhTyyulj4fwlGwc3ss9d83wA +QwBTaP8FE3MLs4L3DArRnSVsg8V/EcN582znNrCSPAFbCQcpCx4jXc7aJ3JkRNXikXQ BRypfKsHGjMmpYyfzbKK93I7udKWY9nsrV9603+Ywrzi7vz/PrkAbtYpyuGMb1hJq84j tpVQ== X-Forwarded-Encrypted: i=1; AJvYcCULx2Mc2IjFGBxYaw9TY6AlGZVIKSR9KFFNTNOlJWTzPK2y0fGEjVNrcA/eYW3oQ2znXI3nn0viqH/+8G9SCAJN@lists.infradead.org X-Gm-Message-State: AOJu0Yx5zxz1MoXfu6KXvKXlK4CwvgCuud0fP4Ed9tjcHLsiCXt2cRH0 JIL8e23jnjoL4S4rrqBVsCE3pJeTwkG/IiKlMvYQ3uSufbcytSlAkOeNH0pgvJw= X-Google-Smtp-Source: AGHT+IFsPHCFTeyLurJH5qyVLl3pNocdRdlqiQRb210XXiKhMPrIT/IgqWReShN+rBrzroBvgkskDg== X-Received: by 2002:a05:6000:401f:b0:382:2386:ceaf with SMTP id ffacd0b85a97d-38259d26078mr527503f8f.27.1732130252463; Wed, 20 Nov 2024 11:17:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 11:17:31 -0800 (PST) From: Dave Stevenson Date: Wed, 20 Nov 2024 19:17:05 +0000 Subject: [PATCH v2 3/4] media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding MIME-Version: 1.0 Message-Id: <20241120-media-imx290-imx462-v2-3-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 , Conor Dooley X-Mailer: b4 0.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241120_111734_415085_0FEF8A86 X-CRM114-Status: GOOD ( 10.23 ) 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, 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 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 */ }, };