regulator.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/regulator/consumer.h>
  3. #ifndef CONFIG_REGULATOR
  4. __rust_helper void rust_helper_regulator_put(struct regulator *regulator)
  5. {
  6. regulator_put(regulator);
  7. }
  8. __rust_helper int rust_helper_regulator_set_voltage(struct regulator *regulator,
  9. int min_uV, int max_uV)
  10. {
  11. return regulator_set_voltage(regulator, min_uV, max_uV);
  12. }
  13. __rust_helper int rust_helper_regulator_get_voltage(struct regulator *regulator)
  14. {
  15. return regulator_get_voltage(regulator);
  16. }
  17. __rust_helper struct regulator *rust_helper_regulator_get(struct device *dev,
  18. const char *id)
  19. {
  20. return regulator_get(dev, id);
  21. }
  22. __rust_helper int rust_helper_regulator_enable(struct regulator *regulator)
  23. {
  24. return regulator_enable(regulator);
  25. }
  26. __rust_helper int rust_helper_regulator_disable(struct regulator *regulator)
  27. {
  28. return regulator_disable(regulator);
  29. }
  30. __rust_helper int rust_helper_regulator_is_enabled(struct regulator *regulator)
  31. {
  32. return regulator_is_enabled(regulator);
  33. }
  34. __rust_helper int rust_helper_devm_regulator_get_enable(struct device *dev,
  35. const char *id)
  36. {
  37. return devm_regulator_get_enable(dev, id);
  38. }
  39. __rust_helper int
  40. rust_helper_devm_regulator_get_enable_optional(struct device *dev,
  41. const char *id)
  42. {
  43. return devm_regulator_get_enable_optional(dev, id);
  44. }
  45. #endif