aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci.h')
-rw-r--r--drivers/usb/host/ohci.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 4ada43cf1387..47c5c66a282c 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -398,11 +398,38 @@ struct ohci_hcd {
398#define OHCI_QUIRK_BE_MMIO 0x10 /* BE registers */ 398#define OHCI_QUIRK_BE_MMIO 0x10 /* BE registers */
399#define OHCI_QUIRK_ZFMICRO 0x20 /* Compaq ZFMicro chipset*/ 399#define OHCI_QUIRK_ZFMICRO 0x20 /* Compaq ZFMicro chipset*/
400#define OHCI_QUIRK_NEC 0x40 /* lost interrupts */ 400#define OHCI_QUIRK_NEC 0x40 /* lost interrupts */
401#define OHCI_QUIRK_FRAME_NO 0x80 /* no big endian frame_no shift */
401 // there are also chip quirks/bugs in init logic 402 // there are also chip quirks/bugs in init logic
402 403
403 struct work_struct nec_work; /* Worker for NEC quirk */ 404 struct work_struct nec_work; /* Worker for NEC quirk */
405
406 /* Needed for ZF Micro quirk */
407 struct timer_list unlink_watchdog;
408 unsigned eds_scheduled;
409 struct ed *ed_to_check;
410 unsigned zf_delay;
404}; 411};
405 412
413#ifdef CONFIG_PCI
414static inline int quirk_nec(struct ohci_hcd *ohci)
415{
416 return ohci->flags & OHCI_QUIRK_NEC;
417}
418static inline int quirk_zfmicro(struct ohci_hcd *ohci)
419{
420 return ohci->flags & OHCI_QUIRK_ZFMICRO;
421}
422#else
423static inline int quirk_nec(struct ohci_hcd *ohci)
424{
425 return 0;
426}
427static inline int quirk_zfmicro(struct ohci_hcd *ohci)
428{
429 return 0;
430}
431#endif
432
406/* convert between an hcd pointer and the corresponding ohci_hcd */ 433/* convert between an hcd pointer and the corresponding ohci_hcd */
407static inline struct ohci_hcd *hcd_to_ohci (struct usb_hcd *hcd) 434static inline struct ohci_hcd *hcd_to_ohci (struct usb_hcd *hcd)
408{ 435{
@@ -607,15 +634,12 @@ static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x)
607/* HCCA frame number is 16 bits, but is accessed as 32 bits since not all 634/* HCCA frame number is 16 bits, but is accessed as 32 bits since not all
608 * hardware handles 16 bit reads. That creates a different confusion on 635 * hardware handles 16 bit reads. That creates a different confusion on
609 * some big-endian SOC implementations. Same thing happens with PSW access. 636 * some big-endian SOC implementations. Same thing happens with PSW access.
610 *
611 * FIXME: Deal with that as a runtime quirk when STB03xxx is ported over
612 * to arch/powerpc
613 */ 637 */
614 638
615#ifdef CONFIG_STB03xxx 639#ifdef CONFIG_PPC_MPC52xx
616#define OHCI_BE_FRAME_NO_SHIFT 16 640#define big_endian_frame_no_quirk(ohci) (ohci->flags & OHCI_QUIRK_FRAME_NO)
617#else 641#else
618#define OHCI_BE_FRAME_NO_SHIFT 0 642#define big_endian_frame_no_quirk(ohci) 0
619#endif 643#endif
620 644
621static inline u16 ohci_frame_no(const struct ohci_hcd *ohci) 645static inline u16 ohci_frame_no(const struct ohci_hcd *ohci)
@@ -623,7 +647,8 @@ static inline u16 ohci_frame_no(const struct ohci_hcd *ohci)
623 u32 tmp; 647 u32 tmp;
624 if (big_endian_desc(ohci)) { 648 if (big_endian_desc(ohci)) {
625 tmp = be32_to_cpup((__force __be32 *)&ohci->hcca->frame_no); 649 tmp = be32_to_cpup((__force __be32 *)&ohci->hcca->frame_no);
626 tmp >>= OHCI_BE_FRAME_NO_SHIFT; 650 if (!big_endian_frame_no_quirk(ohci))
651 tmp >>= 16;
627 } else 652 } else
628 tmp = le32_to_cpup((__force __le32 *)&ohci->hcca->frame_no); 653 tmp = le32_to_cpup((__force __le32 *)&ohci->hcca->frame_no);
629 654