pdata.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Platform configuration options for DA9063
  3. *
  4. * Copyright 2012 Dialog Semiconductor Ltd.
  5. *
  6. * Author: Michal Hajduk, Dialog Semiconductor
  7. * Author: Krystian Garbaciak, Dialog Semiconductor
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. */
  15. #ifndef __MFD_DA9063_PDATA_H__
  16. #define __MFD_DA9063_PDATA_H__
  17. #include <linux/regulator/machine.h>
  18. /*
  19. * Regulator configuration
  20. */
  21. /* DA9063 regulator IDs */
  22. enum {
  23. /* BUCKs */
  24. DA9063_ID_BCORE1,
  25. DA9063_ID_BCORE2,
  26. DA9063_ID_BPRO,
  27. DA9063_ID_BMEM,
  28. DA9063_ID_BIO,
  29. DA9063_ID_BPERI,
  30. /* BCORE1 and BCORE2 in merged mode */
  31. DA9063_ID_BCORES_MERGED,
  32. /* BMEM and BIO in merged mode */
  33. DA9063_ID_BMEM_BIO_MERGED,
  34. /* When two BUCKs are merged, they cannot be reused separately */
  35. /* LDOs */
  36. DA9063_ID_LDO1,
  37. DA9063_ID_LDO2,
  38. DA9063_ID_LDO3,
  39. DA9063_ID_LDO4,
  40. DA9063_ID_LDO5,
  41. DA9063_ID_LDO6,
  42. DA9063_ID_LDO7,
  43. DA9063_ID_LDO8,
  44. DA9063_ID_LDO9,
  45. DA9063_ID_LDO10,
  46. DA9063_ID_LDO11,
  47. };
  48. /* Regulators platform data */
  49. struct da9063_regulator_data {
  50. int id;
  51. struct regulator_init_data *initdata;
  52. };
  53. struct da9063_regulators_pdata {
  54. unsigned n_regulators;
  55. struct da9063_regulator_data *regulator_data;
  56. };
  57. /*
  58. * RGB LED configuration
  59. */
  60. /* LED IDs for flags in struct led_info. */
  61. enum {
  62. DA9063_GPIO11_LED,
  63. DA9063_GPIO14_LED,
  64. DA9063_GPIO15_LED,
  65. DA9063_LED_NUM
  66. };
  67. #define DA9063_LED_ID_MASK 0x3
  68. /* LED polarity for flags in struct led_info. */
  69. #define DA9063_LED_HIGH_LEVEL_ACTIVE 0x0
  70. #define DA9063_LED_LOW_LEVEL_ACTIVE 0x4
  71. /*
  72. * General PMIC configuration
  73. */
  74. /* HWMON ADC channels configuration */
  75. #define DA9063_FLG_FORCE_IN0_MANUAL_MODE 0x0010
  76. #define DA9063_FLG_FORCE_IN0_AUTO_MODE 0x0020
  77. #define DA9063_FLG_FORCE_IN1_MANUAL_MODE 0x0040
  78. #define DA9063_FLG_FORCE_IN1_AUTO_MODE 0x0080
  79. #define DA9063_FLG_FORCE_IN2_MANUAL_MODE 0x0100
  80. #define DA9063_FLG_FORCE_IN2_AUTO_MODE 0x0200
  81. #define DA9063_FLG_FORCE_IN3_MANUAL_MODE 0x0400
  82. #define DA9063_FLG_FORCE_IN3_AUTO_MODE 0x0800
  83. /* Disable register caching. */
  84. #define DA9063_FLG_NO_CACHE 0x0008
  85. struct da9063;
  86. /* DA9063 platform data */
  87. struct da9063_pdata {
  88. int (*init)(struct da9063 *da9063);
  89. int irq_base;
  90. bool key_power;
  91. unsigned flags;
  92. struct da9063_regulators_pdata *regulators_pdata;
  93. struct led_platform_data *leds_pdata;
  94. };
  95. #endif /* __MFD_DA9063_PDATA_H__ */