Lines Matching +full:nxp +full:- +full:i
1 // SPDX-License-Identifier: GPL-2.0-only
3 * NXP LPC18xx/43xx OTP memory NVMEM driver
15 #include <linux/nvmem-provider.h>
22 * LPC18xx OTP memory contains 4 banks with 4 32-bit words. Bank 0 starts
48 int i; in lpc18xx_otp_read() local
50 if (count > (LPC18XX_OTP_SIZE - index)) in lpc18xx_otp_read()
51 count = LPC18XX_OTP_SIZE - index; in lpc18xx_otp_read()
53 for (i = index; i < (index + count); i++) in lpc18xx_otp_read()
54 *buf++ = readl(otp->base + i * LPC18XX_OTP_WORD_SIZE); in lpc18xx_otp_read()
60 .name = "lpc18xx-otp",
73 otp = devm_kzalloc(&pdev->dev, sizeof(*otp), GFP_KERNEL); in lpc18xx_otp_probe()
75 return -ENOMEM; in lpc18xx_otp_probe()
78 otp->base = devm_ioremap_resource(&pdev->dev, res); in lpc18xx_otp_probe()
79 if (IS_ERR(otp->base)) in lpc18xx_otp_probe()
80 return PTR_ERR(otp->base); in lpc18xx_otp_probe()
83 lpc18xx_otp_nvmem_config.dev = &pdev->dev; in lpc18xx_otp_probe()
86 nvmem = devm_nvmem_register(&pdev->dev, &lpc18xx_otp_nvmem_config); in lpc18xx_otp_probe()
92 { .compatible = "nxp,lpc1850-otp" },
107 MODULE_DESCRIPTION("NXP LPC18xx OTP NVMEM driver");