Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #ifndef LINUX_SSB_PRIVATE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #define LINUX_SSB_PRIVATE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #define PFX		"ssb: "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #define pr_fmt(fmt)	PFX fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/ssb/ssb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/bcm47xx_wdt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) /* pci.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #ifdef CONFIG_SSB_PCIHOST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) extern int ssb_pci_switch_core(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 			       struct ssb_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) extern int ssb_pci_switch_coreidx(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 				  u8 coreidx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) extern int ssb_pci_xtal(struct ssb_bus *bus, u32 what,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 			int turn_on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) extern int ssb_pci_get_invariants(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 				  struct ssb_init_invariants *iv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) extern void ssb_pci_exit(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) extern int ssb_pci_init(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) extern const struct ssb_bus_ops ssb_pci_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #else /* CONFIG_SSB_PCIHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) static inline int ssb_pci_switch_core(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 				      struct ssb_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static inline int ssb_pci_switch_coreidx(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 					 u8 coreidx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static inline int ssb_pci_xtal(struct ssb_bus *bus, u32 what,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 			       int turn_on)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) static inline void ssb_pci_exit(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) static inline int ssb_pci_init(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #endif /* CONFIG_SSB_PCIHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) /* pcmcia.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #ifdef CONFIG_SSB_PCMCIAHOST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) extern int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 				     u8 coreidx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) extern int ssb_pcmcia_switch_segment(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 				     u8 seg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) extern int ssb_pcmcia_get_invariants(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 				     struct ssb_init_invariants *iv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) extern int ssb_pcmcia_hardware_setup(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) extern void ssb_pcmcia_exit(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) extern int ssb_pcmcia_init(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) extern int ssb_host_pcmcia_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) extern void ssb_host_pcmcia_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) extern const struct ssb_bus_ops ssb_pcmcia_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #else /* CONFIG_SSB_PCMCIAHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) static inline int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 					    u8 coreidx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static inline int ssb_pcmcia_switch_segment(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 					    u8 seg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) static inline int ssb_pcmcia_hardware_setup(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) static inline void ssb_pcmcia_exit(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) static inline int ssb_pcmcia_init(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) static inline int ssb_host_pcmcia_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) static inline void ssb_host_pcmcia_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) #endif /* CONFIG_SSB_PCMCIAHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) /* sdio.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #ifdef CONFIG_SSB_SDIOHOST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) extern int ssb_sdio_get_invariants(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 				     struct ssb_init_invariants *iv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) extern u32 ssb_sdio_scan_read32(struct ssb_bus *bus, u16 offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) extern int ssb_sdio_scan_switch_coreidx(struct ssb_bus *bus, u8 coreidx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) extern void ssb_sdio_exit(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) extern int ssb_sdio_init(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) extern const struct ssb_bus_ops ssb_sdio_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #else /* CONFIG_SSB_SDIOHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) static inline u32 ssb_sdio_scan_read32(struct ssb_bus *bus, u16 offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) static inline int ssb_sdio_scan_switch_coreidx(struct ssb_bus *bus, u8 coreidx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) static inline void ssb_sdio_exit(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) static inline int ssb_sdio_init(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #endif /* CONFIG_SSB_SDIOHOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) /**************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  * host_soc.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  **************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #ifdef CONFIG_SSB_HOST_SOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) extern const struct ssb_bus_ops ssb_host_soc_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) extern int ssb_host_soc_get_invariants(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 				       struct ssb_init_invariants *iv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) /* scan.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) extern const char *ssb_core_name(u16 coreid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) extern int ssb_bus_scan(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			unsigned long baseaddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) extern void ssb_iounmap(struct ssb_bus *ssb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) /* sprom.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) extern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ssize_t ssb_attr_sprom_show(struct ssb_bus *bus, char *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			    int (*sprom_read)(struct ssb_bus *bus, u16 *sprom));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) extern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) ssize_t ssb_attr_sprom_store(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 			     const char *buf, size_t count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 			     int (*sprom_check_crc)(const u16 *sprom, size_t size),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 			     int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 					struct ssb_sprom *out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) /* core.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) extern u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) int ssb_for_each_bus_call(unsigned long data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 			  int (*func)(struct ssb_bus *bus, unsigned long data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) extern struct ssb_bus *ssb_pcmcia_dev_to_bus(struct pcmcia_device *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) struct ssb_freeze_context {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	/* Pointer to the bus */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	struct ssb_bus *bus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	/* Boolean list to indicate whether a device is frozen on this bus. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	bool device_frozen[SSB_MAX_NR_CORES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) extern int ssb_devices_freeze(struct ssb_bus *bus, struct ssb_freeze_context *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) extern int ssb_devices_thaw(struct ssb_freeze_context *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) /* b43_pci_bridge.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #ifdef CONFIG_SSB_B43_PCI_BRIDGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) extern int __init b43_pci_ssb_bridge_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) extern void __exit b43_pci_ssb_bridge_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) #else /* CONFIG_SSB_B43_PCI_BRIDGE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) static inline int b43_pci_ssb_bridge_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) static inline void b43_pci_ssb_bridge_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #endif /* CONFIG_SSB_B43_PCI_BRIDGE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /* driver_chipcommon_pmu.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) extern u32 ssb_pmu_get_cpu_clock(struct ssb_chipcommon *cc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) extern u32 ssb_pmu_get_controlclock(struct ssb_chipcommon *cc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) extern u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) extern u32 ssb_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 					     u32 ticks);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) extern u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) /* driver_chipcommon_sflash.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #ifdef CONFIG_SSB_SFLASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) int ssb_sflash_init(struct ssb_chipcommon *cc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) static inline int ssb_sflash_init(struct ssb_chipcommon *cc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	pr_err("Serial flash not supported\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #endif /* CONFIG_SSB_SFLASH */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) #ifdef CONFIG_SSB_DRIVER_MIPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) extern struct platform_device ssb_pflash_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #ifdef CONFIG_SSB_SFLASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) extern struct platform_device ssb_sflash_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #ifdef CONFIG_SSB_DRIVER_EXTIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) static inline u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 						   u32 ticks)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) static inline u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 						  u32 ms)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) #ifdef CONFIG_SSB_EMBEDDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) extern int ssb_watchdog_register(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) #else /* CONFIG_SSB_EMBEDDED */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) static inline int ssb_watchdog_register(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #endif /* CONFIG_SSB_EMBEDDED */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) #ifdef CONFIG_SSB_DRIVER_EXTIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) extern void ssb_extif_init(struct ssb_extif *extif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) static inline void ssb_extif_init(struct ssb_extif *extif)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #ifdef CONFIG_SSB_DRIVER_GPIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) extern int ssb_gpio_init(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) extern int ssb_gpio_unregister(struct ssb_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) #else /* CONFIG_SSB_DRIVER_GPIO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) static inline int ssb_gpio_init(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	return -ENOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) static inline int ssb_gpio_unregister(struct ssb_bus *bus)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #endif /* CONFIG_SSB_DRIVER_GPIO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #endif /* LINUX_SSB_PRIVATE_H_ */