diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2011-07-22 19:20:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-08 14:29:31 -0400 |
commit | a656ffcbc7a98a80d2136ae6bbdd8ae2eb48c78a (patch) | |
tree | 9b732b9a15ad8cc9c8790f36f3ac9a00bf6972c2 /arch/mips/bcm47xx/gpio.c | |
parent | 08ccf57283f89adbc2ff897ad82d6ad4560db7cd (diff) |
bcm47xx: make it possible to build bcm47xx without ssb.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'arch/mips/bcm47xx/gpio.c')
-rw-r--r-- | arch/mips/bcm47xx/gpio.c | 6 |
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); | |||
21 | int gpio_request(unsigned gpio, const char *tag) | 21 | int 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); | |||
42 | void gpio_free(unsigned gpio) | 44 | void 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 | } |
58 | EXPORT_SYMBOL(gpio_free); | 62 | EXPORT_SYMBOL(gpio_free); |
@@ -60,6 +64,7 @@ EXPORT_SYMBOL(gpio_free); | |||
60 | int gpio_to_irq(unsigned gpio) | 64 | int 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 | } |