2010-06-09 00:06:01 +07: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 02:51:14 +07:00
|
|
|
#ifndef __BCM47XX_NVRAM_H
|
|
|
|
#define __BCM47XX_NVRAM_H
|
2010-06-09 00:06:01 +07:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
2010-11-27 23:46:00 +07:00
|
|
|
#include <linux/kernel.h>
|
2015-05-21 20:27:23 +07:00
|
|
|
#include <linux/vmalloc.h>
|
2010-06-09 00:06:01 +07:00
|
|
|
|
2015-06-11 04:05:08 +07:00
|
|
|
#ifdef CONFIG_BCM47XX_NVRAM
|
2014-09-04 03:59:45 +07:00
|
|
|
int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
|
2014-10-30 18:50:03 +07:00
|
|
|
int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
|
2013-09-18 18:31:15 +07:00
|
|
|
int bcm47xx_nvram_gpio_pin(const char *name);
|
2015-05-21 20:27:23 +07:00
|
|
|
char *bcm47xx_nvram_get_contents(size_t *val_len);
|
|
|
|
static inline void bcm47xx_nvram_release_contents(char *nvram)
|
|
|
|
{
|
|
|
|
vfree(nvram);
|
|
|
|
};
|
2014-12-01 13:58:18 +07: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 20:27:23 +07: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 13:58:18 +07:00
|
|
|
#endif
|
2013-09-18 18:31:15 +07:00
|
|
|
|
2012-12-27 02:51:14 +07:00
|
|
|
#endif /* __BCM47XX_NVRAM_H */
|