max8998.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * max8998.h - Voltage regulator driver for the Maxim 8998
  3. *
  4. * Copyright (C) 2009-2010 Samsung Electrnoics
  5. * Kyungmin Park <kyungmin.park@samsung.com>
  6. * Marek Szyprowski <m.szyprowski@samsung.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #ifndef __LINUX_MFD_MAX8998_H
  23. #define __LINUX_MFD_MAX8998_H
  24. #include <linux/regulator/machine.h>
  25. /* MAX 8998 regulator ids */
  26. enum {
  27. MAX8998_LDO2 = 2,
  28. MAX8998_LDO3,
  29. MAX8998_LDO4,
  30. MAX8998_LDO5,
  31. MAX8998_LDO6,
  32. MAX8998_LDO7,
  33. MAX8998_LDO8,
  34. MAX8998_LDO9,
  35. MAX8998_LDO10,
  36. MAX8998_LDO11,
  37. MAX8998_LDO12,
  38. MAX8998_LDO13,
  39. MAX8998_LDO14,
  40. MAX8998_LDO15,
  41. MAX8998_LDO16,
  42. MAX8998_LDO17,
  43. MAX8998_BUCK1,
  44. MAX8998_BUCK2,
  45. MAX8998_BUCK3,
  46. MAX8998_BUCK4,
  47. MAX8998_EN32KHZ_AP,
  48. MAX8998_EN32KHZ_CP,
  49. MAX8998_ENVICHG,
  50. MAX8998_ESAFEOUT1,
  51. MAX8998_ESAFEOUT2,
  52. };
  53. /**
  54. * max8998_regulator_data - regulator data
  55. * @id: regulator id
  56. * @initdata: regulator init data (contraints, supplies, ...)
  57. */
  58. struct max8998_regulator_data {
  59. int id;
  60. struct regulator_init_data *initdata;
  61. };
  62. /**
  63. * struct max8998_board - packages regulator init data
  64. * @regulators: array of defined regulators
  65. * @num_regulators: number of regultors used
  66. * @irq_base: base IRQ number for max8998, required for IRQs
  67. * @ono: power onoff IRQ number for max8998
  68. * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1
  69. * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2
  70. * @buck2_max_voltage: BUCK2 maximum alowed voltage
  71. * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
  72. * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
  73. * @buck2_set3: BUCK2 gpio pin to set output voltage
  74. */
  75. struct max8998_platform_data {
  76. struct max8998_regulator_data *regulators;
  77. int num_regulators;
  78. int irq_base;
  79. int ono;
  80. int buck1_max_voltage1;
  81. int buck1_max_voltage2;
  82. int buck2_max_voltage;
  83. int buck1_set1;
  84. int buck1_set2;
  85. int buck2_set3;
  86. };
  87. #endif /* __LINUX_MFD_MAX8998_H */