lkml.org 
[lkml]   [2016]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] extcon: gpio: queue work only if debounce is NZ
Date
Use queue_delayed_work only when debounce time is
required to read gpio state properly, read the gpio
state and set the extcon cable state in IRQ handler
context if gpio settling time is not needed.

Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
---
drivers/extcon/extcon-gpio.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index 279ff8f..1beb086 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -56,8 +56,12 @@ static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
{
struct gpio_extcon_data *data = dev_id;

- queue_delayed_work(system_power_efficient_wq, &data->work,
+ if (data->debounce_jiffies)
+ queue_delayed_work(system_power_efficient_wq, &data->work,
data->debounce_jiffies);
+ else
+ gpio_extcon_work(&data->work.work);
+
return IRQ_HANDLED;
}

--
2.1.4
\
 
 \ /
  Last update: 2016-03-08 13:21    [W:0.033 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site