aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm47xx/gpio.c')
-rw-r--r--arch/mips/bcm47xx/gpio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/gpio.c b/arch/mips/bcm47xx/gpio.c
index 99e1c50caf6b..2b804c36750b 100644
--- a/arch/mips/bcm47xx/gpio.c
+++ b/arch/mips/bcm47xx/gpio.c
@@ -21,6 +21,7 @@ static DECLARE_BITMAP(gpio_in_use, BCM47XX_EXTIF_GPIO_LINES);
21int gpio_request(unsigned gpio, const char *tag) 21int gpio_request(unsigned gpio, const char *tag)
22{ 22{
23 switch (bcm47xx_bus_type) { 23 switch (bcm47xx_bus_type) {
24#ifdef CONFIG_BCM47XX_SSB
24 case BCM47XX_BUS_TYPE_SSB: 25 case BCM47XX_BUS_TYPE_SSB:
25 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) && 26 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
26 ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES)) 27 ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
@@ -34,6 +35,7 @@ int gpio_request(unsigned gpio, const char *tag)
34 return -EBUSY; 35 return -EBUSY;
35 36
36 return 0; 37 return 0;
38#endif
37 } 39 }
38 return -EINVAL; 40 return -EINVAL;
39} 41}
@@ -42,6 +44,7 @@ EXPORT_SYMBOL(gpio_request);
42void gpio_free(unsigned gpio) 44void gpio_free(unsigned gpio)
43{ 45{
44 switch (bcm47xx_bus_type) { 46 switch (bcm47xx_bus_type) {
47#ifdef CONFIG_BCM47XX_SSB
45 case BCM47XX_BUS_TYPE_SSB: 48 case BCM47XX_BUS_TYPE_SSB:
46 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) && 49 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
47 ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES)) 50 ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
@@ -53,6 +56,7 @@ void gpio_free(unsigned gpio)
53 56
54 clear_bit(gpio, gpio_in_use); 57 clear_bit(gpio, gpio_in_use);
55 return; 58 return;
59#endif
56 } 60 }
57} 61}
58EXPORT_SYMBOL(gpio_free); 62EXPORT_SYMBOL(gpio_free);
@@ -60,6 +64,7 @@ EXPORT_SYMBOL(gpio_free);
60int gpio_to_irq(unsigned gpio) 64int gpio_to_irq(unsigned gpio)
61{ 65{
62 switch (bcm47xx_bus_type) { 66 switch (bcm47xx_bus_type) {
67#ifdef CONFIG_BCM47XX_SSB
63 case BCM47XX_BUS_TYPE_SSB: 68 case BCM47XX_BUS_TYPE_SSB:
64 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco)) 69 if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco))
65 return ssb_mips_irq(bcm47xx_bus.ssb.chipco.dev) + 2; 70 return ssb_mips_irq(bcm47xx_bus.ssb.chipco.dev) + 2;
@@ -67,6 +72,7 @@ int gpio_to_irq(unsigned gpio)
67 return ssb_mips_irq(bcm47xx_bus.ssb.extif.dev) + 2; 72 return ssb_mips_irq(bcm47xx_bus.ssb.extif.dev) + 2;
68 else 73 else
69 return -EINVAL; 74 return -EINVAL;
75#endif
70 } 76 }
71 return -EINVAL; 77 return -EINVAL;
72} 78}