aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/av8100/av8100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/av8100/av8100.c')
-rw-r--r--drivers/video/av8100/av8100.c160
1 files changed, 11 insertions, 149 deletions
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;