mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan-Michael Brummer <jan.brummer@tabos.org>
To: linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com, mchehab@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	tian.shu.qiu@intel.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jan-Michael Brummer <jan.brummer@tabos.org>
Subject: [PATCH 1/2] media: i2c: ak7375: Add support for the AK7377
Date: Sat, 29 Aug 2026 07:25:13 +0200	[thread overview]
Message-ID: <20260829052514.18178-3-jan.brummer@tabos.org> (raw)
In-Reply-To: <20260829052514.18178-1-jan.brummer@tabos.org>

The AK7377 drives the focus actuator of the main camera on the Fairphone
5.  It uses the same register layout as the AK7375: a 12 bit position in
registers 0x00/0x01 shifted left by four, and standby control in 0x02.
Confirmed on hardware by driving the lens across its range.

Signed-off-by: Jan-Michael Brummer <jan.brummer@tabos.org>
---
 drivers/media/i2c/ak7375.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c
index 9a2432c..4f311c4 100644
--- a/drivers/media/i2c/ak7375.c
+++ b/drivers/media/i2c/ak7375.c
@@ -65,6 +65,25 @@ static const struct ak73xx_chipdef ak7375_cdef = {
 	.power_delay_us	= 10000,
 };
 
+/*
+ * The AK7377 is register compatible with the AK7375: 12 bit position in
+ * registers 0x00/0x01, standby via 0x02.  Verified on the Fairphone 5,
+ * where it drives the focus of the IMX800 main camera.
+ */
+static const struct ak73xx_chipdef ak7377_cdef = {
+	.reg_position	= 0x0,
+	.reg_cont	= 0x2,
+	.shift_pos	= 4,	/* 12 bits position values, need to << 4 */
+	.mode_active	= 0x0,
+	.mode_standby	= 0x40,
+	.has_standby	= true,
+	.focus_pos_max	= 4095,
+	.focus_steps	= 1,
+	.ctrl_steps	= 64,
+	.ctrl_delay_us	= 1000,
+	.power_delay_us	= 10000,
+};
+
 static const char * const ak7375_supply_names[] = {
 	"vdd",
 	"vio",
@@ -331,6 +350,7 @@ static int __maybe_unused ak7375_vcm_resume(struct device *dev)
 static const struct of_device_id ak7375_of_table[] = {
 	{ .compatible = "asahi-kasei,ak7345", .data = &ak7345_cdef, },
 	{ .compatible = "asahi-kasei,ak7375", .data = &ak7375_cdef, },
+	{ .compatible = "asahi-kasei,ak7377", .data = &ak7377_cdef, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ak7375_of_table);
@@ -353,5 +373,5 @@ module_i2c_driver(ak7375_i2c_driver);
 
 MODULE_AUTHOR("Tianshu Qiu <tian.shu.qiu@intel.com>");
 MODULE_AUTHOR("Bingbu Cao <bingbu.cao@intel.com>");
-MODULE_DESCRIPTION("AK7375 VCM driver");
+MODULE_DESCRIPTION("AK7375/AK7377 VCM driver");
 MODULE_LICENSE("GPL v2");

  parent reply	other threads:[~2026-08-29  5:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  5:25 [PATCH 0/3] media: ak7375: Add AK7377 support Jan-Michael Brummer
2026-08-29  5:25 ` [PATCH] media: dt-bindings: ak7375: Add AK7377 Jan-Michael Brummer
2026-08-29  5:25 ` Jan-Michael Brummer [this message]
2026-08-29  5:25 ` [PATCH 2/2] media: i2c: ak7375: Do not mark the VCM active before powering it Jan-Michael Brummer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260829052514.18178-3-jan.brummer@tabos.org \
    --to=jan.brummer@tabos.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®