Linux 4.6-rc6
[cris-mirror.git] / include / linux / bcm47xx_nvram.h
blob2793652fbf66ebc2429e6146ce52fcdadbe39490
1 /*
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 */
8 #ifndef __BCM47XX_NVRAM_H
9 #define __BCM47XX_NVRAM_H
11 #include <linux/types.h>
12 #include <linux/kernel.h>
13 #include <linux/vmalloc.h>
15 #ifdef CONFIG_BCM47XX_NVRAM
16 int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
17 int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
18 int bcm47xx_nvram_gpio_pin(const char *name);
19 char *bcm47xx_nvram_get_contents(size_t *val_len);
20 static inline void bcm47xx_nvram_release_contents(char *nvram)
22 vfree(nvram);
24 #else
25 static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
27 return -ENOTSUPP;
29 static inline int bcm47xx_nvram_getenv(const char *name, char *val,
30 size_t val_len)
32 return -ENOTSUPP;
34 static inline int bcm47xx_nvram_gpio_pin(const char *name)
36 return -ENOTSUPP;
39 static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
41 return NULL;
44 static inline void bcm47xx_nvram_release_contents(char *nvram)
47 #endif
49 #endif /* __BCM47XX_NVRAM_H */