#include <linux/device.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/platform_device.h>
#define OCOTP_CTRL_REG 0x00
#define OCOTP_CTRL_SET 0x04
#define OCOTP_CTRL_CLR 0x08
#define OCOTP_TIMING 0x10
#define OCOTP_READ_CTRL_REG 0x30
#define OCOTP_READ_FUSE_DATA 0x40
#define OCOTP_CTRL_WR_UNLOCK 16
#define OCOTP_CTRL_WR_UNLOCK_KEY 0x3E77
#define OCOTP_CTRL_WR_UNLOCK_MASK GENMASK(31, 16)
#define OCOTP_CTRL_ADDR 0
#define OCOTP_CTRL_ADDR_MASK GENMASK(6, 0)
#define OCOTP_CTRL_RELOAD_SHADOWS BIT(10)
#define OCOTP_CTRL_ERR BIT(9)
#define OCOTP_CTRL_BUSY BIT(8)
#define OCOTP_TIMING_STROBE_READ 16
#define OCOTP_TIMING_STROBE_READ_MASK GENMASK(21, 16)
#define OCOTP_TIMING_RELAX 12
#define OCOTP_TIMING_RELAX_MASK GENMASK(15, 12)
#define OCOTP_TIMING_STROBE_PROG 0
#define OCOTP_TIMING_STROBE_PROG_MASK GENMASK(11, 0)
#define OCOTP_READ_CTRL_READ_FUSE 0x1
#define VF610_OCOTP_TIMEOUT 100000
#define BF(value, field) (((value) << field) & field##_MASK)