ti-lmu.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * TI LMU (Lighting Management Unit) Devices
  4. *
  5. * Copyright 2017 Texas Instruments
  6. *
  7. * Author: Milo Kim <milo.kim@ti.com>
  8. */
  9. #ifndef __MFD_TI_LMU_H__
  10. #define __MFD_TI_LMU_H__
  11. #include <linux/gpio.h>
  12. #include <linux/notifier.h>
  13. #include <linux/regmap.h>
  14. #include <linux/gpio/consumer.h>
  15. /* Notifier event */
  16. #define LMU_EVENT_MONITOR_DONE 0x01
  17. enum ti_lmu_id {
  18. LM3631,
  19. LM3632,
  20. LM3633,
  21. LM3695,
  22. LM36274,
  23. LMU_MAX_ID,
  24. };
  25. enum ti_lmu_max_current {
  26. LMU_IMAX_5mA,
  27. LMU_IMAX_6mA,
  28. LMU_IMAX_7mA = 0x03,
  29. LMU_IMAX_8mA,
  30. LMU_IMAX_9mA,
  31. LMU_IMAX_10mA = 0x07,
  32. LMU_IMAX_11mA,
  33. LMU_IMAX_12mA,
  34. LMU_IMAX_13mA,
  35. LMU_IMAX_14mA,
  36. LMU_IMAX_15mA = 0x0D,
  37. LMU_IMAX_16mA,
  38. LMU_IMAX_17mA,
  39. LMU_IMAX_18mA,
  40. LMU_IMAX_19mA,
  41. LMU_IMAX_20mA = 0x13,
  42. LMU_IMAX_21mA,
  43. LMU_IMAX_22mA,
  44. LMU_IMAX_23mA = 0x17,
  45. LMU_IMAX_24mA,
  46. LMU_IMAX_25mA,
  47. LMU_IMAX_26mA,
  48. LMU_IMAX_27mA = 0x1C,
  49. LMU_IMAX_28mA,
  50. LMU_IMAX_29mA,
  51. LMU_IMAX_30mA,
  52. };
  53. enum lm363x_regulator_id {
  54. LM3631_BOOST, /* Boost output */
  55. LM3631_LDO_CONT, /* Display panel controller */
  56. LM3631_LDO_OREF, /* Gamma reference */
  57. LM3631_LDO_POS, /* Positive display bias output */
  58. LM3631_LDO_NEG, /* Negative display bias output */
  59. LM3632_BOOST, /* Boost output */
  60. LM3632_LDO_POS, /* Positive display bias output */
  61. LM3632_LDO_NEG, /* Negative display bias output */
  62. LM36274_BOOST, /* Boost output */
  63. LM36274_LDO_POS, /* Positive display bias output */
  64. LM36274_LDO_NEG, /* Negative display bias output */
  65. };
  66. /**
  67. * struct ti_lmu
  68. *
  69. * @dev: Parent device pointer
  70. * @regmap: Used for i2c communcation on accessing registers
  71. * @en_gpio: GPIO for HWEN pin [Optional]
  72. * @notifier: Notifier for reporting hwmon event
  73. */
  74. struct ti_lmu {
  75. struct device *dev;
  76. struct regmap *regmap;
  77. struct gpio_desc *en_gpio;
  78. struct blocking_notifier_head notifier;
  79. };
  80. #endif