surprise :p
[openwrt.git] / target / linux / ar71xx / patches / 003-ar71xx_usb_host.patch
1 --- a/drivers/usb/host/Kconfig
2 +++ b/drivers/usb/host/Kconfig
3 @@ -260,3 +260,15 @@
4           To compile this driver as a module, choose M here: the
5           module will be called r8a66597-hcd.
6  
7 +config USB_OHCI_AR71XX
8 +       bool "USB OHCI support for Atheros AR71xx"
9 +       depends on ATHEROS_AR71XX && USB_OHCI_HCD
10 +       help
11 +         Support for Atheros AR71xx built-in OHCI controller
12 +
13 +config USB_EHCI_AR71XX
14 +       bool "USB EHCI support for AR71xx"
15 +       depends on ATHEROS_AR71XX && USB_EHCI_HCD
16 +       help
17 +         Support for Atheros AR71xx built-in EHCI controller
18 +
19 --- a/drivers/usb/host/ehci-hcd.c
20 +++ b/drivers/usb/host/ehci-hcd.c
21 @@ -1043,6 +1043,11 @@
22  #define        PLATFORM_DRIVER         ixp4xx_ehci_driver
23  #endif
24  
25 +#ifdef CONFIG_USB_EHCI_AR71XX
26 +#include "ehci-ar71xx.c"
27 +#define PLATFORM_DRIVER                ehci_hcd_ar71xx_driver
28 +#endif
29 +
30  #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
31      !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
32  #error "missing bus glue for ehci-hcd"
33 --- a/drivers/usb/host/ohci.h
34 +++ b/drivers/usb/host/ohci.h
35 @@ -538,6 +538,11 @@
36  #define writel_be(val, addr)   out_be32((__force unsigned *)addr, val)
37  #endif
38  
39 +#if defined(CONFIG_ATHEROS_AR71XX)
40 +#define readl_be(addr)         __raw_readl(addr)
41 +#define writel_be(val, addr)   __raw_writel(addr, val)
42 +#endif
43 +
44  static inline unsigned int _ohci_readl (const struct ohci_hcd *ohci,
45                                         __hc32 __iomem * regs)
46  {
47 --- a/drivers/usb/host/ohci-hcd.c
48 +++ b/drivers/usb/host/ohci-hcd.c
49 @@ -1057,6 +1057,11 @@
50  #define PLATFORM_DRIVER                ohci_hcd_sm501_driver
51  #endif
52  
53 +#ifdef CONFIG_USB_OHCI_AR71XX
54 +#include "ohci-ar71xx.c"
55 +#define PLATFORM_DRIVER                ohci_hcd_ar71xx_driver
56 +#endif
57 +
58  #if    !defined(PCI_DRIVER) &&         \
59         !defined(PLATFORM_DRIVER) &&    \
60         !defined(OF_PLATFORM_DRIVER) && \