blob: 2793652fbf66ebc2429e6146ce52fcdadbe39490 [file] [log] [blame]
Waldemar Brodkorb121915c2010-06-08 19:06:01 +02001/*
Waldemar Brodkorb121915c2010-06-08 19:06:01 +02002 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 */
7
Hauke Mehrtens111bd982012-12-26 19:51:14 +00008#ifndef __BCM47XX_NVRAM_H
9#define __BCM47XX_NVRAM_H
Waldemar Brodkorb121915c2010-06-08 19:06:01 +020010
11#include <linux/types.h>
Hauke Mehrtens59833fc2010-11-27 17:46:00 +010012#include <linux/kernel.h>
Hante Meuleman55cab93b2015-05-21 15:27:23 +020013#include <linux/vmalloc.h>
Waldemar Brodkorb121915c2010-06-08 19:06:01 +020014
Rafał Miłeckif6e734a2015-06-10 23:05:08 +020015#ifdef CONFIG_BCM47XX_NVRAM
Rafał Miłecki21400f22014-09-03 22:59:45 +020016int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
Rafał Miłecki341097f2014-10-30 12:50:03 +010017int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
Hauke Mehrtens62cf3bc2013-09-18 13:31:15 +020018int bcm47xx_nvram_gpio_pin(const char *name);
Hante Meuleman55cab93b2015-05-21 15:27:23 +020019char *bcm47xx_nvram_get_contents(size_t *val_len);
20static inline void bcm47xx_nvram_release_contents(char *nvram)
21{
22 vfree(nvram);
23};
Rafał Miłecki138173d2014-12-01 07:58:18 +010024#else
25static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
26{
27 return -ENOTSUPP;
28};
29static inline int bcm47xx_nvram_getenv(const char *name, char *val,
30 size_t val_len)
31{
32 return -ENOTSUPP;
33};
34static inline int bcm47xx_nvram_gpio_pin(const char *name)
35{
36 return -ENOTSUPP;
37};
Hante Meuleman55cab93b2015-05-21 15:27:23 +020038
39static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
40{
41 return NULL;
42};
43
44static inline void bcm47xx_nvram_release_contents(char *nvram)
45{
46};
Rafał Miłecki138173d2014-12-01 07:58:18 +010047#endif
Hauke Mehrtens62cf3bc2013-09-18 13:31:15 +020048
Hauke Mehrtens111bd982012-12-26 19:51:14 +000049#endif /* __BCM47XX_NVRAM_H */