1 #ifndef __SWITCH_GPIO_H
2 #define __SWITCH_GPIO_H
3 #include <linux/interrupt.h>
6 #include <linux/ssb/ssb_embedded.h>
8 extern struct ssb_bus ssb
;
11 static inline u32
gpio_in(void)
13 return ssb_gpio_in(&ssb
, ~0);
16 static inline u32
gpio_out(u32 mask
, u32 value
)
18 return ssb_gpio_out(&ssb
, mask
, value
);
21 static inline u32
gpio_outen(u32 mask
, u32 value
)
23 return ssb_gpio_outen(&ssb
, mask
, value
);
26 static inline u32
gpio_control(u32 mask
, u32 value
)
28 return ssb_gpio_control(&ssb
, mask
, value
);
31 static inline u32
gpio_intmask(u32 mask
, u32 value
)
33 return ssb_gpio_intmask(&ssb
, mask
, value
);
36 static inline u32
gpio_intpolarity(u32 mask
, u32 value
)
38 return ssb_gpio_polarity(&ssb
, mask
, value
);
49 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
55 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
56 #define sbh bcm947xx_sbh
57 #define sbh_lock bcm947xx_sbh_lock
61 extern spinlock_t sbh_lock
;
63 #define gpio_in() sb_gpioin(sbh)
64 #define gpio_out(mask, value) sb_gpioout(sbh, mask, ((value) & (mask)), GPIO_DRV_PRIORITY)
65 #define gpio_outen(mask, value) sb_gpioouten(sbh, mask, value, GPIO_DRV_PRIORITY)
66 #define gpio_control(mask, value) sb_gpiocontrol(sbh, mask, value, GPIO_DRV_PRIORITY)
67 #define gpio_intmask(mask, value) sb_gpiointmask(sbh, mask, value, GPIO_DRV_PRIORITY)
68 #define gpio_intpolarity(mask, value) sb_gpiointpolarity(sbh, mask, value, GPIO_DRV_PRIORITY)
70 #endif /* BCMDRIVER */
71 #endif /* __SWITCH_GPIO_H */
This page took 0.04577 seconds and 5 git commands to generate.