From c9c8d53074ea20eddb9225fc8c8bbdef1abebadd Mon Sep 17 00:00:00 2001 From: Deepak Karda Date: Fri, 9 Dec 2011 17:31:02 +0530 Subject: [Android] AV8100 : Implement uevent for accessory detection 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 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/41897 Reviewed-by: Jimmy RUBIN Reviewed-by: Christophe PRIOUZEAU Reviewed-by: Robert LIND Reviewed-by: Devinder THAKUR Reviewed-by: Hakan GARDRUP Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42054 Reviewed-by: QABUILD Tested-by: Axel FAGERSTEDT Reviewed-by: Per PERSSON --- drivers/video/av8100/hdmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 #include #include +#include #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]); -- cgit v1.2.3