max8952.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * max8952.h - Voltage regulation for the Maxim 8952
  3. *
  4. * Copyright (C) 2010 Samsung Electrnoics
  5. * MyungJoo Ham <myungjoo.ham@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef REGULATOR_MAX8952
  22. #define REGULATOR_MAX8952
  23. #include <linux/regulator/machine.h>
  24. enum {
  25. MAX8952_DVS_MODE0,
  26. MAX8952_DVS_MODE1,
  27. MAX8952_DVS_MODE2,
  28. MAX8952_DVS_MODE3,
  29. };
  30. enum {
  31. MAX8952_DVS_770mV = 0,
  32. MAX8952_DVS_780mV,
  33. MAX8952_DVS_790mV,
  34. MAX8952_DVS_800mV,
  35. MAX8952_DVS_810mV,
  36. MAX8952_DVS_820mV,
  37. MAX8952_DVS_830mV,
  38. MAX8952_DVS_840mV,
  39. MAX8952_DVS_850mV,
  40. MAX8952_DVS_860mV,
  41. MAX8952_DVS_870mV,
  42. MAX8952_DVS_880mV,
  43. MAX8952_DVS_890mV,
  44. MAX8952_DVS_900mV,
  45. MAX8952_DVS_910mV,
  46. MAX8952_DVS_920mV,
  47. MAX8952_DVS_930mV,
  48. MAX8952_DVS_940mV,
  49. MAX8952_DVS_950mV,
  50. MAX8952_DVS_960mV,
  51. MAX8952_DVS_970mV,
  52. MAX8952_DVS_980mV,
  53. MAX8952_DVS_990mV,
  54. MAX8952_DVS_1000mV,
  55. MAX8952_DVS_1010mV,
  56. MAX8952_DVS_1020mV,
  57. MAX8952_DVS_1030mV,
  58. MAX8952_DVS_1040mV,
  59. MAX8952_DVS_1050mV,
  60. MAX8952_DVS_1060mV,
  61. MAX8952_DVS_1070mV,
  62. MAX8952_DVS_1080mV,
  63. MAX8952_DVS_1090mV,
  64. MAX8952_DVS_1100mV,
  65. MAX8952_DVS_1110mV,
  66. MAX8952_DVS_1120mV,
  67. MAX8952_DVS_1130mV,
  68. MAX8952_DVS_1140mV,
  69. MAX8952_DVS_1150mV,
  70. MAX8952_DVS_1160mV,
  71. MAX8952_DVS_1170mV,
  72. MAX8952_DVS_1180mV,
  73. MAX8952_DVS_1190mV,
  74. MAX8952_DVS_1200mV,
  75. MAX8952_DVS_1210mV,
  76. MAX8952_DVS_1220mV,
  77. MAX8952_DVS_1230mV,
  78. MAX8952_DVS_1240mV,
  79. MAX8952_DVS_1250mV,
  80. MAX8952_DVS_1260mV,
  81. MAX8952_DVS_1270mV,
  82. MAX8952_DVS_1280mV,
  83. MAX8952_DVS_1290mV,
  84. MAX8952_DVS_1300mV,
  85. MAX8952_DVS_1310mV,
  86. MAX8952_DVS_1320mV,
  87. MAX8952_DVS_1330mV,
  88. MAX8952_DVS_1340mV,
  89. MAX8952_DVS_1350mV,
  90. MAX8952_DVS_1360mV,
  91. MAX8952_DVS_1370mV,
  92. MAX8952_DVS_1380mV,
  93. MAX8952_DVS_1390mV,
  94. MAX8952_DVS_1400mV,
  95. };
  96. enum {
  97. MAX8952_SYNC_FREQ_26MHZ, /* Default */
  98. MAX8952_SYNC_FREQ_13MHZ,
  99. MAX8952_SYNC_FREQ_19_2MHZ,
  100. };
  101. enum {
  102. MAX8952_RAMP_32mV_us = 0, /* Default */
  103. MAX8952_RAMP_16mV_us,
  104. MAX8952_RAMP_8mV_us,
  105. MAX8952_RAMP_4mV_us,
  106. MAX8952_RAMP_2mV_us,
  107. MAX8952_RAMP_1mV_us,
  108. MAX8952_RAMP_0_5mV_us,
  109. MAX8952_RAMP_0_25mV_us,
  110. };
  111. #define MAX8952_NUM_DVS_MODE 4
  112. struct max8952_platform_data {
  113. int gpio_vid0;
  114. int gpio_vid1;
  115. int gpio_en;
  116. u32 default_mode;
  117. u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
  118. u32 sync_freq;
  119. u32 ramp_speed;
  120. struct regulator_init_data *reg_data;
  121. };
  122. #endif /* REGULATOR_MAX8952 */