2010-06-09 01:06:01 +08:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
|
|
|
|
2012-12-27 03:51:14 +08:00
|
|
|
#ifndef __BCM47XX_NVRAM_H
|
|
|
|
#define __BCM47XX_NVRAM_H
|
2010-06-09 01:06:01 +08:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
2010-11-28 00:46:00 +08:00
|
|
|
#include <linux/kernel.h>
|
2015-05-21 21:27:23 +08:00
|
|
|
#include <linux/vmalloc.h>
|
2010-06-09 01:06:01 +08:00
|
|
|
|
2015-06-11 05:05:08 +08:00
|
|
|
#ifdef CONFIG_BCM47XX_NVRAM
|
2014-09-04 04:59:45 +08:00
|
|
|
int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
|
2014-10-30 19:50:03 +08:00
|
|
|
int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
|
2013-09-18 19:31:15 +08:00
|
|
|
int bcm47xx_nvram_gpio_pin(const char *name);
|
2015-05-21 21:27:23 +08:00
|
|
|
char *bcm47xx_nvram_get_contents(size_t *val_len);
|
|
|
|
static inline void bcm47xx_nvram_release_contents(char *nvram)
|
|
|
|
{
|
|
|
|
vfree(nvram);
|
|
|
|
};
|
2014-12-01 14:58:18 +08: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 21:27:23 +08: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 14:58:18 +08:00
|
|
|
#endif
|
2013-09-18 19:31:15 +08:00
|
|
|
|
2012-12-27 03:51:14 +08:00
|
|
|
#endif /* __BCM47XX_NVRAM_H */
|