summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiu Xiaowen <b37945@freescale.com>2014-02-17 16:44:40 +0800
committerNitin Garg <nitin.garg@freescale.com>2014-04-21 22:35:41 -0500
commitb9251585f11701032d8f8caed68d4c317c59b1d3 (patch)
tree6e2381100f45c7764a5313e22147c8be435161f2 /drivers
parent0c8b8db7dcd4a0a3467916fa192a2168fa6efcad (diff)
ENGR00241962 Add another hdmi switch for hdmi driver.
android framework need seperated hdmi display and hdmi audio switch. Signed-off-by: Liu Xiaowen <b37945@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxc/mxc_hdmi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c
index 71475b5fe09b..9038c9aaf1ad 100644
--- a/drivers/video/mxc/mxc_hdmi.c
+++ b/drivers/video/mxc/mxc_hdmi.c
@@ -54,6 +54,7 @@
#include <linux/console.h>
#include <linux/types.h>
+#include <linux/switch.h>
#include "../edid.h"
#include <video/mxc_edid.h>
@@ -176,6 +177,8 @@ struct mxc_hdmi {
struct fb_videomode default_mode;
struct fb_videomode previous_non_vga_mode;
bool requesting_vga_for_initialization;
+ struct switch_dev sdev_audio;
+ struct switch_dev sdev_display;
int *gpr_base;
int *gpr_hdmi_base;
@@ -2013,9 +2016,15 @@ static void hotplug_worker(struct work_struct *work)
#ifdef CONFIG_MXC_HDMI_CEC
mxc_hdmi_cec_handle(0x80);
#endif
+ switch_set_state(&hdmi->sdev_audio, 1);
+ switch_set_state(&hdmi->sdev_display, 1);
+
} else if (!(phy_int_pol & HDMI_PHY_HPD)) {
/* Plugout event */
dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n");
+ switch_set_state(&hdmi->sdev_audio, 0);
+ switch_set_state(&hdmi->sdev_display, 0);
+
hdmi_set_cable_state(0);
mxc_hdmi_abort_stream();
mxc_hdmi_cable_disconnected(hdmi);
@@ -2794,6 +2803,12 @@ static int mxc_hdmi_probe(struct platform_device *pdev)
ret = (int)hdmi->disp_mxc_hdmi;
goto edispdrv;
}
+
+ hdmi->sdev_audio.name = "hdmi_audio";
+ hdmi->sdev_display.name = "hdmi";
+ switch_dev_register(&hdmi->sdev_audio);
+ switch_dev_register(&hdmi->sdev_display);
+
mxc_dispdrv_setdata(hdmi->disp_mxc_hdmi, hdmi);
platform_set_drvdata(pdev, hdmi);
@@ -2823,6 +2838,9 @@ static int mxc_hdmi_remove(struct platform_device *pdev)
fb_unregister_client(&hdmi->nb);
+ switch_dev_unregister(&hdmi->sdev_audio);
+ switch_dev_unregister(&hdmi->sdev_display);
+
mxc_dispdrv_puthandle(hdmi->disp_mxc_hdmi);
mxc_dispdrv_unregister(hdmi->disp_mxc_hdmi);
iounmap(hdmi->gpr_base);