blob: a414a2b53e41ca7a89d9832e5fdd0dcd57e8d462 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 */
7
8#ifndef __BCM47XX_NVRAM_H
9#define __BCM47XX_NVRAM_H
10
11#include <linux/errno.h>
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/vmalloc.h>
15
16#ifdef CONFIG_BCM47XX_NVRAM
17int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
18int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
19int bcm47xx_nvram_gpio_pin(const char *name);
20char *bcm47xx_nvram_get_contents(size_t *val_len);
21static inline void bcm47xx_nvram_release_contents(char *nvram)
22{
23 vfree(nvram);
24};
25#else
26static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
27{
28 return -ENOTSUPP;
29};
30static inline int bcm47xx_nvram_getenv(const char *name, char *val,
31 size_t val_len)
32{
33 return -ENOTSUPP;
34};
35static inline int bcm47xx_nvram_gpio_pin(const char *name)
36{
37 return -ENOTSUPP;
38};
39
40static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
41{
42 return NULL;
43};
44
45static inline void bcm47xx_nvram_release_contents(char *nvram)
46{
47};
48#endif
49
50#endif /* __BCM47XX_NVRAM_H */