1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 2 /* 3 */ 3 */ 4 4 5 #ifndef __BCM47XX_NVRAM_H 5 #ifndef __BCM47XX_NVRAM_H 6 #define __BCM47XX_NVRAM_H 6 #define __BCM47XX_NVRAM_H 7 7 8 #include <linux/errno.h> 8 #include <linux/errno.h> 9 #include <linux/types.h> 9 #include <linux/types.h> 10 #include <linux/kernel.h> 10 #include <linux/kernel.h> 11 #include <linux/vmalloc.h> 11 #include <linux/vmalloc.h> 12 12 13 #ifdef CONFIG_BCM47XX_NVRAM 13 #ifdef CONFIG_BCM47XX_NVRAM 14 int bcm47xx_nvram_init_from_iomem(void __iomem << 15 int bcm47xx_nvram_init_from_mem(u32 base, u32 14 int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); 16 int bcm47xx_nvram_getenv(const char *name, cha 15 int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); 17 int bcm47xx_nvram_gpio_pin(const char *name); 16 int bcm47xx_nvram_gpio_pin(const char *name); 18 char *bcm47xx_nvram_get_contents(size_t *val_l 17 char *bcm47xx_nvram_get_contents(size_t *val_len); 19 static inline void bcm47xx_nvram_release_conte 18 static inline void bcm47xx_nvram_release_contents(char *nvram) 20 { 19 { 21 vfree(nvram); 20 vfree(nvram); 22 }; 21 }; 23 #else 22 #else 24 static inline int bcm47xx_nvram_init_from_iome << 25 << 26 { << 27 return -ENOTSUPP; << 28 } << 29 static inline int bcm47xx_nvram_init_from_mem( 23 static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) 30 { 24 { 31 return -ENOTSUPP; 25 return -ENOTSUPP; 32 }; 26 }; 33 static inline int bcm47xx_nvram_getenv(const c 27 static inline int bcm47xx_nvram_getenv(const char *name, char *val, 34 size_t 28 size_t val_len) 35 { 29 { 36 return -ENOTSUPP; 30 return -ENOTSUPP; 37 }; 31 }; 38 static inline int bcm47xx_nvram_gpio_pin(const 32 static inline int bcm47xx_nvram_gpio_pin(const char *name) 39 { 33 { 40 return -ENOTSUPP; 34 return -ENOTSUPP; 41 }; 35 }; 42 36 43 static inline char *bcm47xx_nvram_get_contents 37 static inline char *bcm47xx_nvram_get_contents(size_t *val_len) 44 { 38 { 45 return NULL; 39 return NULL; 46 }; 40 }; 47 41 48 static inline void bcm47xx_nvram_release_conte 42 static inline void bcm47xx_nvram_release_contents(char *nvram) 49 { 43 { 50 }; 44 }; 51 #endif 45 #endif 52 46 53 #endif /* __BCM47XX_NVRAM_H */ 47 #endif /* __BCM47XX_NVRAM_H */ 54 48
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.