1 #ifndef LINUX_SSB_PRIVATE_H_
2 #define LINUX_SSB_PRIVATE_H_
4 #include <linux/ssb/ssb.h>
5 #include <linux/types.h>
11 #ifdef CONFIG_SSB_SILENT
12 # define ssb_printk(fmt, x...) do { /* nothing */ } while (0)
14 # define ssb_printk printk
15 #endif /* CONFIG_SSB_SILENT */
17 /* dprintk: Debugging printk; vanishes for non-debug compilation */
18 #ifdef CONFIG_SSB_DEBUG
19 # define ssb_dprintk(fmt, x...) ssb_printk(fmt ,##x)
21 # define ssb_dprintk(fmt, x...) do { /* nothing */ } while (0)
24 /* printkl: Rate limited printk */
25 #define ssb_printkl(fmt, x...) do { \
26 if (printk_ratelimit()) \
27 ssb_printk(fmt ,##x); \
30 /* dprintkl: Rate limited debugging printk */
31 #ifdef CONFIG_SSB_DEBUG
32 # define ssb_dprintkl ssb_printkl
34 # define ssb_dprintkl(fmt, x...) do { /* nothing */ } while (0)
37 #define assert(cond) do { \
38 if (unlikely(!(cond))) { \
39 ssb_dprintk(KERN_ERR PFX "BUG: Assertion failed (%s) " \
41 #cond, __FILE__, __LINE__, __func__); \
47 #ifdef CONFIG_SSB_PCIHOST
48 extern int ssb_pci_switch_core(struct ssb_bus *bus,
49 struct ssb_device *dev);
50 extern int ssb_pci_switch_coreidx(struct ssb_bus *bus,
52 extern int ssb_pci_xtal(struct ssb_bus *bus, u32 what,
54 extern int ssb_pci_get_invariants(struct ssb_bus *bus,
55 struct ssb_init_invariants *iv);
56 extern void ssb_pci_exit(struct ssb_bus *bus);
57 extern int ssb_pci_init(struct ssb_bus *bus);
58 extern const struct ssb_bus_ops ssb_pci_ops;
60 #else /* CONFIG_SSB_PCIHOST */
62 static inline int ssb_pci_switch_core(struct ssb_bus *bus,
63 struct ssb_device *dev)
67 static inline int ssb_pci_switch_coreidx(struct ssb_bus *bus,
72 static inline int ssb_pci_xtal(struct ssb_bus *bus, u32 what,
77 static inline void ssb_pci_exit(struct ssb_bus *bus)
80 static inline int ssb_pci_init(struct ssb_bus *bus)
84 #endif /* CONFIG_SSB_PCIHOST */
88 #ifdef CONFIG_SSB_PCMCIAHOST
89 extern int ssb_pcmcia_switch_core(struct ssb_bus *bus,
90 struct ssb_device *dev);
91 extern int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus,
93 extern int ssb_pcmcia_switch_segment(struct ssb_bus *bus,
95 extern int ssb_pcmcia_get_invariants(struct ssb_bus *bus,
96 struct ssb_init_invariants *iv);
97 extern int ssb_pcmcia_init(struct ssb_bus *bus);
98 extern const struct ssb_bus_ops ssb_pcmcia_ops;
99 #else /* CONFIG_SSB_PCMCIAHOST */
100 static inline int ssb_pcmcia_switch_core(struct ssb_bus *bus,
101 struct ssb_device *dev)
105 static inline int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus,
110 static inline int ssb_pcmcia_switch_segment(struct ssb_bus *bus,
115 static inline int ssb_pcmcia_init(struct ssb_bus *bus)
119 #endif /* CONFIG_SSB_PCMCIAHOST */
123 extern const char * ssb_core_name(u16 coreid);
124 extern int ssb_bus_scan(struct ssb_bus *bus,
125 unsigned long baseaddr);
126 extern void ssb_iounmap(struct ssb_bus *ssb);
130 extern u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m);
131 #ifdef CONFIG_SSB_PCIHOST
132 extern int ssb_devices_freeze(struct ssb_bus *bus);
133 extern int ssb_devices_thaw(struct ssb_bus *bus);
134 extern struct ssb_bus * ssb_pci_dev_to_bus(struct pci_dev *pdev);
135 #endif /* CONFIG_SSB_PCIHOST */
137 #endif /* LINUX_SSB_PRIVATE_H_ */