summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepak Karda <deepak.karda@stericsson.com>2011-12-09 17:31:02 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:04:30 +0200
commitc9c8d53074ea20eddb9225fc8c8bbdef1abebadd (patch)
tree8eca6b33f6c6e04016adf53114169f9cdd43a020
parentb7086e0a1dec82bf7e8e96e17738151f0aee82fc (diff)
[Android] AV8100 : Implement uevent for accessory detectionvideo-android
Ice Cream Sandwich come with the new service for Audio accessory detection. This patch ensures that av8100 hdmi source code send correct event to android code. ST-Ericsson ID: 398326 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I3e3cfa6a19736a806749dbdc03de02d8b76b75e1 Signed-off-by: Deepak Karda <deepak.karda@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/41897 Reviewed-by: Jimmy RUBIN <jimmy.rubin@stericsson.com> Reviewed-by: Christophe PRIOUZEAU <christophe.priouzeau@stericsson.com> Reviewed-by: Robert LIND <robert.lind@stericsson.com> Reviewed-by: Devinder THAKUR <devinder.thakur@stericsson.com> Reviewed-by: Hakan GARDRUP <hakan.gardrup@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42054 Reviewed-by: QABUILD Tested-by: Axel FAGERSTEDT <axel.fagerstedt@stericsson.com> Reviewed-by: Per PERSSON <per.xb.persson@stericsson.com>
-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]);