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