1 #ifndef __BCM947XX_GPIO_H
2 #define __BCM947XX_GPIO_H
4 #include <linux/ssb/ssb.h>
5 #include <linux/ssb/ssb_driver_chipcommon.h>
6 #include <linux/ssb/ssb_driver_extif.h>
8 extern struct ssb_bus ssb
;
10 static inline int gpio_request(unsigned gpio
, const char *label
)
15 static inline void gpio_free(unsigned gpio
)
19 static inline int gpio_direction_input(unsigned gpio
)
22 ssb_chipco_gpioouten(&ssb
.chipco
, 1 << gpio
, 0);
23 else if (ssb
.extif
->dev
)
24 ssb_extif_gpioouten(&ssb
.extif
, 1 << gpio
, 0);
30 static inline int gpio_direction_output(unsigned gpio
)
33 ssb_chipco_gpioouten(&ssb
.chipco
, 1 << gpio
, 1 << gpio
);
34 else if (ssb
.extif
->dev
)
35 ssb_extif_gpioouten(&ssb
.extif
, 1 << gpio
, 1 << gpio
);
43 static inline int gpio_to_irq(unsigned gpio
)
45 struct ssb_device
*dev
;
47 dev
= ssb
.chipco
->dev
;
53 return ssb_mips_irq(dev
) + 2;
56 static inline int irq_to_gpio(unsigned gpio
)
62 static inline int gpio_get_value(unsigned gpio
)
65 return ssb_chipco_gpioin(&ssb
.chipco
, 1 << gpio
) ? 1 : 0;
66 else if (ssb
.extif
->dev
)
67 return ssb_extif_gpioin(&ssb
.extif
, 1 << gpio
) ? 1 : 0;
72 static inline int gpio_set_value(unsigned gpio
, int value
)
75 ssb_chipco_gpioout(&ssb
.chipco
, 1 << gpio
, (value
? 1 << gpio
: 0));
76 else if (ssb
.extif
->dev
)
77 ssb_extif_gpioout(&ssb
.extif
, 1 << gpio
, (value
? 1 << gpio
: 0));
83 /* cansleep wrappers */
84 #include <asm-generic/gpio.h>
87 #endif /* __BCM947XX_GPIO_H */
This page took 0.052087 seconds and 5 git commands to generate.