Add support for AK7377 VCM, which is a similar chip to the AK7375.
It has no known standby register setting.
Some values were reverse-engineered from the other chip's code,
so the driver may not currently be reaching its full potential.
Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
---
drivers/media/i2c/ak7375.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c
index 9a2432cea3fff9f0ff41796f97236449792dccfc..47f9d14d9a65d43e5a8e5d6966e8f330c99865f8 100644
--- a/drivers/media/i2c/ak7375.c
+++ b/drivers/media/i2c/ak7375.c
@@ -65,6 +65,19 @@ static const struct ak73xx_chipdef ak7375_cdef = {
.power_delay_us = 10000,
};
+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,
+ .has_standby = false,
+ .focus_pos_max = 1024,
+ .focus_steps = 1,
+ .ctrl_steps = 32,
+ .ctrl_delay_us = 1000,
+ .power_delay_us = 10000,
+};
+
static const char * const ak7375_supply_names[] = {
"vdd",
"vio",
@@ -331,6 +344,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);
--
2.43.0