fixed.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * fixed.h
  3. *
  4. * Copyright 2008 Wolfson Microelectronics PLC.
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  7. *
  8. * Copyright (c) 2009 Nokia Corporation
  9. * Roger Quadros <ext-roger.quadros@nokia.com>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of the
  14. * License, or (at your option) any later version.
  15. */
  16. #ifndef __REGULATOR_FIXED_H
  17. #define __REGULATOR_FIXED_H
  18. struct regulator_init_data;
  19. /**
  20. * struct fixed_voltage_config - fixed_voltage_config structure
  21. * @supply_name: Name of the regulator supply
  22. * @microvolts: Output voltage of regulator
  23. * @gpio: GPIO to use for enable control
  24. * set to -EINVAL if not used
  25. * @startup_delay: Start-up time in microseconds
  26. * @enable_high: Polarity of enable GPIO
  27. * 1 = Active high, 0 = Active low
  28. * @enabled_at_boot: Whether regulator has been enabled at
  29. * boot or not. 1 = Yes, 0 = No
  30. * This is used to keep the regulator at
  31. * the default state
  32. * @init_data: regulator_init_data
  33. *
  34. * This structure contains fixed voltage regulator configuration
  35. * information that must be passed by platform code to the fixed
  36. * voltage regulator driver.
  37. */
  38. struct fixed_voltage_config {
  39. const char *supply_name;
  40. int microvolts;
  41. int gpio;
  42. unsigned startup_delay;
  43. unsigned enable_high:1;
  44. unsigned enabled_at_boot:1;
  45. struct regulator_init_data *init_data;
  46. };
  47. struct regulator_consumer_supply;
  48. #if IS_ENABLED(CONFIG_REGULATOR)
  49. struct platform_device *regulator_register_fixed(int id,
  50. struct regulator_consumer_supply *supplies, int num_supplies);
  51. #else
  52. static inline struct platform_device *regulator_register_fixed(int id,
  53. struct regulator_consumer_supply *supplies, int num_supplies)
  54. {
  55. return NULL;
  56. }
  57. #endif
  58. #endif