aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/gpio-button-hotplug
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-02-12 08:29:11 +0000
committerJohn Crispin <blogic@openwrt.org>2016-02-12 08:29:11 +0000
commitff222b5bd577f6543c172b78d530560cc7bbe48b (patch)
treeef24ffe31526275c42207c2947d947e94dc9d04c /package/kernel/gpio-button-hotplug
parent2369b1e86e43cf7137c81ed7ffe54626ed35a733 (diff)
downloadmaster-187ad058-ff222b5bd577f6543c172b78d530560cc7bbe48b.tar.gz
master-187ad058-ff222b5bd577f6543c172b78d530560cc7bbe48b.tar.bz2
master-187ad058-ff222b5bd577f6543c172b78d530560cc7bbe48b.zip
kernel: gpio-button-hotplug: update to use threaded irq's
Many gpio controllers 'cansleep' due to the fact that they are behind busses e.g. i2c etc. Using threaded irq's allows for 'sleep-able' gpio's to be used. Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48696 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/gpio-button-hotplug')
-rw-r--r--package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 029a388d0e..6d1a197d61 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -555,20 +555,17 @@ static int gpio_keys_probe(struct platform_device *pdev)
struct gpio_keys_button *button = &pdata->buttons[i];
struct gpio_keys_button_data *bdata = &bdev->data[i];
- if (bdata->can_sleep) {
- dev_err(&pdev->dev, "skipping gpio:%d, it can sleep\n", button->gpio);
- continue;
- }
if (!button->irq)
button->irq = gpio_to_irq(button->gpio);
if (button->irq < 0) {
dev_err(&pdev->dev, "failed to get irq for gpio:%d\n", button->gpio);
continue;
}
- ret = devm_request_irq(&pdev->dev, button->irq, button_handle_irq,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- dev_name(&pdev->dev), bdata);
- if (ret)
+
+ ret = devm_request_threaded_irq(&pdev->dev, button->irq, NULL, button_handle_irq,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ dev_name(&pdev->dev), bdata);
+ if (ret < 0)
dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n", button->irq, button->gpio);
else
dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n", button->gpio, button->irq);