aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/901-fix_irq_type_of_pca953x.patch
blob: a00a2401353662320546c1577ccf8a7538c8f7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 12de4b5e7cbcd193d5abb753ca511fe8f2236846 Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Fri, 13 Nov 2020 07:30:03 +0100
Subject: [PATCH 1/1] gpio-pca953x: hack: Allow to use falling trigger

Gpio-mpc8xxx driver of Layerscape gpio support only edge interrupts.
Gpio-pca953x allow only low state trigger. This hack fix the problem.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---

--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -879,10 +879,12 @@ static int pca953x_irq_setup(struct pca9
 	for (i = 0; i < NBANK(chip); i++)
 		chip->irq_stat[i] &= reg_direction[i];
 	mutex_init(&chip->irq_lock);
-
+	/* gpio-mpc8xxx driver of Layerscape gpio support only edge interrupts.
+	 * This hack fix the problem.
+	 */
 	ret = devm_request_threaded_irq(&client->dev, client->irq,
 					NULL, pca953x_irq_handler,
-					IRQF_TRIGGER_LOW | IRQF_ONESHOT |
+					IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
 					IRQF_SHARED,
 					dev_name(&client->dev), chip);
 	if (ret) {