mdss_hdmi_tx.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __MDSS_HDMI_TX_H__
  13. #define __MDSS_HDMI_TX_H__
  14. #include <linux/switch.h>
  15. #include "mdss_hdmi_util.h"
  16. enum hdmi_tx_io_type {
  17. HDMI_TX_CORE_IO,
  18. HDMI_TX_PHY_IO,
  19. HDMI_TX_QFPROM_IO,
  20. HDMI_TX_MAX_IO
  21. };
  22. enum hdmi_tx_power_module_type {
  23. HDMI_TX_HPD_PM,
  24. HDMI_TX_DDC_PM,
  25. HDMI_TX_CORE_PM,
  26. HDMI_TX_CEC_PM,
  27. HDMI_TX_MAX_PM
  28. };
  29. /* Data filled from device tree */
  30. struct hdmi_tx_platform_data {
  31. bool primary;
  32. bool cond_power_on;
  33. struct dss_io_data io[HDMI_TX_MAX_IO];
  34. struct dss_module_power power_data[HDMI_TX_MAX_PM];
  35. #if defined (CONFIG_VIDEO_MHL_V2)
  36. bool drm_workaround;
  37. #endif
  38. };
  39. struct hdmi_audio {
  40. int sample_rate;
  41. int channel_num;
  42. int spkr_alloc;
  43. int level_shift;
  44. int down_mix;
  45. };
  46. struct hdmi_tx_ctrl {
  47. struct platform_device *pdev;
  48. struct hdmi_tx_platform_data pdata;
  49. struct mdss_panel_data panel_data;
  50. struct hdmi_audio audio_data;
  51. struct mutex mutex;
  52. struct mutex lut_lock;
  53. struct mutex power_mutex;
  54. struct mutex cable_notify_mutex;
  55. struct list_head cable_notify_handlers;
  56. struct kobject *kobj;
  57. struct switch_dev sdev;
  58. struct switch_dev audio_sdev;
  59. struct workqueue_struct *workq;
  60. spinlock_t hpd_state_lock;
  61. uint32_t video_resolution;
  62. u32 panel_power_on;
  63. u32 panel_suspend;
  64. u32 hpd_state;
  65. u32 hpd_off_pending;
  66. u32 hpd_feature_on;
  67. u32 hpd_initialized;
  68. u32 vote_hdmi_core_on;
  69. u8 timing_gen_on;
  70. u32 mhl_max_pclk;
  71. u8 mhl_hpd_on;
  72. struct completion hpd_int_done;
  73. struct completion hpd_off_done;
  74. struct work_struct hpd_int_work;
  75. struct work_struct power_off_work;
  76. struct work_struct cable_notify_work;
  77. bool hdcp_feature_on;
  78. bool ds_registered;
  79. bool hpd_disabled;
  80. u32 present_hdcp;
  81. u8 spd_vendor_name[9];
  82. u8 spd_product_description[17];
  83. struct hdmi_tx_ddc_ctrl ddc_ctrl;
  84. void (*hdmi_tx_hpd_done) (void *data);
  85. void *downstream_data;
  86. void *feature_data[HDMI_TX_FEAT_MAX];
  87. #if defined (CONFIG_VIDEO_MHL_V2) || defined (CONFIG_VIDEO_MHL_SII8246)
  88. int is_power_enabled[HDMI_TX_MAX_PM];
  89. #endif
  90. };
  91. #if defined (CONFIG_VIDEO_MHL_V2) || defined (CONFIG_VIDEO_MHL_SII8246)
  92. void mhl_hpd_handler(bool state);
  93. int hdmi_hpd_status(void);
  94. #endif
  95. #endif /* __MDSS_HDMI_TX_H__ */