summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:46:21 +0800
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:46:21 +0800
commitc65e9ef43160d318d715d5a1c8752864aace85f0 (patch)
tree734e90231be8443f4e602e100a66b9e0728e20f5 /drivers/video
parenta549a293afbca113e261edb74493a373df72dcdb (diff)
parentc9c8d53074ea20eddb9225fc8c8bbdef1abebadd (diff)
Merge topic branch 'video-android' into integration-android-ux500
Diffstat (limited to 'drivers/video')
-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]);