1 #ifndef __SWITCH_GPIO_H
2 #define __SWITCH_GPIO_H
3 #include <linux/interrupt.h>
6 #include <linux/ssb/ssb.h>
7 #include <linux/ssb/ssb_driver_chipcommon.h>
8 #include <linux/ssb/ssb_driver_extif.h>
10 extern struct ssb_bus ssb
;
12 #define gpio_op(op, param...) \
15 return ssb_chipco_gpio_##op(&ssb.chipco, param); \
16 else if (ssb.extif.dev) \
17 return ssb_extif_gpio_##op(&ssb.extif, param); \
23 static inline u32
gpio_in(void)
28 static inline u32
gpio_out(u32 mask
, u32 value
)
30 gpio_op(out
, mask
, value
);
33 static inline u32
gpio_outen(u32 mask
, u32 value
)
35 gpio_op(outen
, mask
, value
);
38 static inline u32
gpio_control(u32 mask
, u32 value
)
41 return ssb_chipco_gpio_control(&ssb
.chipco
, mask
, value
);
46 static inline u32
gpio_intmask(u32 mask
, u32 value
)
48 gpio_op(intmask
, mask
, value
);
51 static inline u32
gpio_intpolarity(u32 mask
, u32 value
)
53 gpio_op(polarity
, mask
, value
);
64 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
70 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
71 #define sbh bcm947xx_sbh
72 #define sbh_lock bcm947xx_sbh_lock
76 extern spinlock_t sbh_lock
;
78 #define gpio_in() sb_gpioin(sbh)
79 #define gpio_out(mask, value) sb_gpioout(sbh, mask, ((value) & (mask)), GPIO_DRV_PRIORITY)
80 #define gpio_outen(mask, value) sb_gpioouten(sbh, mask, value, GPIO_DRV_PRIORITY)
81 #define gpio_control(mask, value) sb_gpiocontrol(sbh, mask, value, GPIO_DRV_PRIORITY)
82 #define gpio_intmask(mask, value) sb_gpiointmask(sbh, mask, value, GPIO_DRV_PRIORITY)
83 #define gpio_intpolarity(mask, value) sb_gpiointpolarity(sbh, mask, value, GPIO_DRV_PRIORITY)
85 #endif /* BCMDRIVER */
86 #endif /* __SWITCH_GPIO_H */
This page took 0.055671 seconds and 5 git commands to generate.