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: 13881421 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.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 9D8401BBBE0 for ; Wed, 20 Nov 2024 19:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130254; cv=none; b=FMAS2+SqnyIvY2rvHlbSvnkLbF0I2sEctu12dku7lIGDgftHtY6DcEyOzRTzTpZMIc8j1ktEzPC+CZ8PJNQMn/fMFdQNodPpufoCG5rL4o8VkQLbZjIAEGUDD4rom8Zr7GP9ievU+hdyG1RYI6lpLb4f3oO3rsW191WkODMIwL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130254; c=relaxed/simple; bh=pSrWTgrJyoEYtFZT+idvxCJkveJQEy5pITbzjTk4dy8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ekrre0ZiHF30CWQHgGuWAPpUtEaUuScNyrbGGfSW9P4fqRJEZhy+RjWpDCou7Dqy3Wvod9a/Po4rFsEsVBXrclv9Nsq3iKI8GxuMkX0Zt7TssKaSbvn1dN3ropEgDEBj6RLJkde+eUNSHPhEha8V9U/MdSR0CgWGTFK62ZkthOs= 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=T18cGOJf; arc=none smtp.client-ip=209.85.221.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="T18cGOJf" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3823eaad37aso816702f8f.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.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=QgfFBue2AkaNv5wDd17S+yzXIWjDIT3WyGaTAc0rklw=; b=T18cGOJfUATjaW4CZNrQdgtVzxrccOmNphfnp65OgQx3M3ZURKG5YPoSsLkf6qIxuA KGxNOYuZ10uLZMeEdvL7tWiaLR2HGDki7U/YKYJDBSKbln8ksctStfQABsQS8TrD32d/ yrhC/jRbGnaSBG9sELxLoJ1NSAtsttt46ldAVkG1jDjUZyKRnnMnl5akvfJvXizyRJB0 LeRAkOOEn8IOMYGmnlD+T6IDXmmOSFgsXNOs6YWSxgr0IVfZMhFXsUloJR/K5xu1rDze 5aMeXLCzjyJZtom/ZXecfixi8I6QNBqdokA5w1AbBWZ/Shu/JJ/+0da2zzKAdslBNy7w l5TA== 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=Plg7Zh4jlccJklAXWhcM7KOPxBF5CltdikhmRZwHRT5PQ7S+g3Qq7t+T6rWtWsguba BAx6oQvsXkfQwRiBIXp+BYgwLg1ttUgfOul+Xidqaorx5t3IEBWPefkzZLSrqXlNoUt7 lI1WoXDIvRUMRtBNFGn67QOHg5+EPijfIJL1LRmPiA6L5bmW7yGKHpGmABhAgjqessRz wfPjiMvEZ8Kapx/QT5qhpKyYxgMNRY+qcm4B/LEn4WztoQEfSUyubAmL36dgy18oWgJt 1FbbKwZAt9maugK6i0ps6LLXtJmQLFomXr7I4n6DIJxIUG3wjs+2XPeNrgmhEOhEQh3j dA2A== X-Forwarded-Encrypted: i=1; AJvYcCWyyNxEjhfeuTuubhuIbKAB62MS3rCLIGo2RuDfPexnWdRp3iEdrSCsdz5FnxBAsyAb4sM=@lists.linux.dev X-Gm-Message-State: AOJu0Yxq//uVLyErplfXvzkGFADv8NXnJG7+dQP8N5Hif7j4QmuTxxMH wV0a1DdqlqoERhPSvpEtpeGMEkxkY9fbsDvqpcd5runR8DnGLHjoJKhVuFIcm0c= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13881420 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 851E71BC061 for ; Wed, 20 Nov 2024 19:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130254; cv=none; b=C13LM+O4ksjTD9t9gJclYuHMKa7J+SQTM2fr8HJA0QHsSeblWORXrRGWGJZq5/Euw70OtE+L/+q6HMakn92Wq5vxOJwSMDPnKFgs6x+K5kxJ6+/LP9/q0YX1as8r1Qi3V4S6VPmSbHUWBikaYiCBsRbxJ1vHowBSiQ3HSylQHV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130254; c=relaxed/simple; bh=qU/BCtVEF31P/c3SNLO19S/y0k70QJXixpBlPsGMgJ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gH76yy2pglAYQTENQPwlAuExGJEqPcBGkcRu2Z09DhH3RdHU/RbxuAldL4VJkRHyn1+4QBkU5LKmrVBN3lZtdSmk2ocpd7Tip9mlAmG4Wj/aJoEFDj6Yav74c0vL2A+4QIa52ivFGk+X4e5fbHavAl5rwhPlhQx8uoTP8nmd/CI= 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=QvwojBxj; arc=none smtp.client-ip=209.85.128.54 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="QvwojBxj" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-431481433bdso240125e9.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.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=w9/cR/dqviroqX2VCS26LbceoYUIdqbcsui+WHfkKVw=; b=QvwojBxj9GKTJtc4GKlahN0xljuge3ALAPuHNSg/HINIER2Ul6aNVM4XOwEhLJZ82o GTl2A429ZXRQXbQ20M9Xs11kfdwGW2YWYF1uK0nsoDcrVvwndW0YpX0T9LBs4vVbbNqG GJujInlI5GIjB0yqAe9p2Nguc9cmruxpVFZvNSMPTDR8C00Gm3Ie3kR7C7U/imo+KO6B o9UhdKenCudFLHkvVzcXL054Zbr7e4uId5Wegw8ZPxOn0GfmxST066mNUJPqlwXf3scn eHiGZdRuJG+hzE2mIoPwiro3Bo3u8tjWeBhJvJXpJ2uTFJqsJQyQYVcDKwVo5Xui30Kj ocmA== 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=VPXEHVkdkZF1NXWTOCcb8EY8Gq4Zrk+kb0D5AERdQxKzMHOa2qnueF9wvz1lIrdzSI eLj4lCauDFrYZleuVB3JIGPsjqrq7E9JNGO2u+JBdrUyknZxOeUbhyI1yFFCBX6iHgy1 PHRbhFJmSK8FMuK0P+IUBKYIwFfY9rBkq7xEsxWNHZQYgOmbQdwSsQw9IoRumNS94P3V EDZd+PMyL4ouY6Ny+0FBNp5NIKutndetbTHWAHMiBVxDycPhxDVterbifV+T+GT+tXZQ z5VK+ifjdOB2F/pOofe+e5NoxJwwuaSgG9kQQVtPn8PL/P5qBWJ3V821o0Hg7kuFoRxS 1qNQ== X-Forwarded-Encrypted: i=1; AJvYcCVpQm/Q1N8JeaxNQCZYVryd39sKV6Ai4FZ7KEl0Re26Eu3CG9o7SJPAnKsA3Yp62qc3vOA=@lists.linux.dev X-Gm-Message-State: AOJu0Ywo8+dC7oesoiwxf5ebRZRceLAmfXiXP5Vt7GVWtRbaCUKe646q JoSxdcy3PdH5QzhVE+0EIlCT1Fte/DFiXTn1y9rYho1ZHiIp7QYX4ND9tGGCbBU= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13881422 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 3CC0B1C1F36 for ; Wed, 20 Nov 2024 19:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130256; cv=none; b=M67zkkLuwqn2omVBtJfjQYF3jG3SuaUe+pva5R7PhV6hEGlRexjDL5JhnaaEYgBwT3dnnGPRn2ShBdD3UPlMyP8/HXoC1qKTX/7fpr9Ov/9LKIbohj+a80VbLq9KRMJQzBW5q+1WJdkc2CbBPZkq2ouEfB8mIVNtFhOi1VxK8Gc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130256; c=relaxed/simple; bh=3tV6GkAKanIEYQ6ZIvJMVnikoHT1hIYNzp0NLUDHrFk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZRkMi+bbG9HTJjOU7lWt3pysCAxEzmnU5wkzWCm1PnyswhteW9Z11MfPP/ApqFUnTM2KC1qNNKgilHTL3rwkzy6ieCS6+gQrR45DTiGLMXuR/mBJKk5Fx0DCDDiFy187TYCQ+eQaLe5pPSobWSkxKjty6ajHFKz2+E1NQ9rYqZU= 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=lPPAaN5N; arc=none smtp.client-ip=209.85.221.44 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="lPPAaN5N" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3823f1ed492so724437f8f.1 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.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=tlfK6fVkxSaaorM3DUmPJkAs0WHL/MQZMzNEpDjn1Qs=; b=lPPAaN5NueEE8S8ovYHwI5kGhJQFUrUfVYkgtdovvJmYqM2OLfBS3xFZbPphmvWKcT ZGGMa1Emy0fb5KGk46bHBP3krJKsJShRxLjsMleeJpkBjroUOZVz5TJ8RvId4jzeYVOo +guQbMVaeSBlXiQIyuM9KbDMqcouNHSOxs6m5RYyZwZSS7KCErtOyTlaAw5uR0n0C/Nd DItdLVgSnsjzSeXC0F1nC8ltfpD/rc78unYCUqUyVIFDp6dG92rPX2++572bXyAieqJ0 Dtfv+2TlchR0bF7dIUyt5gCust2U20Y6YWGyaly1l3vFwSP5K23zWCrXsiNsLTQE6qtG ZpeA== 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=lZ21TKGz/fRSjSf7SadbPM+p/HC3mUVhkagL9SqwQZxQDDRxMA9lxDLtOYqyAJNly9 9Rl07Dp4TN2YcR7z354ls1atd2An3kn8vHUjFMBW9FS8OHWujRHm/t3edkQ1f0aWepWc BBsUgxZ8rH8ZuVoEzU4SEgDlRgWVrJz9YuzwToohnLZ/WwbPqtENQ+OzQWro2xc6xYHQ FJHPBewOCZokn0eS80gVhABJZUgdacCE5+j9XaFi+z90oJUmfaBe3S3j78HhNeLMmQ37 rNHTPbFal9bP9yIufzuq58FTvQcbmfV1K+3AXnHoj1ypjN+skAilPcr0B/diPWsBmUwM uG3Q== X-Forwarded-Encrypted: i=1; AJvYcCW0S7jv9a8mqTnszxhFdxA1cF2v0pHLK56w0Y3DXLeMRa7yTgeczZdVrDKjAC1heoIg7kY=@lists.linux.dev X-Gm-Message-State: AOJu0YyJXqr3w6jaTJq67Oe7rign/jUwd+UPzxQ31bWAJBcMSw94/tv9 Q6sI2JLrLklMKSDgsUVinp+Ifr/i4kOE7rX7WVUrr+YNmxWm36BCmUnCp92+m+Q= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13881423 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 06D771C4A0F for ; Wed, 20 Nov 2024 19:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130256; cv=none; b=Emk8k5NJkFAXokzxLy7dHx11ynPJq/qG4MJgTYi5S7fHfy6/csbKcaxhvlW4lJqcNsmySRf3E0Unf4f0fV2aItBnumb+PDin0JvCDoxYlvnioqT8QCJ7+Nm3PzyGL6nOiJW9NFKfuSKzCb77SJjCwL8C7kPGbAxRRfT0BMqv0EA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732130256; c=relaxed/simple; bh=0yiuVppUNHZf3L7doCK7wAGWo0y2MOO+Z6YHaTA040U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F62AE4eiRCH4jIZHGOrmEmcR+ik/8xKSRGk65VOKK88T/au7eEhuNr3Te+rrsYxIrIroPc1GVVWfsYW2/F6y6BfZ9kejf+1Ex8w3t7BDJXab/wFpmquxHDA9dxiU44LAVTmr29NWX5xoOcpWRR+wRaL+L5ctFEIh6VtI5BHT8Co= 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=FHAQ5agS; arc=none smtp.client-ip=209.85.221.48 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="FHAQ5agS" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-38245e072e8so45721f8f.0 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.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=zitwIFEHcuodW9TqUQcqtnx2dFAFSgL0NQQ869EFe3Y=; b=FHAQ5agS5pO60xMI2+4r1y+NzNcZmFO0/SpXmynqTmzyvd5ea5gWRAMsckGjwyhsJ4 ygV6IqOs7Gyf9HeP5XJ0aJXWtPDnEszlFMGxKoKhKIv3ipXTjIVc3GWgNVETbt4EQn5W d+/1IhxedJ2wNLv5BnG1fzdB14xCClsJF0klL9Y1Iun3PMlYLjguuBqWnMRamwt9OscA P0dkAZ0V3BjcYGF8MtFU/p8TYCq3yXzRfUNDM7KL81p4CP/cLKqumDKn/zDUzPGKp6Uo 7YyGSix58nfguH27fN5aytx+vyAzSHVBXXsDY1nljR4ZTPt2x2l0cGyDgRHlHmIgCZO0 dwXg== 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=lSHBOTVUhWZvsNMjP9ydBVRRaVr1FkSPwQLL2IHEwGMJKNuXsRR0bukvcu2xFFxPVF X5vh5rld1Ta1Me2ajs1FxRm/Ye8PT43p9JsaUvbIMcipwDg5+bDOpKv7gzi/vsO6IZ3A 5rRz/QCickpBZodaopI4zhVMhJVhmKzycuUh941thgYdAgncs2MnMicSYA2Xrj1HE16M a1SRwqoX06kDu0Ky3KRGi2pa9X6cIO8WXHg6XE2UZcevOtT19OBY5WME7z7tq6ckLfO6 yJpFuYuoSKCzY4CMFg4zM9kOCgRBd7iYPRTPiK4Jy2FTMz8sEnyy+wS1yyDPttmJjqXV gEdQ== X-Forwarded-Encrypted: i=1; AJvYcCUvAQ17j5Fzs/ZBANt4gF0fpkblRebRaL5V5vtCoflWs8lYPoPWCoYjC68FFoX/4Az4Dco=@lists.linux.dev X-Gm-Message-State: AOJu0YxfT6iJuo2FeOAC8yjp3EcpgTYS5HcRFhyAZhQAB4iJqx35S8Cw V3ZpaXtayLa/QGpMdPWnAgJ9QlUH+zcOruZfI5/QoRYL+FJqXNZkqf9iLqnJul0= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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 */ }, };