diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-01-05 14:53:10 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-01-05 15:02:06 +0000 |
commit | 75becdeef9900f0f77751201143f861b4c3cb65e (patch) | |
tree | 7323878d8311631f668d2596309b331e778c8ac1 /main/linux-rpi/rotary-encoder-fix.patch | |
parent | 0798b2a34e3d7f0e063cb2a5bc117527bd4b1f99 (diff) | |
download | aports-75becdeef9900f0f77751201143f861b4c3cb65e.tar.bz2 aports-75becdeef9900f0f77751201143f861b4c3cb65e.tar.xz |
main/linux-rpi: apply rotary-encoder dts fix and rpi mmc-spi fix
fixes #4973
Diffstat (limited to 'main/linux-rpi/rotary-encoder-fix.patch')
-rw-r--r-- | main/linux-rpi/rotary-encoder-fix.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/main/linux-rpi/rotary-encoder-fix.patch b/main/linux-rpi/rotary-encoder-fix.patch new file mode 100644 index 0000000000..0d9c6ba59f --- /dev/null +++ b/main/linux-rpi/rotary-encoder-fix.patch @@ -0,0 +1,62 @@ +From e2b19ed7b2284e808dfca3e9207ad52c09e11104 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Wed, 23 Dec 2015 16:37:00 +0200 +Subject: [PATCH] Input: rotary-encoder: use request_any_context_irq and + gpio_get_value_cansleep +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows to use GPIO expanders behind I2C or SPI bus. + +Signed-off-by: Timo Teräs <timo.teras@iki.fi> +--- + drivers/input/misc/rotary_encoder.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c +index 8aee719..8bedd7b 100644 +--- a/drivers/input/misc/rotary_encoder.c ++++ b/drivers/input/misc/rotary_encoder.c +@@ -48,8 +48,8 @@ struct rotary_encoder { + + static int rotary_encoder_get_state(const struct rotary_encoder_platform_data *pdata) + { +- int a = !!gpio_get_value(pdata->gpio_a); +- int b = !!gpio_get_value(pdata->gpio_b); ++ int a = !!gpio_get_value_cansleep(pdata->gpio_a); ++ int b = !!gpio_get_value_cansleep(pdata->gpio_b); + + a ^= pdata->inverted_a; + b ^= pdata->inverted_b; +@@ -335,18 +335,18 @@ static int rotary_encoder_probe(struct platform_device *pdev) + goto exit_free_gpio_b; + } + +- err = request_irq(encoder->irq_a, handler, +- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, +- DRV_NAME, encoder); +- if (err) { ++ err = request_any_context_irq(encoder->irq_a, handler, ++ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ++ DRV_NAME, encoder); ++ if (err < 0) { + dev_err(dev, "unable to request IRQ %d\n", encoder->irq_a); + goto exit_free_gpio_b; + } + +- err = request_irq(encoder->irq_b, handler, +- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, +- DRV_NAME, encoder); +- if (err) { ++ err = request_any_context_irq(encoder->irq_b, handler, ++ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ++ DRV_NAME, encoder); ++ if (err < 0) { + dev_err(dev, "unable to request IRQ %d\n", encoder->irq_b); + goto exit_free_irq_a; + } +-- +2.6.4 + + |