summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoratiu Vultur <horatiu.vultur@microchip.com>2026-05-30 21:53:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-17 14:55:46 +0200
commit4d8d405b139c7c2fd59cd4d1cc15bea0120c4dc7 (patch)
treef9c1095fb1f27466226cb013a4dc03f499a6b03a
parent7acd1e983c9c3b8f5749bea497208d5656e23dee (diff)
downloadlinux-next-4d8d405b139c7c2fd59cd4d1cc15bea0120c4dc7.tar.gz
linux-next-4d8d405b139c7c2fd59cd4d1cc15bea0120c4dc7.zip
nvmem: lan9662-otp: add support for LAN969x
Microchip LAN969x provides OTP with the same control logic, only the size differs as LAN969x has 16KB of OTP instead of 8KB like on LAN966x. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: Robert Marko <robert.marko@sartura.hr> Signed-off-by: Srinivas Kandagatla <srini@kernel.org> Link: https://patch.msgid.link/20260530205333.117458-9-srini@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/nvmem/Kconfig2
-rw-r--r--drivers/nvmem/lan9662-otpc.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index 74ddbd0f79b0..78b648e14727 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -138,7 +138,7 @@ config NVMEM_JZ4780_EFUSE
config NVMEM_LAN9662_OTPC
tristate "Microchip LAN9662 OTP controller support"
- depends on SOC_LAN966 || COMPILE_TEST
+ depends on SOC_LAN966 || ARCH_LAN969X || COMPILE_TEST
depends on HAS_IOMEM
help
This driver enables the OTP controller available on Microchip LAN9662
diff --git a/drivers/nvmem/lan9662-otpc.c b/drivers/nvmem/lan9662-otpc.c
index 56fc19f092a7..62d1d6381bf8 100644
--- a/drivers/nvmem/lan9662-otpc.c
+++ b/drivers/nvmem/lan9662-otpc.c
@@ -27,7 +27,6 @@
#define OTP_OTP_STATUS_OTP_CPUMPEN BIT(1)
#define OTP_OTP_STATUS_OTP_BUSY BIT(0)
-#define OTP_MEM_SIZE 8192
#define OTP_SLEEP_US 10
#define OTP_TIMEOUT_US 500000
@@ -176,7 +175,6 @@ static struct nvmem_config otp_config = {
.word_size = 1,
.reg_read = lan9662_otp_read,
.reg_write = lan9662_otp_write,
- .size = OTP_MEM_SIZE,
};
static int lan9662_otp_probe(struct platform_device *pdev)
@@ -196,6 +194,7 @@ static int lan9662_otp_probe(struct platform_device *pdev)
otp_config.priv = otp;
otp_config.dev = dev;
+ otp_config.size = (uintptr_t) device_get_match_data(dev);
nvmem = devm_nvmem_register(dev, &otp_config);
@@ -203,7 +202,14 @@ static int lan9662_otp_probe(struct platform_device *pdev)
}
static const struct of_device_id lan9662_otp_match[] = {
- { .compatible = "microchip,lan9662-otpc", },
+ {
+ .compatible = "microchip,lan9662-otpc",
+ .data = (const void *) SZ_8K,
+ },
+ {
+ .compatible = "microchip,lan9691-otpc",
+ .data = (const void *) SZ_16K,
+ },
{ },
};
MODULE_DEVICE_TABLE(of, lan9662_otp_match);