msm-cdc-supply.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright (c) 2016, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __CODEC_POWER_SUPPLY_H__
  13. #define __CODEC_POWER_SUPPLY_H__
  14. #include <linux/kernel.h>
  15. #include <linux/slab.h>
  16. #include <linux/regulator/consumer.h>
  17. struct cdc_regulator {
  18. const char *name;
  19. int min_uV;
  20. int max_uV;
  21. int optimum_uA;
  22. bool ondemand;
  23. struct regulator *regulator;
  24. };
  25. extern int msm_cdc_get_power_supplies(struct device *dev,
  26. struct cdc_regulator **cdc_vreg,
  27. int *total_num_supplies);
  28. extern int msm_cdc_disable_static_supplies(struct device *dev,
  29. struct regulator_bulk_data *supplies,
  30. struct cdc_regulator *cdc_vreg,
  31. int num_supplies);
  32. extern int msm_cdc_release_supplies(struct device *dev,
  33. struct regulator_bulk_data *supplies,
  34. struct cdc_regulator *cdc_vreg,
  35. int num_supplies);
  36. extern int msm_cdc_enable_static_supplies(struct device *dev,
  37. struct regulator_bulk_data *supplies,
  38. struct cdc_regulator *cdc_vreg,
  39. int num_supplies);
  40. extern int msm_cdc_init_supplies(struct device *dev,
  41. struct regulator_bulk_data **supplies,
  42. struct cdc_regulator *cdc_vreg,
  43. int num_supplies);
  44. #endif