video: tegra: hdmi: WAR: emulate hdmi hotoplug
Jong Kim [Sat, 5 Apr 2014 00:32:38 +0000 (17:32 -0700)]
Emulate hotplug to make DVI monitors work through HDMI-to-DVI
dongle. In the last hdmi state, enabled_state, force trigger
hotplug for the HDMi go through clean power off, read EDID,
power on, and configure sequence.

bug 1495496

Change-Id: I0d9c3d7e5d1244d677a0d547c68c6cb9f961a956
Signed-off-by: Jong Kim <jongk@nvidia.com>
Reviewed-on: http://git-master/r/392977
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

drivers/video/tegra/dc/hdmi_state_machine.c
drivers/video/tegra/dc/hdmi_state_machine.h

index e11c8d7..3707a0a 100644 (file)
@@ -147,9 +147,14 @@ static void hdmi_state_machine_handle_hpd_l(int cur_hpd)
 }
 
 /* Enable DC when hotplug succeeds */
+static int emulate_hotplug = 1;
 static void handle_enable_l(struct tegra_dc_hdmi_data *hdmi)
 {
        tegra_dc_enable(hdmi->dc);
+       if (emulate_hotplug) {
+               emulate_hotplug = 0;
+               hdmi_reread_edid(hdmi->dc);
+       }
 }
 
 /************************************************************
@@ -483,3 +488,12 @@ int hdmi_state_machine_get_state(void)
 
        return ret;
 }
+
+bool hdmi_reread_edid(struct tegra_dc *dc)
+{
+       struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
+
+       handle_check_edid_l(hdmi);
+       hdmi_state_machine_handle_hpd_l(0);
+       return dc->connected;
+}
index 5509cba..ed2e2d9 100644 (file)
@@ -4,7 +4,7 @@
  * HDMI library support functions for Nvidia Tegra processors.
  *
  * Copyright (C) 2013 Google - http://www.google.com/
- * Copyright (C) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (C) 2013-2014, NVIDIA CORPORATION. All rights reserved.
  * Authors:    John Grossman <johngro@google.com>
  * Authors:    Mike J. Chen <mjchen@google.com>
  *
@@ -97,5 +97,6 @@ void hdmi_state_machine_init(struct tegra_dc_hdmi_data *hdmi);
 void hdmi_state_machine_shutdown(void);
 void hdmi_state_machine_set_pending_hpd(void);
 int hdmi_state_machine_get_state(void);
+bool hdmi_reread_edid(struct tegra_dc *dc);
 
 #endif  /* __TEGRA_HDMI_STATE_MACHINE_H */