layerscape: add i2c peripherials on LS1012A-RDB
[openwrt/openwrt.git] / target / linux / layerscape / patches-5.4 / 901-fix_irq_type_of_pca953x.patch
1 From 12de4b5e7cbcd193d5abb753ca511fe8f2236846 Mon Sep 17 00:00:00 2001
2 From: Pawel Dembicki <paweldembicki@gmail.com>
3 Date: Fri, 13 Nov 2020 07:30:03 +0100
4 Subject: [PATCH 1/1] gpio-pca953x: hack: Allow to use falling trigger
5
6 Gpio-mpc8xxx driver of Layerscape gpio support only edge interrupts.
7 Gpio-pca953x allow only low state trigger. This hack fix the problem.
8
9 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
10 ---
11
12 --- a/drivers/gpio/gpio-pca953x.c
13 +++ b/drivers/gpio/gpio-pca953x.c
14 @@ -879,10 +879,12 @@ static int pca953x_irq_setup(struct pca9
15 for (i = 0; i < NBANK(chip); i++)
16 chip->irq_stat[i] &= reg_direction[i];
17 mutex_init(&chip->irq_lock);
18 -
19 + /* gpio-mpc8xxx driver of Layerscape gpio support only edge interrupts.
20 + * This hack fix the problem.
21 + */
22 ret = devm_request_threaded_irq(&client->dev, client->irq,
23 NULL, pca953x_irq_handler,
24 - IRQF_TRIGGER_LOW | IRQF_ONESHOT |
25 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
26 IRQF_SHARED,
27 dev_name(&client->dev), chip);
28 if (ret) {