0001
0002
0003
0004
0005 #ifndef __BCM47XX_NVRAM_H
0006 #define __BCM47XX_NVRAM_H
0007
0008 #include <linux/errno.h>
0009 #include <linux/types.h>
0010 #include <linux/kernel.h>
0011 #include <linux/vmalloc.h>
0012
0013 #ifdef CONFIG_BCM47XX_NVRAM
0014 int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
0015 int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
0016 int bcm47xx_nvram_gpio_pin(const char *name);
0017 char *bcm47xx_nvram_get_contents(size_t *val_len);
0018 static inline void bcm47xx_nvram_release_contents(char *nvram)
0019 {
0020 vfree(nvram);
0021 };
0022 #else
0023 static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
0024 {
0025 return -ENOTSUPP;
0026 };
0027 static inline int bcm47xx_nvram_getenv(const char *name, char *val,
0028 size_t val_len)
0029 {
0030 return -ENOTSUPP;
0031 };
0032 static inline int bcm47xx_nvram_gpio_pin(const char *name)
0033 {
0034 return -ENOTSUPP;
0035 };
0036
0037 static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
0038 {
0039 return NULL;
0040 };
0041
0042 static inline void bcm47xx_nvram_release_contents(char *nvram)
0043 {
0044 };
0045 #endif
0046
0047 #endif