summaryrefslogtreecommitdiff
path: root/drivers/video/mxc
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-03-29 16:13:36 +0800
committerJason Chen <b02280@freescale.com>2011-03-30 14:35:05 +0800
commit4e521125a8d70f33bcaabb99a53d0ef4616ec94f (patch)
treec142d1e7237974691e9e107f553cf357c31e4ce3 /drivers/video/mxc
parent69077131aaffe1ec60fdc942e024fc047a30e4a1 (diff)
ENGR00141312 tve: add uevent for tve cable detection
When cable mode changed, below uevent will be sent out: EVENT=NONE EVENT=CVBS0 EVENT=YPBPR EVENT=SVIDEO under /sys/devices/platform/tve.0 Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers/video/mxc')
-rw-r--r--drivers/video/mxc/tve.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/video/mxc/tve.c b/drivers/video/mxc/tve.c
index 1b0c154582a0..e3a7c7949d8b 100644
--- a/drivers/video/mxc/tve.c
+++ b/drivers/video/mxc/tve.c
@@ -748,6 +748,8 @@ static int tve_update_detect_status(void)
u32 cd_cont_reg;
u32 timeout = 40;
unsigned long lock_flags;
+ char event_string[16];
+ char *envp[] = { event_string, NULL };
spin_lock_irqsave(&tve_lock, lock_flags);
@@ -829,8 +831,18 @@ static int tve_update_detect_status(void)
__raw_writel(int_ctl | CD_SM_INT | CD_LM_INT,
tve.base + tve_regs->tve_int_cont_reg);
- if (old_detect != tve.detect)
+ if (old_detect != tve.detect) {
sysfs_notify(&tve.pdev->dev.kobj, NULL, "headphone");
+ if (tve.detect == 1)
+ sprintf(event_string, "EVENT=CVBS0");
+ else if (tve.detect == 3)
+ sprintf(event_string, "EVENT=YPBPR");
+ else if (tve.detect == 4)
+ sprintf(event_string, "EVENT=SVIDEO");
+ else
+ sprintf(event_string, "EVENT=NONE");
+ kobject_uevent_env(&tve.pdev->dev.kobj, KOBJ_CHANGE, envp);
+ }
dev_dbg(&tve.pdev->dev, "detect = %d mode = %d\n",
tve.detect, tve.output_mode);