nvmem-provider.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * nvmem framework provider.
  3. *
  4. * Copyright (C) 2015 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  5. * Copyright (C) 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. */
  11. #ifndef _LINUX_NVMEM_PROVIDER_H
  12. #define _LINUX_NVMEM_PROVIDER_H
  13. struct nvmem_device;
  14. struct nvmem_cell_info;
  15. struct nvmem_config {
  16. struct device *dev;
  17. const char *name;
  18. int id;
  19. struct module *owner;
  20. const struct nvmem_cell_info *cells;
  21. int ncells;
  22. bool read_only;
  23. };
  24. #if IS_ENABLED(CONFIG_NVMEM)
  25. struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
  26. int nvmem_unregister(struct nvmem_device *nvmem);
  27. #else
  28. static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
  29. {
  30. return ERR_PTR(-ENOSYS);
  31. }
  32. static inline int nvmem_unregister(struct nvmem_device *nvmem)
  33. {
  34. return -ENOSYS;
  35. }
  36. #endif /* CONFIG_NVMEM */
  37. #endif /* ifndef _LINUX_NVMEM_PROVIDER_H */