From 1fc29f1d66d8d7a26c33eabaa2a52f13bc6778a5 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Tue, 23 Dec 2014 17:20:38 +0100 Subject: [PATCH 1/3] Add ifdef to make kernel compile without CONFIG_BCM2708_DT=y --- arch/arm/mach-bcm2708/bcm2708_gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c index 2c52835ff41539..4cce6c07dd3a73 100644 --- a/arch/arm/mach-bcm2708/bcm2708_gpio.c +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -90,6 +90,7 @@ static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset, return 0; } +#ifdef CONFIG_BCM2708_DT static int bcm2708_gpio_request(struct gpio_chip *chip, unsigned offset) { return pinctrl_request_gpio(chip->base + offset); @@ -99,6 +100,7 @@ static void bcm2708_gpio_free(struct gpio_chip *chip, unsigned offset) { pinctrl_free_gpio(chip->base + offset); } +#endif static int bcm2708_gpio_dir_in(struct gpio_chip *gc, unsigned offset) { @@ -355,8 +357,10 @@ static int bcm2708_gpio_probe(struct platform_device *dev) ucb->gc.ngpio = BCM2708_NR_GPIOS; ucb->gc.owner = THIS_MODULE; +#ifdef CONFIG_BCM2708_DT ucb->gc.request = bcm2708_gpio_request; ucb->gc.free = bcm2708_gpio_free; +#endif ucb->gc.direction_input = bcm2708_gpio_dir_in; ucb->gc.direction_output = bcm2708_gpio_dir_out; ucb->gc.get = bcm2708_gpio_get; From e93d599a65ccf8d950e069f1cb86fc73a3488270 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 24 Dec 2014 15:34:04 +0100 Subject: [PATCH 2/3] Add ifdef and include for pinctl definitions --- arch/arm/mach-bcm2708/bcm2708_gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c index 4cce6c07dd3a73..d51f41c80e55e8 100644 --- a/arch/arm/mach-bcm2708/bcm2708_gpio.c +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -21,7 +21,9 @@ #include #include #include - +#ifdef CONFIG_BCM2708_DT +#include +#endif #include #define BCM_GPIO_DRIVER_NAME "bcm2708_gpio" From a8ecf4b66a043c1ee70c62c5dd0de104c6863c7b Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 24 Dec 2014 20:39:25 +0100 Subject: [PATCH 3/3] Remove ifdefs and add just include of 'linux/pinctrl/consumer.h' --- arch/arm/mach-bcm2708/bcm2708_gpio.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c index d51f41c80e55e8..b0b0077bbf394d 100644 --- a/arch/arm/mach-bcm2708/bcm2708_gpio.c +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -21,9 +21,8 @@ #include #include #include -#ifdef CONFIG_BCM2708_DT #include -#endif + #include #define BCM_GPIO_DRIVER_NAME "bcm2708_gpio" @@ -92,7 +91,6 @@ static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset, return 0; } -#ifdef CONFIG_BCM2708_DT static int bcm2708_gpio_request(struct gpio_chip *chip, unsigned offset) { return pinctrl_request_gpio(chip->base + offset); @@ -102,7 +100,6 @@ static void bcm2708_gpio_free(struct gpio_chip *chip, unsigned offset) { pinctrl_free_gpio(chip->base + offset); } -#endif static int bcm2708_gpio_dir_in(struct gpio_chip *gc, unsigned offset) { @@ -359,10 +356,8 @@ static int bcm2708_gpio_probe(struct platform_device *dev) ucb->gc.ngpio = BCM2708_NR_GPIOS; ucb->gc.owner = THIS_MODULE; -#ifdef CONFIG_BCM2708_DT ucb->gc.request = bcm2708_gpio_request; ucb->gc.free = bcm2708_gpio_free; -#endif ucb->gc.direction_input = bcm2708_gpio_dir_in; ucb->gc.direction_output = bcm2708_gpio_dir_out; ucb->gc.get = bcm2708_gpio_get;