Lines Matching +full:static +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-only
20 #include <asm/mach-au1x00/au1000.h>
28 #define USBHEN_RD (1 << 4) /* OHCI reset-done indicator */
29 #define USBHEN_CE (1 << 3) /* OHCI block clock enable */
30 #define USBHEN_E (1 << 2) /* OHCI block enable */
32 #define USBHEN_BE (1 << 0) /* OHCI Big-Endian */
35 #define USBCFG_PFEN (1 << 31) /* prefetch enable (undoc) */
40 #define USBCFG_UCE (1 << 18) /* UDC clock enable */
41 #define USBCFG_ECE (1 << 17) /* EHCI clock enable */
42 #define USBCFG_OCE (1 << 16) /* OHCI clock enable */
46 #define USBCFG_DBE (1 << 5) /* UDC busmaster enable */
47 #define USBCFG_DME (1 << 4) /* UDC mem enable */
48 #define USBCFG_EBE (1 << 3) /* EHCI busmaster enable */
49 #define USBCFG_EME (1 << 2) /* EHCI mem enable */
50 #define USBCFG_OBE (1 << 1) /* OHCI busmaster enable */
51 #define USBCFG_OME (1 << 0) /* OHCI mem enable */
75 #define USB_DWC_CTRL1_HSTRS 0x02 /* set to ENable EHCI */
76 #define USB_DWC_CTRL1_DCRS 0x01 /* set to ENable UDC */
78 #define USB_DWC_CTRL2_PHY1RS 0x04 /* set to enable PHY1 */
79 #define USB_DWC_CTRL2_PHY0RS 0x02 /* set to enable PHY0 */
80 #define USB_DWC_CTRL2_PHYRS 0x01 /* set to enable PHY */
96 static DEFINE_SPINLOCK(alchemy_usb_lock);
98 static inline void __au1300_usb_phyctl(void __iomem *base, int enable) in __au1300_usb_phyctl() argument
108 if (enable) { in __au1300_usb_phyctl()
109 /* simply enable all PHYs */ in __au1300_usb_phyctl()
123 static inline void __au1300_ohci_control(void __iomem *base, int enable, int id) in __au1300_ohci_control() argument
127 if (enable) { in __au1300_ohci_control()
131 r = __raw_readl(base + USB_DWC_CTRL3); /* enable OHCI block */ in __au1300_ohci_control()
137 __au1300_usb_phyctl(base, enable); /* power up the PHYs */ in __au1300_ohci_control()
159 __au1300_usb_phyctl(base, enable); in __au1300_ohci_control()
163 static inline void __au1300_ehci_control(void __iomem *base, int enable) in __au1300_ehci_control() argument
167 if (enable) { in __au1300_ehci_control()
178 __au1300_usb_phyctl(base, enable); in __au1300_ehci_control()
200 __au1300_usb_phyctl(base, enable); in __au1300_ehci_control()
204 static inline void __au1300_udc_control(void __iomem *base, int enable) in __au1300_udc_control() argument
208 if (enable) { in __au1300_udc_control()
214 __au1300_usb_phyctl(base, enable); in __au1300_udc_control()
231 __au1300_usb_phyctl(base, enable); in __au1300_udc_control()
235 static inline void __au1300_otg_control(void __iomem *base, int enable) in __au1300_otg_control() argument
238 if (enable) { in __au1300_otg_control()
249 __au1300_usb_phyctl(base, enable); in __au1300_otg_control()
261 __au1300_usb_phyctl(base, enable); in __au1300_otg_control()
265 static inline int au1300_usb_control(int block, int enable) in au1300_usb_control() argument
273 __au1300_ohci_control(base, enable, 0); in au1300_usb_control()
276 __au1300_ohci_control(base, enable, 1); in au1300_usb_control()
279 __au1300_ehci_control(base, enable); in au1300_usb_control()
282 __au1300_udc_control(base, enable); in au1300_usb_control()
285 __au1300_otg_control(base, enable); in au1300_usb_control()
288 ret = -ENODEV; in au1300_usb_control()
293 static inline void au1300_usb_init(void) in au1300_usb_init()
316 static inline void __au1200_ohci_control(void __iomem *base, int enable) in __au1200_ohci_control() argument
319 if (enable) { in __au1200_ohci_control()
330 static inline void __au1200_ehci_control(void __iomem *base, int enable) in __au1200_ehci_control() argument
333 if (enable) { in __au1200_ehci_control()
346 static inline void __au1200_udc_control(void __iomem *base, int enable) in __au1200_udc_control() argument
349 if (enable) { in __au1200_udc_control()
360 static inline int au1200_usb_control(int block, int enable) in au1200_usb_control() argument
367 __au1200_ohci_control(base, enable); in au1200_usb_control()
370 __au1200_udc_control(base, enable); in au1200_usb_control()
373 __au1200_ehci_control(base, enable); in au1200_usb_control()
376 return -ENODEV; in au1200_usb_control()
383 static inline void au1200_usb_init(void) in au1200_usb_init()
392 static inline int au1000_usb_init(unsigned long rb, int reg) in au1000_usb_init()
401 return -ENODEV; in au1000_usb_init()
404 return -ENODEV; in au1000_usb_init()
408 return -ENODEV; in au1000_usb_init()
425 static inline void __au1xx0_ohci_control(int enable, unsigned long rb, int creg) in __au1xx0_ohci_control() argument
434 if (enable) { in __au1xx0_ohci_control()
458 static inline int au1000_usb_control(int block, int enable, unsigned long rb, in au1000_usb_control() argument
465 __au1xx0_ohci_control(enable, rb, creg); in au1000_usb_control()
468 ret = -ENODEV; in au1000_usb_control()
474 * alchemy_usb_control - control Alchemy on-chip USB blocks
476 * @enable: set 1 to enable a block, 0 to disable
478 int alchemy_usb_control(int block, int enable) in alchemy_usb_control() argument
488 ret = au1000_usb_control(block, enable, in alchemy_usb_control()
492 ret = au1000_usb_control(block, enable, in alchemy_usb_control()
496 ret = au1200_usb_control(block, enable); in alchemy_usb_control()
499 ret = au1300_usb_control(block, enable); in alchemy_usb_control()
502 ret = -ENODEV; in alchemy_usb_control()
510 static unsigned long alchemy_usb_pmdata[2];
512 static void au1000_usb_pm(unsigned long br, int creg, int susp) in au1000_usb_pm()
529 static void au1200_usb_pm(int susp) in au1200_usb_pm()
549 static void au1300_usb_pm(int susp) in au1300_usb_pm()
563 static void alchemy_usb_pm(int susp) in alchemy_usb_pm()
583 static int alchemy_usb_suspend(void) in alchemy_usb_suspend()
589 static void alchemy_usb_resume(void) in alchemy_usb_resume()
594 static struct syscore_ops alchemy_usb_pm_ops = {
599 static int __init alchemy_usb_init(void) in alchemy_usb_init()