max77693.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * max77693.h - Driver for the Maxim 77693
  3. *
  4. * Copyright (C) 2012 Samsung Electrnoics
  5. * SangYoung Son <hello.son@samsung.com>
  6. *
  7. * This program is not provided / owned by Maxim Integrated Products.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. * This driver is based on max8997.h
  24. *
  25. * MAX77693 has PMIC, Charger, Flash LED, Haptic, MUIC devices.
  26. * The devices share the same I2C bus and included in
  27. * this mfd driver.
  28. */
  29. #ifndef __LINUX_MFD_MAX77693_H
  30. #define __LINUX_MFD_MAX77693_H
  31. /* MAX77686 regulator IDs */
  32. enum max77693_regulators {
  33. MAX77693_ESAFEOUT1 = 0,
  34. MAX77693_ESAFEOUT2,
  35. MAX77693_CHARGER,
  36. MAX77693_REG_MAX,
  37. };
  38. struct max77693_regulator_data {
  39. int id;
  40. struct regulator_init_data *initdata;
  41. struct device_node *of_node;
  42. };
  43. struct max77693_reg_data {
  44. u8 addr;
  45. u8 data;
  46. };
  47. struct max77693_muic_platform_data {
  48. struct max77693_reg_data *init_data;
  49. int num_init_data;
  50. int detcable_delay_ms;
  51. /*
  52. * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
  53. * h/w path of COMP2/COMN1 on CONTROL1 register.
  54. */
  55. int path_usb;
  56. int path_uart;
  57. };
  58. /* MAX77693 led flash */
  59. /* triggers */
  60. enum max77693_led_trigger {
  61. MAX77693_LED_TRIG_OFF,
  62. MAX77693_LED_TRIG_FLASH,
  63. MAX77693_LED_TRIG_TORCH,
  64. MAX77693_LED_TRIG_EXT,
  65. MAX77693_LED_TRIG_SOFT,
  66. };
  67. /* trigger types */
  68. enum max77693_led_trigger_type {
  69. MAX77693_LED_TRIG_TYPE_EDGE,
  70. MAX77693_LED_TRIG_TYPE_LEVEL,
  71. };
  72. /* boost modes */
  73. enum max77693_led_boost_mode {
  74. MAX77693_LED_BOOST_NONE,
  75. MAX77693_LED_BOOST_ADAPTIVE,
  76. MAX77693_LED_BOOST_FIXED,
  77. };
  78. struct max77693_led_platform_data {
  79. u32 fleds[2];
  80. u32 iout_torch[2];
  81. u32 iout_flash[2];
  82. u32 trigger[2];
  83. u32 trigger_type[2];
  84. u32 num_leds;
  85. u32 boost_mode;
  86. u32 flash_timeout;
  87. u32 boost_vout;
  88. u32 low_vsys;
  89. };
  90. /* MAX77693 */
  91. struct max77693_platform_data {
  92. /* regulator data */
  93. struct max77693_regulator_data *regulators;
  94. int num_regulators;
  95. /* muic data */
  96. struct max77693_muic_platform_data *muic_data;
  97. struct max77693_led_platform_data *led_data;
  98. };
  99. #endif /* __LINUX_MFD_MAX77693_H */