aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Persson <per.xb.persson@stericsson.com>2011-02-15 07:56:26 +0100
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-02-16 10:07:51 +0100
commitf09ef13eec45d17139eef3a2370abac121825e21 (patch)
tree1ea577ff03eb678df1e52a1e39edbc5be2d209bb
parent1349864485a3c8a7a77b8946b7855d65a9aff19d (diff)
video: av8100: Avoid frame interrupts in HDMI when HWtrigu8500-android-2.3_v0.15
1. When HWtrig is used, tearing interrupts should be avoided in AV8100 for power performance reasons. 2. Remove unnecessary code as these interrupts don't occur. ST-Ericsson ID: ER 323825 Change-Id: I629466aa394274d261f08e2299170c9944f5a0f2 Signed-off-by: Per Persson <per.xb.persson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/15082 Reviewed-by: Jimmy RUBIN <jimmy.rubin@stericsson.com> Reviewed-by: Marcel TUNNISSEN <marcel.tuennissen@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/board-mop500.c7
-rw-r--r--drivers/video/av8100/av8100.c160
-rw-r--r--include/video/av8100.h1
3 files changed, 12 insertions, 156 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index f9ca32739bd..ef5309dbc78 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -271,13 +271,8 @@ static struct ske_keypad_platform_data mop500_ske_keypad_data = {
};
static struct av8100_platform_data av8100_plat_data = {
- .irq = GPIO_TO_IRQ(192),
+ .irq = GPIO_TO_IRQ(192),
.reset = 196,
-#if defined CONFIG_AV8100_HWTRIG_INT || defined CONFIG_AV8100_HWTRIG_I2SDAT3
- .timer_ints = true,
-#else
- .timer_ints = false,
-#endif
.inputclk_id = "sysclk2",
.regulator_pwr_id = "hdmi_1v8",
};
diff --git a/drivers/video/av8100/av8100.c b/drivers/video/av8100/av8100.c
index 30e427666d3..bc508e98c35 100644
--- a/drivers/video/av8100/av8100.c
+++ b/drivers/video/av8100/av8100.c
@@ -36,10 +36,8 @@
/* Interrupts */
#define AV8100_INT_EVENT 0x1
-#define AV8100_TIMER_INT_EVENT 0x2
#define AV8100_PLUGSTARTUP_EVENT 0x4
-#define AV8100_TIMER_INTERRUPT_POLLING_TIME 250
#define AV8100_PLUGSTARTUP_TIME 100
/* Standby search time */
@@ -187,11 +185,6 @@ struct av8100_globals_t {
u8 cpdm;/*stby_int_mask*/
u8 cecm;/*gen_int_mask*/
u8 hdcpm;/*gen_int_mask*/
- bool use_timer_int;
- u8 hpds_old;
- u8 cpds_old;
- u8 cecrx_old;
- u8 hdcps_old;
void (*hdmi_ev_cb)(enum av8100_hdmi_event);
enum av8100_plug_state plug_state;
struct clk *inputclk;
@@ -266,7 +259,6 @@ static int __devexit av8100_remove(struct i2c_client *i2cClient);
static struct av8100_config_t *av8100_config;
static struct av8100_status g_av8100_status = {0};
-static struct timer_list av8100_timer;
static struct timer_list av8100_plugtimer;
static wait_queue_head_t av8100_event;
static int av8100_flag = 0x0;
@@ -491,18 +483,6 @@ static struct i2c_driver av8100_driver = {
.id_table = av8100_id,
};
-static void av8100_timer_int(unsigned long value)
-{
- av8100_flag |= AV8100_TIMER_INT_EVENT;
- wake_up_interruptible(&av8100_event);
-
- if (g_av8100_status.av8100_state >= AV8100_OPMODE_STANDBY) {
- av8100_timer.expires = jiffies +
- AV8100_TIMER_INTERRUPT_POLLING_TIME;
- add_timer(&av8100_timer);
- }
-}
-
static void av8100_plugtimer_int(unsigned long value)
{
av8100_flag |= AV8100_PLUGSTARTUP_EVENT;
@@ -510,74 +490,6 @@ static void av8100_plugtimer_int(unsigned long value)
del_timer(&av8100_plugtimer);
}
-static int av8100_timer_int_event_handle(void)
-{
- u8 hpds = 0;
- u8 cpds = 0;
- u8 hdcps = 0;
- u8 cecrx = 0;
- u8 *hpds_old;
- u8 *cpds_old;
- u8 *hdcps_old;
- u8 *cecrx_old;
-
- if (!av8100_globals)
- return -EINVAL;
-
- hpds_old = &(av8100_globals->hpds_old);
- cpds_old = &(av8100_globals->cpds_old);
- cecrx_old = &(av8100_globals->cecrx_old);
- hdcps_old = &(av8100_globals->hdcps_old);
-
- /* STANDBY reg */
- if (av8100_reg_stby_r(NULL, NULL, &hpds, &cpds, NULL) != 0)
- dev_dbg(av8100dev, "av8100_reg_stby_r fail\n");
-
- /* TVout plugin change */
- if ((cpds == 1) && (cpds != *cpds_old)) {
- *cpds_old = 1;
- dev_dbg(av8100dev, "cpds 1\n");
- set_plug_status(AV8100_CVBS_PLUGIN);
- } else if ((cpds == 0) && (cpds != *cpds_old)) {
- *cpds_old = 0;
- dev_dbg(av8100dev, "cpds 0\n");
- clr_plug_status(AV8100_CVBS_PLUGIN);
- }
-
- /* HDMI plugin change */
- if ((hpds == 1) && (hpds != *hpds_old)) {
- *hpds_old = 1;
- dev_dbg(av8100dev, "hpds 1\n");
- set_plug_status(AV8100_HDMI_PLUGIN);
- } else if ((hpds == 0) && (hpds != *hpds_old)) {
- *hpds_old = 0;
- dev_dbg(av8100dev, "hpds 0\n");
- clr_plug_status(AV8100_HDMI_PLUGIN);
- }
-
- /* GENERAL_STATUS reg */
- if (av8100_reg_gen_status_r(&cecrx, NULL, NULL, NULL, &hdcps) != 0)
- dev_dbg(av8100dev, "av8100_reg_gen_status_r fail\n");
- else {
- if ((cecrx == 1) && (cecrx != *cecrx_old)) {
- dev_dbg(av8100dev, "cecrx\n");
- /* Report CEC event */
- cec_rx();
- }
- *cecrx_old = cecrx;
-
- if (hdcps != *hdcps_old) {
- dev_dbg(av8100dev, "hdcpch:%0x\n",
- hdcps);
- /* Report HDCP status change event */
- hdcp_changed();
- }
- *hdcps_old = hdcps;
- }
-
- return 0;
-}
-
static int av8100_int_event_handle(void)
{
u8 hpdi = 0;
@@ -722,16 +634,11 @@ static int av8100_thread(void *p)
g_av8100_status.av8100_state < AV8100_OPMODE_STANDBY)
continue;
- if (av8100_globals->use_timer_int) {
- if (flags & AV8100_TIMER_INT_EVENT)
- (void)av8100_timer_int_event_handle();
- } else {
- if (flags & AV8100_INT_EVENT)
- (void)av8100_int_event_handle();
+ if (flags & AV8100_INT_EVENT)
+ (void)av8100_int_event_handle();
- if (flags & AV8100_PLUGSTARTUP_EVENT)
- (void)av8100_plugstartup_event_handle();
- }
+ if (flags & AV8100_PLUGSTARTUP_EVENT)
+ (void)av8100_plugstartup_event_handle();
}
return 0;
@@ -979,7 +886,7 @@ static void av8100_config_exit(void)
av8100_config = NULL;
}
-static int av8100_globals_init(bool timer_ints)
+static int av8100_globals_init(void)
{
dev_dbg(av8100dev, "%s\n", __func__);
@@ -992,31 +899,11 @@ static int av8100_globals_init(bool timer_ints)
av8100_globals->denc_off_time = AV8100_DENC_OFF_TIME;
av8100_globals->hdmi_off_time = AV8100_HDMI_OFF_TIME;
av8100_globals->on_time = AV8100_ON_TIME;
- av8100_globals->hpds_old = 0xf;
- av8100_globals->cpds_old = 0xf;
- av8100_globals->cecrx_old = 0xf;
- av8100_globals->hdcps_old = 0xf;
- /*
- * We should not use the interrupt event handler for non-trig events
- * with older boards since the trig mechanism cause interrupts.
- * There would be a lot of I2C traffic if handling occur 60 times per
- * second. For non-trig events, timer interrupts are used instead.
- */
- if (timer_ints) {
- av8100_globals->use_timer_int = true;
- av8100_globals->hpdm = AV8100_STANDBY_INTERRUPT_MASK_HPDM_LOW;
- av8100_globals->cpdm = AV8100_STANDBY_INTERRUPT_MASK_CPDM_LOW;
- av8100_globals->hdcpm = AV8100_GENERAL_INTERRUPT_MASK_HDCPM_LOW;
- av8100_globals->cecm = AV8100_GENERAL_INTERRUPT_MASK_CECM_LOW;
- } else {
- av8100_globals->use_timer_int = false;
- av8100_globals->hpdm = AV8100_STANDBY_INTERRUPT_MASK_HPDM_HIGH;
- av8100_globals->cpdm = AV8100_STANDBY_INTERRUPT_MASK_CPDM_HIGH;
- av8100_globals->hdcpm =
- AV8100_GENERAL_INTERRUPT_MASK_HDCPM_HIGH;
- av8100_globals->cecm = AV8100_GENERAL_INTERRUPT_MASK_CECM_HIGH;
- }
+ av8100_globals->hpdm = AV8100_STANDBY_INTERRUPT_MASK_HPDM_HIGH;
+ av8100_globals->cpdm = AV8100_STANDBY_INTERRUPT_MASK_CPDM_HIGH;
+ av8100_globals->hdcpm = AV8100_GENERAL_INTERRUPT_MASK_HDCPM_HIGH;
+ av8100_globals->cecm = AV8100_GENERAL_INTERRUPT_MASK_CECM_HIGH;
av8100_globals->plug_state = AV8100_UNPLUGGED;
av8100_globals->inputclk = NULL;
@@ -1082,13 +969,6 @@ static void set_plug_status(enum av8100_plugin_status status)
switch (av8100_globals->plug_state) {
case AV8100_UNPLUGGED:
- if (av8100_globals->use_timer_int) {
- av8100_globals->plug_state =
- AV8100_PLUGGED;
- dev_dbg(av8100dev, "plug_state:2\n");
- break;
- }
-
av8100_globals->plug_state =
AV8100_PLUGGED_STARTUP;
@@ -2257,15 +2137,6 @@ int av8100_disable_interrupt(void)
if (av8100_globals) {
av8100_globals->hpdm = hpdm;
av8100_globals->cpdm = cpdm;
-
- if (av8100_globals->use_timer_int) {
- del_timer(&av8100_timer);
-
- /* Reset to be able to detect changes */
- av8100_globals->hpds_old = HPDS_INVALID;
- av8100_globals->cpds_old = CPDS_INVALID;
- av8100_globals->cecrx_old = CECRX_INVALID;
- }
}
return 0;
@@ -2302,7 +2173,7 @@ int av8100_enable_interrupt(void)
av8100_globals->cecm,
av8100_globals->hdcpm,
AV8100_GENERAL_INTERRUPT_MASK_UOVBM_LOW,
- AV8100_GENERAL_INTERRUPT_MASK_TEM_HIGH);
+ AV8100_GENERAL_INTERRUPT_MASK_TEM_LOW);
if (retval) {
dev_dbg(av8100dev,
"Failed to write the value to av8100 register\n");
@@ -2320,15 +2191,6 @@ int av8100_enable_interrupt(void)
return -EFAULT;
}
- if (av8100_globals->use_timer_int) {
- init_timer(&av8100_timer);
- av8100_timer.expires = jiffies +
- AV8100_TIMER_INTERRUPT_POLLING_TIME;
- av8100_timer.function = av8100_timer_int;
- av8100_timer.data = 0;
- add_timer(&av8100_timer);
- }
-
return 0;
}
EXPORT_SYMBOL(av8100_enable_interrupt);
@@ -3617,7 +3479,7 @@ static int __devinit av8100_probe(struct i2c_client *i2cClient,
goto err;
}
- ret = av8100_globals_init(pdata->timer_ints);
+ ret = av8100_globals_init();
if (ret) {
dev_info(av8100dev, "av8100_globals_init failed\n");
goto err;
diff --git a/include/video/av8100.h b/include/video/av8100.h
index ef80e870729..0a8093364c7 100644
--- a/include/video/av8100.h
+++ b/include/video/av8100.h
@@ -22,7 +22,6 @@ struct av8100_platform_data {
unsigned gpio_base;
int irq;
int reset;
- bool timer_ints;
const char *inputclk_id;
const char *regulator_pwr_id;
};