syscon.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * System Control Driver
  3. *
  4. * Copyright (C) 2012 Freescale Semiconductor, Inc.
  5. * Copyright (C) 2012 Linaro Ltd.
  6. *
  7. * Author: Dong Aisheng <dong.aisheng@linaro.org>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. */
  14. #ifndef __LINUX_MFD_SYSCON_H__
  15. #define __LINUX_MFD_SYSCON_H__
  16. #include <linux/err.h>
  17. #include <linux/errno.h>
  18. struct device_node;
  19. #ifdef CONFIG_MFD_SYSCON
  20. extern struct regmap *syscon_node_to_regmap(struct device_node *np);
  21. extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
  22. extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s);
  23. extern struct regmap *syscon_regmap_lookup_by_phandle(
  24. struct device_node *np,
  25. const char *property);
  26. #else
  27. static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
  28. {
  29. return ERR_PTR(-ENOTSUPP);
  30. }
  31. static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
  32. {
  33. return ERR_PTR(-ENOTSUPP);
  34. }
  35. static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s)
  36. {
  37. return ERR_PTR(-ENOTSUPP);
  38. }
  39. static inline struct regmap *syscon_regmap_lookup_by_phandle(
  40. struct device_node *np,
  41. const char *property)
  42. {
  43. return ERR_PTR(-ENOTSUPP);
  44. }
  45. #endif
  46. #endif /* __LINUX_MFD_SYSCON_H__ */