summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
blob: 2faf0dea29d7e32d4f42486e50ad2cb586adac17 (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
From e55892aac9d5508a000647ca66f0e678e02be3bb Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
Date: Sat, 21 Feb 2015 17:26:50 +0100
Subject: [PATCH 5/6] MIPS: BCM63XX: do not register gpio-controller if
present in dtb

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/gpio.c |   7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/arch/mips/bcm63xx/gpio.c
+++ b/arch/mips/bcm63xx/gpio.c
@@ -20,6 +20,8 @@
 #include <bcm63xx_gpio.h>
 #include <bcm63xx_regs.h>
 
+#include "boards/board_common.h"
+
 /* for registering lookups; make them large enough to hold OF names */
 static char *gpio_chip_labels[] = {
 	"xxxxxxxx.gpio-controller",
@@ -50,8 +52,9 @@ static void __init bcm63xx_gpio_init_one
 	pdata.ngpio = ngpio;
 
 	sprintf(gpio_chip_labels[id], "bcm63xx-gpio.%d", id);
-	platform_device_register_resndata(NULL, "bcm63xx-gpio", id, res, 2,
-					  &pdata, sizeof(pdata));
+	if (!board_of_device_present("gpio0"))
+		platform_device_register_resndata(NULL, "bcm63xx-gpio", id, res,
+						  2, &pdata, sizeof(pdata));
 }
 
 int __init bcm63xx_gpio_init(void)