pmic8901-regulator.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (c) 2010-2011, 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. */
  13. #ifndef __PMIC8901_REGULATOR_H__
  14. #define __PMIC8901_REGULATOR_H__
  15. #include <linux/regulator/machine.h>
  16. /* Low dropout regulator ids */
  17. #define PM8901_VREG_ID_L0 0
  18. #define PM8901_VREG_ID_L1 1
  19. #define PM8901_VREG_ID_L2 2
  20. #define PM8901_VREG_ID_L3 3
  21. #define PM8901_VREG_ID_L4 4
  22. #define PM8901_VREG_ID_L5 5
  23. #define PM8901_VREG_ID_L6 6
  24. /* Switched-mode power supply regulator ids */
  25. #define PM8901_VREG_ID_S0 7
  26. #define PM8901_VREG_ID_S1 8
  27. #define PM8901_VREG_ID_S2 9
  28. #define PM8901_VREG_ID_S3 10
  29. #define PM8901_VREG_ID_S4 11
  30. /* Low voltage switch regulator ids */
  31. #define PM8901_VREG_ID_LVS0 12
  32. #define PM8901_VREG_ID_LVS1 13
  33. #define PM8901_VREG_ID_LVS2 14
  34. #define PM8901_VREG_ID_LVS3 15
  35. /* Medium voltage switch regulator ids */
  36. #define PM8901_VREG_ID_MVS0 16
  37. /* USB OTG voltage switch regulator ids */
  38. #define PM8901_VREG_ID_USB_OTG 17
  39. /* HDMI medium voltage switch regulator ids */
  40. #define PM8901_VREG_ID_HDMI_MVS 18
  41. #define PM8901_VREG_MAX (PM8901_VREG_ID_HDMI_MVS + 1)
  42. #define PM8901_VREG_PIN_CTRL_NONE 0x00
  43. #define PM8901_VREG_PIN_CTRL_A0 0x01
  44. #define PM8901_VREG_PIN_CTRL_A1 0x02
  45. #define PM8901_VREG_PIN_CTRL_D0 0x04
  46. #define PM8901_VREG_PIN_CTRL_D1 0x08
  47. /* Minimum high power mode loads in uA. */
  48. #define PM8901_VREG_LDO_300_HPM_MIN_LOAD 10000
  49. #define PM8901_VREG_FTSMPS_HPM_MIN_LOAD 100000
  50. /* Pin ctrl enables/disables or toggles high/low power modes */
  51. enum pm8901_vreg_pin_fn {
  52. PM8901_VREG_PIN_FN_ENABLE = 0,
  53. PM8901_VREG_PIN_FN_MODE,
  54. };
  55. struct pm8901_vreg_pdata {
  56. struct regulator_init_data init_data;
  57. int id;
  58. unsigned pull_down_enable;
  59. unsigned pin_ctrl;
  60. enum pm8901_vreg_pin_fn pin_fn;
  61. };
  62. #endif