fixed.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * fixed.h
  4. *
  5. * Copyright 2008 Wolfson Microelectronics PLC.
  6. *
  7. * Author: Mark Brown <[email protected]>
  8. *
  9. * Copyright (c) 2009 Nokia Corporation
  10. * Roger Quadros <[email protected]>
  11. */
  12. #ifndef __REGULATOR_FIXED_H
  13. #define __REGULATOR_FIXED_H
  14. struct regulator_init_data;
  15. /**
  16. * struct fixed_voltage_config - fixed_voltage_config structure
  17. * @supply_name: Name of the regulator supply
  18. * @input_supply: Name of the input regulator supply
  19. * @microvolts: Output voltage of regulator
  20. * @startup_delay: Start-up time in microseconds
  21. * @enabled_at_boot: Whether regulator has been enabled at
  22. * boot or not. 1 = Yes, 0 = No
  23. * This is used to keep the regulator at
  24. * the default state
  25. * @init_data: regulator_init_data
  26. *
  27. * This structure contains fixed voltage regulator configuration
  28. * information that must be passed by platform code to the fixed
  29. * voltage regulator driver.
  30. */
  31. struct fixed_voltage_config {
  32. const char *supply_name;
  33. const char *input_supply;
  34. int microvolts;
  35. unsigned startup_delay;
  36. unsigned int off_on_delay;
  37. unsigned enabled_at_boot:1;
  38. struct regulator_init_data *init_data;
  39. };
  40. struct regulator_consumer_supply;
  41. #if IS_ENABLED(CONFIG_REGULATOR)
  42. struct platform_device *regulator_register_always_on(int id, const char *name,
  43. struct regulator_consumer_supply *supplies, int num_supplies, int uv);
  44. #else
  45. static inline struct platform_device *regulator_register_always_on(int id, const char *name,
  46. struct regulator_consumer_supply *supplies, int num_supplies, int uv)
  47. {
  48. return NULL;
  49. }
  50. #endif
  51. #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
  52. "fixed-dummy", s, ns, 0)
  53. #endif