diff options
| author | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
| commit | 8e4bff4cab0ddac6060645b0715210484d02ff40 (patch) | |
| tree | 3a5c3024371a04692a3a6d9974d001cdff8ebf84 /drivers/misc/sprd_otp/sprd_otp.h | |
Diffstat (limited to 'drivers/misc/sprd_otp/sprd_otp.h')
| -rw-r--r-- | drivers/misc/sprd_otp/sprd_otp.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/misc/sprd_otp/sprd_otp.h b/drivers/misc/sprd_otp/sprd_otp.h new file mode 100644 index 00000000..bfd057e8 --- /dev/null +++ b/drivers/misc/sprd_otp/sprd_otp.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014 Spreadtrum Communications Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __SPRD_OTP_H__ +#define __SPRD_OTP_H__ + +#include <linux/miscdevice.h> + +struct sprd_otp_operations { + void (*reset) (void); + u32(*read) (int blk_index); + int (*prog) (int blk_index, u32 data); +}; + +struct sprd_otp_device { + struct miscdevice misc; + int blk_max; /* maximun valid blocks */ + int blk_width; /* bytes counts per block */ + struct sprd_otp_operations *ops; + struct list_head list; +}; +#define BITSINDEX(b, o) ( (b) * 8 + (o) ) + +int sprd_efuse_init(void); +int sprd_adie_efuse_init(void); +u32 __adie_efuse_read(int blk_index); +u32 __adie_efuse_read_bits(int bit_index, int length); + +int sprd_adie_laserfuse_init(void); +void *sprd_otp_register(const char *name, void *ops, int blk_max, + int blk_width); + +/* EXPORT API */ +u32 __ddie_efuse_read(int blk_index); +u32 __adie_laserfuse_read(int blk_index); +u32 __adie_efuse_read(int blk_index); +u32 __adie_efuse_read_bits(int bit_index, int length); + +#endif /* __SPRD_OTP_H__ */ |
