summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0070-gpio-aspeed-temporary-fix-for-gpiochip-range-setting.patch
blob: bcee8bc6c758897962193636f416d524a166e3ab (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 89e1d083726d4d56703a6787f4707d61a2c0efd1 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 19 Jul 2019 12:54:38 -0700
Subject: [PATCH] gpio: aspeed: temporary fix for gpiochip range setting

Since we are still using fixed indices for gpio line numbers for sysfs
interface, this commit set the gpiochip range as fixed temporariliy
til we replace all index based gpio uses with name based uses.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
 drivers/gpio/gpio-aspeed.c  | 2 +-
 drivers/gpio/sgpio-aspeed.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index ac33f8134fe6..4f1a40b3a73f 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -1181,7 +1181,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
 	gpio->chip.set = aspeed_gpio_set;
 	gpio->chip.set_config = aspeed_gpio_set_config;
 	gpio->chip.label = dev_name(&pdev->dev);
-	gpio->chip.base = -1;
+	gpio->chip.base = 0;
 
 	/* Allocate a cache of the output registers */
 	banks = DIV_ROUND_UP(gpio->chip.ngpio, 32);
diff --git a/drivers/gpio/sgpio-aspeed.c b/drivers/gpio/sgpio-aspeed.c
index d2dbfce531a4..792ef0d70ecf 100644
--- a/drivers/gpio/sgpio-aspeed.c
+++ b/drivers/gpio/sgpio-aspeed.c
@@ -678,7 +678,7 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
 	gpio->chip.set = aspeed_sgpio_set;
 	gpio->chip.set_config = aspeed_sgpio_set_config;
 	gpio->chip.label = dev_name(&pdev->dev);
-	gpio->chip.base = -1;
+	gpio->chip.base = gpio->config->nr_pgpios;
 
 	rc = aspeed_sgpio_setup_irqs(gpio, pdev);
 	if (rc < 0)
-- 
2.7.4