1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2009-2013 ADVANSEE
4  * Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
5  *
6  * Based on the mpc512x iim code:
7  * Copyright 2008 Silicon Turnkey Express, Inc.
8  * Martha Marx <mmarx@silicontkx.com>
9  */
10 
11 #ifndef _FUSE_H_
12 #define _FUSE_H_
13 
14 #include <linux/types.h>
15 #include <linux/errno.h>
16 
17 /*
18  * Read/Sense/Program/Override interface:
19  *   bank:    Fuse bank
20  *   word:    Fuse word within the bank
21  *   val:     Value to read/write
22  *
23  *   Returns: 0 on success, not 0 on failure
24  */
25 int fuse_read(u32 bank, u32 word, u32 *val);
26 int fuse_sense(u32 bank, u32 word, u32 *val);
27 int fuse_prog(u32 bank, u32 word, u32 val);
28 int fuse_override(u32 bank, u32 word, u32 val);
29 #ifdef CONFIG_CMD_FUSE_WRITEBUFF
30 int fuse_writebuff(ulong addr);
31 #else
fuse_writebuff(ulong addr)32 static inline int fuse_writebuff(ulong addr)
33 {
34 	return -EPERM;
35 }
36 #endif	/* CONFIG_CMD_FUSE_WRITEBUFF */
37 
38 #endif	/* _FUSE_H_ */
39