as3711.h 2.7 KB

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