diff options
| author | Jee Su Chang <w20740@motorola.com> | 2014-05-01 15:11:46 -0500 |
|---|---|---|
| committer | Jee Su Chang <w20740@motorola.com> | 2014-05-01 20:15:47 +0000 |
| commit | 2b571d15d6ff78c5d79562098ed1a013aefebc04 (patch) | |
| tree | 1a759130f99d91fe0332db461d00656392731790 /drivers/misc/c55_ctrl.c | |
| parent | 21e4cbbfefdce720f74e97e9b2c018176aa60cea (diff) | |
| download | olio-linux-3.10-2b571d15d6ff78c5d79562098ed1a013aefebc04.tar.xz olio-linux-3.10-2b571d15d6ff78c5d79562098ed1a013aefebc04.zip | |
IKXCLOCK-991 c55: IRQ unbalanced enable
Change-Id: I5c12fdd6f168f33739933d7374ffef256128feac
Diffstat (limited to 'drivers/misc/c55_ctrl.c')
| -rw-r--r-- | drivers/misc/c55_ctrl.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/misc/c55_ctrl.c b/drivers/misc/c55_ctrl.c index 6df8bbcbf43..31dbd6cde57 100644 --- a/drivers/misc/c55_ctrl.c +++ b/drivers/misc/c55_ctrl.c @@ -34,6 +34,7 @@ enum { struct c55_ctrl_data { int c55_ap_int_gpio; int ap_c55_int_gpio; + int c55_ap_int_enabled; struct wake_lock wake_lock; struct regulator *reg_vddc; struct regulator *reg_vddldo; @@ -79,6 +80,7 @@ static void c55_ctrl_int_setup(struct c55_ctrl_data *cdata, int gpio) flags |= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; flags |= IRQF_SHARED; + cdata->c55_ap_int_enabled = 1; ret = request_threaded_irq(irq, c55_ctrl_isr, NULL, flags, "c55_ctrl", cdata); if (ret) { @@ -164,10 +166,17 @@ static ssize_t c55_ctrl_enable(struct device *dev, return -EINVAL; } - enable_irq(__gpio_to_irq(cdata->c55_ap_int_gpio)); + if (!cdata->c55_ap_int_enabled) { + cdata->c55_ap_int_enabled = 1; + enable_irq(__gpio_to_irq(cdata->c55_ap_int_gpio)); + } } else { /* Disable C55->AP IRQ when turning off C55 */ - disable_irq_nosync(__gpio_to_irq(cdata->c55_ap_int_gpio)); + if (cdata->c55_ap_int_enabled) { + disable_irq_nosync( + __gpio_to_irq(cdata->c55_ap_int_gpio)); + cdata->c55_ap_int_enabled = 0; + } if (m4sensorhub_reg_write_1byte (m4sensorhub, M4SH_REG_USERSETTINGS_SCREENSTATUS, 0x00, 0xFF |