summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-04-15 18:01:41 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2015-05-08 17:26:28 +0800
commit2f868661c651757151d046e51965a95889b1537c (patch)
tree5fc4d1eae652d585ac9cba2cd5033ead74e7fd8d
parentbc628dabd0f08af019bc5957393c9a99f88cafc4 (diff)
MA-6541: sii902x: Add switch event for hdmi audio in sii902x
Add switch event for hdmi audio in sii902x Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
-rw-r--r--drivers/video/mxc/mxsfb_sii902x.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/mxc/mxsfb_sii902x.c b/drivers/video/mxc/mxsfb_sii902x.c
index beddaf82dc6f..0c4fa52e52b1 100644
--- a/drivers/video/mxc/mxsfb_sii902x.c
+++ b/drivers/video/mxc/mxsfb_sii902x.c
@@ -48,6 +48,7 @@
#include <linux/reset.h>
#include <asm/mach-types.h>
#include <video/mxc_edid.h>
+#include <linux/switch.h>
#define SII_EDID_LEN 512
#define DRV_NAME "sii902x"
@@ -62,6 +63,7 @@ struct sii902x_data {
bool dft_mode_set;
const char *mode_str;
int bits_per_pixel;
+ struct switch_dev sdev_audio;
} sii902x;
static void sii902x_poweron(void);
@@ -302,11 +304,15 @@ static void det_worker(struct work_struct *work)
dev_dbg(&sii902x.client->dev, "EVENT=plugin\n");
sprintf(event_string, "EVENT=plugin");
sii902x_cable_connected();
+
+ switch_set_state(&sii902x.sdev_audio, 1);
+
} else {
sii902x.cable_plugin = 0;
dev_dbg(&sii902x.client->dev, "EVENT=plugout\n");
sprintf(event_string, "EVENT=plugout");
/* Power off sii902x */
+ switch_set_state(&sii902x.sdev_audio, 0);
sii902x_poweroff();
}
kobject_uevent_env(&sii902x.client->dev.kobj, KOBJ_CHANGE, envp);
@@ -465,11 +471,16 @@ static int sii902x_probe(struct i2c_client *client,
mxsfb_get_of_property();
fb_register_client(&nb);
+ sii902x.sdev_audio.name = "hdmi_audio";
+ switch_dev_register(&sii902x.sdev_audio);
+
return 0;
}
static int sii902x_remove(struct i2c_client *client)
{
+ switch_dev_unregister(&sii902x.sdev_audio);
+
fb_unregister_client(&nb);
sii902x_poweroff();