2019-05-27 06:55:01 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2010-06-08 17:06:01 +00:00
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
2012-12-26 19:51:14 +00:00
|
|
|
#ifndef __BCM47XX_NVRAM_H
|
|
|
|
#define __BCM47XX_NVRAM_H
|
2010-06-08 17:06:01 +00:00
|
|
|
|
2017-05-31 16:26:07 +00:00
|
|
|
#include <linux/errno.h>
|
2010-06-08 17:06:01 +00:00
|
|
|
#include <linux/types.h>
|
2010-11-27 16:46:00 +00:00
|
|
|
#include <linux/kernel.h>
|
2015-05-21 13:27:23 +00:00
|
|
|
#include <linux/vmalloc.h>
|
2010-06-08 17:06:01 +00:00
|
|
|
|
2015-06-10 21:05:08 +00:00
|
|
|
#ifdef CONFIG_BCM47XX_NVRAM
|
2014-09-03 20:59:45 +00:00
|
|
|
int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
|
2014-10-30 11:50:03 +00:00
|
|
|
int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
|
2013-09-18 11:31:15 +00:00
|
|
|
int bcm47xx_nvram_gpio_pin(const char *name);
|
2015-05-21 13:27:23 +00:00
|
|
|
char *bcm47xx_nvram_get_contents(size_t *val_len);
|
|
|
|
static inline void bcm47xx_nvram_release_contents(char *nvram)
|
|
|
|
{
|
|
|
|
vfree(nvram);
|
|
|
|
};
|
2014-12-01 06:58:18 +00:00
|
|
|
#else
|
|
|
|
static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
|
|
|
|
{
|
|
|
|
return -ENOTSUPP;
|
|
|
|
};
|
|
|
|
static inline int bcm47xx_nvram_getenv(const char *name, char *val,
|
|
|
|
size_t val_len)
|
|
|
|
{
|
|
|
|
return -ENOTSUPP;
|
|
|
|
};
|
|
|
|
static inline int bcm47xx_nvram_gpio_pin(const char *name)
|
|
|
|
{
|
|
|
|
return -ENOTSUPP;
|
|
|
|
};
|
2015-05-21 13:27:23 +00:00
|
|
|
|
|
|
|
static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline void bcm47xx_nvram_release_contents(char *nvram)
|
|
|
|
{
|
|
|
|
};
|
2014-12-01 06:58:18 +00:00
|
|
|
#endif
|
2013-09-18 11:31:15 +00:00
|
|
|
|
2012-12-26 19:51:14 +00:00
|
|
|
#endif /* __BCM47XX_NVRAM_H */
|