Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions arch/arm/mach-tegra/htc_headset_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ unsigned long unstable_jiffies = 0.02 * HZ;
unsigned long irq_delay = 0.010 * HZ;

static int headset_uart_enable = 0;
static bool key_irq_enabled = false;

/*
* This function should be called while caller thread holding a
Expand Down Expand Up @@ -134,12 +133,8 @@ static void button_gpio_work_func(struct work_struct *work)

static void hs_key_irq_enable_func(struct work_struct *work)
{
if (key_irq_enabled)
return;

HS_DBG();
enable_irq(hi->key_irq);
key_irq_enabled = true;
}

static void cancel_button_work_func(struct work_struct *work)
Expand Down Expand Up @@ -173,7 +168,6 @@ static irqreturn_t button_irq_handler(int irq, void *dev_id)
HS_DBG();

disable_irq_nosync(hi->key_irq);
key_irq_enabled = false;

hi->key_irq_type ^= irq_mask;
irq_set_irq_type(hi->key_irq, hi->key_irq_type);
Expand Down Expand Up @@ -342,7 +336,6 @@ static void detect_gpio_work_func(struct work_struct *work)
if (ret < 0)
HS_ERR("request irq error;");
disable_irq_nosync(hi->key_irq);
key_irq_enabled = false;
}

if (hi->key_irq){
Expand All @@ -351,13 +344,11 @@ static void detect_gpio_work_func(struct work_struct *work)
if (ret < 0)
HS_ERR("set irq wake error");
enable_irq(hi->key_irq);
key_irq_enabled = true;
}else{
ret = irq_set_irq_wake(hi->key_irq, 0);
if (ret < 0)
HS_ERR("set irq wake error");
disable_irq_nosync(hi->key_irq);
key_irq_enabled = false;
}
}
}
Expand All @@ -366,15 +357,11 @@ static void detect_gpio_work_func(struct work_struct *work)
static int hs_gpio_key_int_enable(int enable)
{
if (enable) {
if (!key_irq_enabled){
HS_LOG("Key int enable");
enable_irq(hi->key_irq);
key_irq_enabled = true;
}
HS_LOG("Key int enable");
enable_irq(hi->key_irq);
} else {
HS_LOG("Key int disable");
disable_irq_nosync(hi->key_irq);
key_irq_enabled = false;
}
return 0;
}
Expand Down