msm-cdc-supply.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2016, 2018-2019 The Linux Foundation. All rights reserved.
  3. */
  4. #ifndef __CODEC_POWER_SUPPLY_H__
  5. #define __CODEC_POWER_SUPPLY_H__
  6. #include <linux/kernel.h>
  7. #include <linux/slab.h>
  8. #include <linux/regulator/consumer.h>
  9. struct cdc_regulator {
  10. const char *name;
  11. int min_uV;
  12. int max_uV;
  13. int optimum_uA;
  14. bool ondemand;
  15. struct regulator *regulator;
  16. };
  17. extern int msm_cdc_get_power_supplies(struct device *dev,
  18. struct cdc_regulator **cdc_vreg,
  19. int *total_num_supplies);
  20. extern int msm_cdc_disable_ondemand_supply(struct device *dev,
  21. struct regulator_bulk_data *supplies,
  22. struct cdc_regulator *cdc_vreg,
  23. int num_supplies, char *supply_name);
  24. extern int msm_cdc_enable_ondemand_supply(struct device *dev,
  25. struct regulator_bulk_data *supplies,
  26. struct cdc_regulator *cdc_vreg,
  27. int num_supplies, char *supply_name);
  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. extern int msm_cdc_init_supplies_v2(struct device *dev,
  45. struct regulator_bulk_data **supplies,
  46. struct cdc_regulator *cdc_vreg,
  47. int num_supplies,
  48. u32 vote_regulator_on_demand);
  49. #endif