aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-bcm47xx/gpio.h
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2011-07-22 19:20:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-08 14:29:31 -0400
commita656ffcbc7a98a80d2136ae6bbdd8ae2eb48c78a (patch)
tree9b732b9a15ad8cc9c8790f36f3ac9a00bf6972c2 /arch/mips/include/asm/mach-bcm47xx/gpio.h
parent08ccf57283f89adbc2ff897ad82d6ad4560db7cd (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/include/asm/mach-bcm47xx/gpio.h')
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/gpio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 6b78827dd140..1d5f5af56b5f 100644
--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
@@ -22,8 +22,10 @@ extern int gpio_to_irq(unsigned gpio);
22static inline int gpio_get_value(unsigned gpio) 22static inline int gpio_get_value(unsigned gpio)
23{ 23{
24 switch (bcm47xx_bus_type) { 24 switch (bcm47xx_bus_type) {
25#ifdef CONFIG_BCM47XX_SSB
25 case BCM47XX_BUS_TYPE_SSB: 26 case BCM47XX_BUS_TYPE_SSB:
26 return ssb_gpio_in(&bcm47xx_bus.ssb, 1 << gpio); 27 return ssb_gpio_in(&bcm47xx_bus.ssb, 1 << gpio);
28#endif
27 } 29 }
28 return -EINVAL; 30 return -EINVAL;
29} 31}
@@ -31,18 +33,22 @@ static inline int gpio_get_value(unsigned gpio)
31static inline void gpio_set_value(unsigned gpio, int value) 33static inline void gpio_set_value(unsigned gpio, int value)
32{ 34{
33 switch (bcm47xx_bus_type) { 35 switch (bcm47xx_bus_type) {
36#ifdef CONFIG_BCM47XX_SSB
34 case BCM47XX_BUS_TYPE_SSB: 37 case BCM47XX_BUS_TYPE_SSB:
35 ssb_gpio_out(&bcm47xx_bus.ssb, 1 << gpio, 38 ssb_gpio_out(&bcm47xx_bus.ssb, 1 << gpio,
36 value ? 1 << gpio : 0); 39 value ? 1 << gpio : 0);
40#endif
37 } 41 }
38} 42}
39 43
40static inline int gpio_direction_input(unsigned gpio) 44static inline int gpio_direction_input(unsigned gpio)
41{ 45{
42 switch (bcm47xx_bus_type) { 46 switch (bcm47xx_bus_type) {
47#ifdef CONFIG_BCM47XX_SSB
43 case BCM47XX_BUS_TYPE_SSB: 48 case BCM47XX_BUS_TYPE_SSB:
44 ssb_gpio_outen(&bcm47xx_bus.ssb, 1 << gpio, 0); 49 ssb_gpio_outen(&bcm47xx_bus.ssb, 1 << gpio, 0);
45 return 0; 50 return 0;
51#endif
46 } 52 }
47 return -EINVAL; 53 return -EINVAL;
48} 54}
@@ -50,6 +56,7 @@ static inline int gpio_direction_input(unsigned gpio)
50static inline int gpio_direction_output(unsigned gpio, int value) 56static inline int gpio_direction_output(unsigned gpio, int value)
51{ 57{
52 switch (bcm47xx_bus_type) { 58 switch (bcm47xx_bus_type) {
59#ifdef CONFIG_BCM47XX_SSB
53 case BCM47XX_BUS_TYPE_SSB: 60 case BCM47XX_BUS_TYPE_SSB:
54 /* first set the gpio out value */ 61 /* first set the gpio out value */
55 ssb_gpio_out(&bcm47xx_bus.ssb, 1 << gpio, 62 ssb_gpio_out(&bcm47xx_bus.ssb, 1 << gpio,
@@ -57,6 +64,7 @@ static inline int gpio_direction_output(unsigned gpio, int value)
57 /* then set the gpio mode */ 64 /* then set the gpio mode */
58 ssb_gpio_outen(&bcm47xx_bus.ssb, 1 << gpio, 1 << gpio); 65 ssb_gpio_outen(&bcm47xx_bus.ssb, 1 << gpio, 1 << gpio);
59 return 0; 66 return 0;
67#endif
60 } 68 }
61 return -EINVAL; 69 return -EINVAL;
62} 70}
@@ -64,10 +72,12 @@ static inline int gpio_direction_output(unsigned gpio, int value)
64static inline int gpio_intmask(unsigned gpio, int value) 72static inline int gpio_intmask(unsigned gpio, int value)
65{ 73{
66 switch (bcm47xx_bus_type) { 74 switch (bcm47xx_bus_type) {
75#ifdef CONFIG_BCM47XX_SSB
67 case BCM47XX_BUS_TYPE_SSB: 76 case BCM47XX_BUS_TYPE_SSB:
68 ssb_gpio_intmask(&bcm47xx_bus.ssb, 1 << gpio, 77 ssb_gpio_intmask(&bcm47xx_bus.ssb, 1 << gpio,
69 value ? 1 << gpio : 0); 78 value ? 1 << gpio : 0);
70 return 0; 79 return 0;
80#endif
71 } 81 }
72 return -EINVAL; 82 return -EINVAL;
73} 83}
@@ -75,10 +85,12 @@ static inline int gpio_intmask(unsigned gpio, int value)
75static inline int gpio_polarity(unsigned gpio, int value) 85static inline int gpio_polarity(unsigned gpio, int value)
76{ 86{
77 switch (bcm47xx_bus_type) { 87 switch (bcm47xx_bus_type) {
88#ifdef CONFIG_BCM47XX_SSB
78 case BCM47XX_BUS_TYPE_SSB: 89 case BCM47XX_BUS_TYPE_SSB:
79 ssb_gpio_polarity(&bcm47xx_bus.ssb, 1 << gpio, 90 ssb_gpio_polarity(&bcm47xx_bus.ssb, 1 << gpio,
80 value ? 1 << gpio : 0); 91 value ? 1 << gpio : 0);
81 return 0; 92 return 0;
93#endif
82 } 94 }
83 return -EINVAL; 95 return -EINVAL;
84} 96}