of_regulator.h 934 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * OpenFirmware regulator support routines
  3. *
  4. */
  5. #ifndef __LINUX_OF_REG_H
  6. #define __LINUX_OF_REG_H
  7. struct of_regulator_match {
  8. const char *name;
  9. void *driver_data;
  10. struct regulator_init_data *init_data;
  11. struct device_node *of_node;
  12. };
  13. #if defined(CONFIG_OF)
  14. extern struct regulator_init_data
  15. *of_get_regulator_init_data(struct device *dev,
  16. struct device_node *node);
  17. extern int of_regulator_match(struct device *dev, struct device_node *node,
  18. struct of_regulator_match *matches,
  19. unsigned int num_matches);
  20. #else
  21. static inline struct regulator_init_data
  22. *of_get_regulator_init_data(struct device *dev,
  23. struct device_node *node)
  24. {
  25. return NULL;
  26. }
  27. static inline int of_regulator_match(struct device *dev,
  28. struct device_node *node,
  29. struct of_regulator_match *matches,
  30. unsigned int num_matches)
  31. {
  32. return 0;
  33. }
  34. #endif /* CONFIG_OF */
  35. #endif /* __LINUX_OF_REG_H */