linux/drivers/nvmem/lpc18xx_eeprom.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * NXP LPC18xx/LPC43xx EEPROM memory NVMEM driver
 *
 * Copyright (c) 2015 Ariel D'Alessandro <[email protected]>
 */

#include <linux/clk.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/nvmem-provider.h>
#include <linux/platform_device.h>
#include <linux/reset.h>

/* Registers */
#define LPC18XX_EEPROM_AUTOPROG
#define LPC18XX_EEPROM_AUTOPROG_WORD

#define LPC18XX_EEPROM_CLKDIV

#define LPC18XX_EEPROM_PWRDWN
#define LPC18XX_EEPROM_PWRDWN_NO
#define LPC18XX_EEPROM_PWRDWN_YES

#define LPC18XX_EEPROM_INTSTAT
#define LPC18XX_EEPROM_INTSTAT_END_OF_PROG

#define LPC18XX_EEPROM_INTSTATCLR
#define LPC18XX_EEPROM_INTSTATCLR_PROG_CLR_ST

/* Fixed page size (bytes) */
#define LPC18XX_EEPROM_PAGE_SIZE

/* EEPROM device requires a ~1500 kHz clock (min 800 kHz, max 1600 kHz) */
#define LPC18XX_EEPROM_CLOCK_HZ

/* EEPROM requires 3 ms of erase/program time between each writing */
#define LPC18XX_EEPROM_PROGRAM_TIME

struct lpc18xx_eeprom_dev {};

static inline void lpc18xx_eeprom_writel(struct lpc18xx_eeprom_dev *eeprom,
					 u32 reg, u32 val)
{}

static inline u32 lpc18xx_eeprom_readl(struct lpc18xx_eeprom_dev *eeprom,
				       u32 reg)
{}

static int lpc18xx_eeprom_busywait_until_prog(struct lpc18xx_eeprom_dev *eeprom)
{}

static int lpc18xx_eeprom_gather_write(void *context, unsigned int reg,
				       void *val, size_t bytes)
{}

static int lpc18xx_eeprom_read(void *context, unsigned int offset,
			       void *val, size_t bytes)
{}


static struct nvmem_config lpc18xx_nvmem_config =;

static int lpc18xx_eeprom_probe(struct platform_device *pdev)
{}

static void lpc18xx_eeprom_remove(struct platform_device *pdev)
{}

static const struct of_device_id lpc18xx_eeprom_of_match[] =;
MODULE_DEVICE_TABLE(of, lpc18xx_eeprom_of_match);

static struct platform_driver lpc18xx_eeprom_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();