Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 1 | #ifndef LINUX_SSB_PRIVATE_H_ |
| 2 | #define LINUX_SSB_PRIVATE_H_ |
| 3 | |
| 4 | #include <linux/ssb/ssb.h> |
| 5 | #include <linux/types.h> |
| 6 | |
| 7 | |
| 8 | #define PFX "ssb: " |
| 9 | |
| 10 | #ifdef CONFIG_SSB_SILENT |
| 11 | # define ssb_printk(fmt, x...) do { /* nothing */ } while (0) |
| 12 | #else |
| 13 | # define ssb_printk printk |
| 14 | #endif /* CONFIG_SSB_SILENT */ |
| 15 | |
| 16 | /* dprintk: Debugging printk; vanishes for non-debug compilation */ |
| 17 | #ifdef CONFIG_SSB_DEBUG |
| 18 | # define ssb_dprintk(fmt, x...) ssb_printk(fmt , ##x) |
| 19 | #else |
| 20 | # define ssb_dprintk(fmt, x...) do { /* nothing */ } while (0) |
| 21 | #endif |
| 22 | |
| 23 | #ifdef CONFIG_SSB_DEBUG |
| 24 | # define SSB_WARN_ON(x) WARN_ON(x) |
| 25 | # define SSB_BUG_ON(x) BUG_ON(x) |
| 26 | #else |
| 27 | static inline int __ssb_do_nothing(int x) { return x; } |
| 28 | # define SSB_WARN_ON(x) __ssb_do_nothing(unlikely(!!(x))) |
| 29 | # define SSB_BUG_ON(x) __ssb_do_nothing(unlikely(!!(x))) |
| 30 | #endif |
| 31 | |
| 32 | |
| 33 | /* pci.c */ |
| 34 | #ifdef CONFIG_SSB_PCIHOST |
| 35 | extern int ssb_pci_switch_core(struct ssb_bus *bus, |
| 36 | struct ssb_device *dev); |
| 37 | extern int ssb_pci_switch_coreidx(struct ssb_bus *bus, |
| 38 | u8 coreidx); |
| 39 | extern int ssb_pci_xtal(struct ssb_bus *bus, u32 what, |
| 40 | int turn_on); |
| 41 | extern int ssb_pci_get_invariants(struct ssb_bus *bus, |
| 42 | struct ssb_init_invariants *iv); |
| 43 | extern void ssb_pci_exit(struct ssb_bus *bus); |
| 44 | extern int ssb_pci_init(struct ssb_bus *bus); |
| 45 | extern const struct ssb_bus_ops ssb_pci_ops; |
| 46 | |
| 47 | #else /* CONFIG_SSB_PCIHOST */ |
| 48 | |
| 49 | static inline int ssb_pci_switch_core(struct ssb_bus *bus, |
| 50 | struct ssb_device *dev) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | static inline int ssb_pci_switch_coreidx(struct ssb_bus *bus, |
| 55 | u8 coreidx) |
| 56 | { |
| 57 | return 0; |
| 58 | } |
| 59 | static inline int ssb_pci_xtal(struct ssb_bus *bus, u32 what, |
| 60 | int turn_on) |
| 61 | { |
| 62 | return 0; |
| 63 | } |
| 64 | static inline void ssb_pci_exit(struct ssb_bus *bus) |
| 65 | { |
| 66 | } |
| 67 | static inline int ssb_pci_init(struct ssb_bus *bus) |
| 68 | { |
| 69 | return 0; |
| 70 | } |
| 71 | #endif /* CONFIG_SSB_PCIHOST */ |
| 72 | |
| 73 | |
| 74 | /* pcmcia.c */ |
| 75 | #ifdef CONFIG_SSB_PCMCIAHOST |
| 76 | extern int ssb_pcmcia_switch_core(struct ssb_bus *bus, |
| 77 | struct ssb_device *dev); |
| 78 | extern int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus, |
| 79 | u8 coreidx); |
| 80 | extern int ssb_pcmcia_switch_segment(struct ssb_bus *bus, |
| 81 | u8 seg); |
| 82 | extern int ssb_pcmcia_get_invariants(struct ssb_bus *bus, |
| 83 | struct ssb_init_invariants *iv); |
| 84 | extern int ssb_pcmcia_init(struct ssb_bus *bus); |
| 85 | extern const struct ssb_bus_ops ssb_pcmcia_ops; |
| 86 | #else /* CONFIG_SSB_PCMCIAHOST */ |
| 87 | static inline int ssb_pcmcia_switch_core(struct ssb_bus *bus, |
| 88 | struct ssb_device *dev) |
| 89 | { |
| 90 | return 0; |
| 91 | } |
| 92 | static inline int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus, |
| 93 | u8 coreidx) |
| 94 | { |
| 95 | return 0; |
| 96 | } |
| 97 | static inline int ssb_pcmcia_switch_segment(struct ssb_bus *bus, |
| 98 | u8 seg) |
| 99 | { |
| 100 | return 0; |
| 101 | } |
| 102 | static inline int ssb_pcmcia_init(struct ssb_bus *bus) |
| 103 | { |
| 104 | return 0; |
| 105 | } |
| 106 | #endif /* CONFIG_SSB_PCMCIAHOST */ |
| 107 | |
| 108 | |
| 109 | /* scan.c */ |
| 110 | extern const char *ssb_core_name(u16 coreid); |
| 111 | extern int ssb_bus_scan(struct ssb_bus *bus, |
| 112 | unsigned long baseaddr); |
| 113 | extern void ssb_iounmap(struct ssb_bus *ssb); |
| 114 | |
| 115 | |
| 116 | /* core.c */ |
| 117 | extern u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m); |
| 118 | extern int ssb_devices_freeze(struct ssb_bus *bus); |
| 119 | extern int ssb_devices_thaw(struct ssb_bus *bus); |
| 120 | extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev); |
Michael Buesch | aab547c | 2008-02-29 11:36:12 +0100 | [diff] [blame] | 121 | int ssb_for_each_bus_call(unsigned long data, |
| 122 | int (*func)(struct ssb_bus *bus, unsigned long data)); |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 123 | |
| 124 | /* b43_pci_bridge.c */ |
Alexey Zaytsev | c708453 | 2008-02-23 12:59:26 +0300 | [diff] [blame] | 125 | #ifdef CONFIG_SSB_B43_PCI_BRIDGE |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 126 | extern int __init b43_pci_ssb_bridge_init(void); |
| 127 | extern void __exit b43_pci_ssb_bridge_exit(void); |
Alexey Zaytsev | c708453 | 2008-02-23 12:59:26 +0300 | [diff] [blame] | 128 | #else /* CONFIG_SSB_B43_PCI_BRIDGR */ |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 129 | static inline int b43_pci_ssb_bridge_init(void) |
| 130 | { |
| 131 | return 0; |
| 132 | } |
| 133 | static inline void b43_pci_ssb_bridge_exit(void) |
| 134 | { |
| 135 | } |
| 136 | #endif /* CONFIG_SSB_PCIHOST */ |
| 137 | |
| 138 | #endif /* LINUX_SSB_PRIVATE_H_ */ |