as3711.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * AS3711 PMIC MFC driver header
  3. *
  4. * Copyright (C) 2012 Renesas Electronics Corporation
  5. * Author: Guennadi Liakhovetski, <g.liakhovetski@gmx.de>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the version 2 of the GNU General Public License as
  9. * published by the Free Software Foundation
  10. */
  11. #ifndef MFD_AS3711_H
  12. #define MFD_AS3711_H
  13. /*
  14. * Client data
  15. */
  16. /* Register addresses */
  17. #define AS3711_SD_1_VOLTAGE 0 /* Digital Step-Down */
  18. #define AS3711_SD_2_VOLTAGE 1
  19. #define AS3711_SD_3_VOLTAGE 2
  20. #define AS3711_SD_4_VOLTAGE 3
  21. #define AS3711_LDO_1_VOLTAGE 4 /* Analog LDO */
  22. #define AS3711_LDO_2_VOLTAGE 5
  23. #define AS3711_LDO_3_VOLTAGE 6 /* Digital LDO */
  24. #define AS3711_LDO_4_VOLTAGE 7
  25. #define AS3711_LDO_5_VOLTAGE 8
  26. #define AS3711_LDO_6_VOLTAGE 9
  27. #define AS3711_LDO_7_VOLTAGE 0xa
  28. #define AS3711_LDO_8_VOLTAGE 0xb
  29. #define AS3711_SD_CONTROL 0x10
  30. #define AS3711_GPIO_SIGNAL_OUT 0x20
  31. #define AS3711_GPIO_SIGNAL_IN 0x21
  32. #define AS3711_SD_CONTROL_1 0x30
  33. #define AS3711_SD_CONTROL_2 0x31
  34. #define AS3711_CURR_CONTROL 0x40
  35. #define AS3711_CURR1_VALUE 0x43
  36. #define AS3711_CURR2_VALUE 0x44
  37. #define AS3711_CURR3_VALUE 0x45
  38. #define AS3711_STEPUP_CONTROL_1 0x50
  39. #define AS3711_STEPUP_CONTROL_2 0x51
  40. #define AS3711_STEPUP_CONTROL_4 0x53
  41. #define AS3711_STEPUP_CONTROL_5 0x54
  42. #define AS3711_REG_STATUS 0x73
  43. #define AS3711_INTERRUPT_STATUS_1 0x77
  44. #define AS3711_INTERRUPT_STATUS_2 0x78
  45. #define AS3711_INTERRUPT_STATUS_3 0x79
  46. #define AS3711_CHARGER_STATUS_1 0x86
  47. #define AS3711_CHARGER_STATUS_2 0x87
  48. #define AS3711_ASIC_ID_1 0x90
  49. #define AS3711_ASIC_ID_2 0x91
  50. #define AS3711_MAX_REG AS3711_ASIC_ID_2
  51. #define AS3711_NUM_REGS (AS3711_MAX_REG + 1)
  52. /* Regulators */
  53. enum {
  54. AS3711_REGULATOR_SD_1,
  55. AS3711_REGULATOR_SD_2,
  56. AS3711_REGULATOR_SD_3,
  57. AS3711_REGULATOR_SD_4,
  58. AS3711_REGULATOR_LDO_1,
  59. AS3711_REGULATOR_LDO_2,
  60. AS3711_REGULATOR_LDO_3,
  61. AS3711_REGULATOR_LDO_4,
  62. AS3711_REGULATOR_LDO_5,
  63. AS3711_REGULATOR_LDO_6,
  64. AS3711_REGULATOR_LDO_7,
  65. AS3711_REGULATOR_LDO_8,
  66. AS3711_REGULATOR_MAX,
  67. };
  68. struct device;
  69. struct regmap;
  70. struct as3711 {
  71. struct device *dev;
  72. struct regmap *regmap;
  73. };
  74. #define AS3711_MAX_STEPDOWN 4
  75. #define AS3711_MAX_STEPUP 2
  76. #define AS3711_MAX_LDO 8
  77. enum as3711_su2_feedback {
  78. AS3711_SU2_VOLTAGE,
  79. AS3711_SU2_CURR1,
  80. AS3711_SU2_CURR2,
  81. AS3711_SU2_CURR3,
  82. AS3711_SU2_CURR_AUTO,
  83. };
  84. enum as3711_su2_fbprot {
  85. AS3711_SU2_LX_SD4,
  86. AS3711_SU2_GPIO2,
  87. AS3711_SU2_GPIO3,
  88. AS3711_SU2_GPIO4,
  89. };
  90. /*
  91. * Platform data
  92. */
  93. struct as3711_regulator_pdata {
  94. struct regulator_init_data *init_data[AS3711_REGULATOR_MAX];
  95. };
  96. struct as3711_bl_pdata {
  97. const char *su1_fb;
  98. int su1_max_uA;
  99. const char *su2_fb;
  100. int su2_max_uA;
  101. enum as3711_su2_feedback su2_feedback;
  102. enum as3711_su2_fbprot su2_fbprot;
  103. bool su2_auto_curr1;
  104. bool su2_auto_curr2;
  105. bool su2_auto_curr3;
  106. };
  107. struct as3711_platform_data {
  108. struct as3711_regulator_pdata regulator;
  109. struct as3711_bl_pdata backlight;
  110. };
  111. #endif