sii8240.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #ifndef _SII8240_H_
  15. #define _SII8240_H_
  16. #ifdef __KERNEL__
  17. #include <linux/mdss_hdmi_mhl.h>
  18. /* Different MHL Dongle/bridge which are used; may be
  19. * these enums are Samsung-Specific,but they do represent various
  20. * versions of dongles.
  21. */
  22. enum dongle_type {
  23. DONGLE_NONE = 0,
  24. DONGLE_9290,
  25. DONGLE_9292,
  26. };
  27. enum connector_type {
  28. CONN_NONE = 0,
  29. CONN_5_PIN, /* USB-type */
  30. CONN_11_PIN, /* Galaxy-S3? */
  31. CONN_30_PIN, /* Galaxy Tabs */
  32. };
  33. enum mhl_sleep_state {
  34. MHL_SUSPEND_STATE = 0,
  35. MHL_RESUME_STATE = 1,
  36. };
  37. enum mhl_gpio_type {
  38. MHL_GPIO_UNKNOWN_TYPE = 0,
  39. MHL_GPIO_AP_GPIO = 1,
  40. MHL_GPIO_PM_GPIO = 2,
  41. MHL_GPIO_PM_MPP = 3,
  42. };
  43. struct sii8240_platform_data {
  44. /* Called to setup board-specific power operations */
  45. void (*power)(bool on);
  46. /* In case,when connectors are not able to automatically switch the
  47. * D+/D- Path to SII8240,do the switching manually.
  48. */
  49. void (*enable_path)(bool enable);
  50. struct i2c_client *tmds_client;
  51. struct i2c_client *hdmi_client;
  52. struct i2c_client *disc_client;
  53. struct i2c_client *tpi_client;
  54. struct i2c_client *cbus_client;
  55. /* to handle board-specific connector info & callback */
  56. enum dongle_type dongle;
  57. enum connector_type conn;
  58. int (*reg_notifier)(struct notifier_block *nb);
  59. int (*unreg_notifier)(struct notifier_block *nb);
  60. u8 power_state;
  61. u32 swing_level;
  62. u32 damping;
  63. bool drm_workaround;
  64. int ddc_i2c_num;
  65. void (*mhl_sel)(bool enable);
  66. int (*get_irq)(void);
  67. int gpio;
  68. void (*hw_reset)(void);
  69. void (*gpio_cfg)(enum mhl_sleep_state sleep_status);
  70. void (*charger_mhl_cb)(bool on, int mhl_charger);
  71. bool (*vbus_present)(void);
  72. int (*muic_otg_set)(int on);
  73. int charging_type;
  74. void (*int_gpio_config)(bool);
  75. /* void (*vbus_present)(bool on); */
  76. #ifdef CONFIG_MUIC_SUPPORT_MULTIMEDIA_DOCK
  77. bool is_multimediadock;
  78. #endif
  79. #ifdef CONFIG_SAMSUNG_MHL_UNPOWERED
  80. int (*get_vbus_status)(void);
  81. void (*sii9234_otg_control)(bool onoff);
  82. #endif
  83. #if defined(CONFIG_OF)
  84. int gpio_mhl_scl;
  85. int gpio_mhl_sda;
  86. int gpio_mhl_irq;
  87. int gpio_mhl_en;
  88. int gpio_mhl_reset;
  89. int gpio_mhl_wakeup;
  90. int gpio_ta_int;
  91. bool gpio_barcode_emul;
  92. enum mhl_gpio_type gpio_mhl_reset_type;
  93. enum mhl_gpio_type gpio_mhl_en_type;
  94. struct regulator *vcc_1p2v;
  95. struct regulator *vcc_1p8v;
  96. struct regulator *vcc_3p3v;
  97. struct platform_device *hdmi_pdev;
  98. struct msm_hdmi_mhl_ops *hdmi_mhl_ops;
  99. #endif
  100. #ifdef CONFIG_EXTCON
  101. bool is_smartdock;
  102. #endif
  103. };
  104. extern unsigned int system_rev;
  105. int acc_register_notifier(struct notifier_block *nb);
  106. #endif /* __SII8240_H__ */
  107. #endif