msm-cdc-supply.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2016, 2018-2020 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. struct cdc_wcd_supply {
  18. const char *name;
  19. struct device *dev;
  20. struct snd_soc_component *component;
  21. };
  22. extern int msm_cdc_get_power_supplies(struct device *dev,
  23. struct cdc_regulator **cdc_vreg,
  24. int *total_num_supplies);
  25. extern int msm_cdc_disable_ondemand_supply(struct device *dev,
  26. struct regulator_bulk_data *supplies,
  27. struct cdc_regulator *cdc_vreg,
  28. int num_supplies, char *supply_name);
  29. extern int msm_cdc_enable_ondemand_supply(struct device *dev,
  30. struct regulator_bulk_data *supplies,
  31. struct cdc_regulator *cdc_vreg,
  32. int num_supplies, char *supply_name);
  33. extern int msm_cdc_disable_static_supplies(struct device *dev,
  34. struct regulator_bulk_data *supplies,
  35. struct cdc_regulator *cdc_vreg,
  36. int num_supplies);
  37. extern int msm_cdc_release_supplies(struct device *dev,
  38. struct regulator_bulk_data *supplies,
  39. struct cdc_regulator *cdc_vreg,
  40. int num_supplies);
  41. extern int msm_cdc_enable_static_supplies(struct device *dev,
  42. struct regulator_bulk_data *supplies,
  43. struct cdc_regulator *cdc_vreg,
  44. int num_supplies);
  45. extern int msm_cdc_init_supplies(struct device *dev,
  46. struct regulator_bulk_data **supplies,
  47. struct cdc_regulator *cdc_vreg,
  48. int num_supplies);
  49. extern int msm_cdc_init_supplies_v2(struct device *dev,
  50. struct regulator_bulk_data **supplies,
  51. struct cdc_regulator *cdc_vreg,
  52. int num_supplies,
  53. u32 vote_regulator_on_demand);
  54. int msm_cdc_init_wcd_supply(struct device_node *np, const char *name,
  55. struct cdc_wcd_supply *cdc_supply);
  56. int msm_cdc_enable_wcd_supply(struct cdc_wcd_supply *cdc_supply, bool enable);
  57. #endif