summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@stericsson.com>2012-04-06 11:43:53 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-04-06 11:43:53 +0200
commit2ee8379b83e5afb57dd19192109380736c1c4431 (patch)
tree9e222282e7d9a1ef0681475056972ccd55000b57
parente8bcf4679aee5fd98a0fd07a9866b3a3ff62d56a (diff)
parent916692af3e8c2a8609c41666d2220fa857114157 (diff)
Merge branch 'video-android' into stable-android-ux500-3.3-1
-rw-r--r--drivers/video/av8100/hdmi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/av8100/hdmi.c b/drivers/video/av8100/hdmi.c
index 3159c4446f1..d1e40e7ca2f 100644
--- a/drivers/video/av8100/hdmi.c
+++ b/drivers/video/av8100/hdmi.c
@@ -26,6 +26,7 @@
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/list.h>
+#include <linux/switch.h>
#define SYSFS_EVENT_FILENAME "evread"
#define HDMI_DEVNR_DEFAULT 0
@@ -45,6 +46,7 @@ struct hdmi_device {
wait_queue_head_t event_wq;
bool events_received;
int devnr;
+ struct switch_dev switch_hdmi_detection;
};
/* List of devices */
@@ -2341,12 +2343,14 @@ void hdmi_event(enum av8100_hdmi_event ev)
case AV8100_HDMI_EVENT_HDMI_PLUGIN:
hdev->events &= ~HDMI_EVENT_HDMI_PLUGOUT;
hdev->events |= HDMI_EVENT_HDMI_PLUGIN;
+ switch_set_state(&hdev->switch_hdmi_detection, 1);
break;
case AV8100_HDMI_EVENT_HDMI_PLUGOUT:
hdev->events &= ~HDMI_EVENT_HDMI_PLUGIN;
hdev->events |= HDMI_EVENT_HDMI_PLUGOUT;
cec_tx_status(hdev, CEC_TX_SET_FREE);
+ switch_set_state(&hdev->switch_hdmi_detection, 0);
break;
case AV8100_HDMI_EVENT_CEC:
@@ -2444,6 +2448,9 @@ int __init hdmi_init(void)
hdmi_sysfs_attrs[i].attr.name, ret);
}
+ hdev->switch_hdmi_detection.name = "hdmi";
+ switch_dev_register(&hdev->switch_hdmi_detection);
+
/* Register event callback */
av8100_hdmi_event_cb_set(hdmi_event);
@@ -2465,6 +2472,8 @@ void hdmi_exit(void)
/* Deregister event callback */
av8100_hdmi_event_cb_set(NULL);
+ switch_dev_unregister(&hdev->switch_hdmi_detection);
+
/* Remove sysfs attrs */
for (i = 0; attr_name(hdmi_sysfs_attrs[i]); i++)
device_remove_file(hdev->dev, &hdmi_sysfs_attrs[i]);