diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2014-10-11 14:10:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-03 18:38:17 -0500 |
commit | a4760b3413732bccac2795b6aed28e2ff99c8ef4 (patch) | |
tree | ab1875ec08002380ec7aedddf2f8c02b497e9531 | |
parent | c8679a2fb8decc949c848ca58f93ff7fb619931a (diff) |
USB: OHCI: Eliminate platform-specific test in ohci.h
The bcm63xx and bcm3384 platforms need to set OHCI_QUIRK_FRAME_NO, but
they are non-PPC platforms and don't enable CONFIG_PPC_MPC52xx.
Therefore this patch changes the code that uses OHCI_QUIRK_FRAME_NO,
making it not depend on CONFIG_PPC_MPC52xx.
Also, rephrase the comments describing OHCI_QUIRK_FRAME_NO and the
related PSW endian swap.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/ohci.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 59f424567a8d..bc462288cfb0 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h | |||
@@ -647,23 +647,22 @@ static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x) | |||
647 | 647 | ||
648 | /*-------------------------------------------------------------------------*/ | 648 | /*-------------------------------------------------------------------------*/ |
649 | 649 | ||
650 | /* HCCA frame number is 16 bits, but is accessed as 32 bits since not all | 650 | /* |
651 | * hardware handles 16 bit reads. That creates a different confusion on | 651 | * The HCCA frame number is 16 bits, but is accessed as 32 bits since not all |
652 | * some big-endian SOC implementations. Same thing happens with PSW access. | 652 | * hardware handles 16 bit reads. Depending on the SoC implementation, the |
653 | * frame number can wind up in either bits [31:16] (default) or | ||
654 | * [15:0] (OHCI_QUIRK_FRAME_NO) on big endian hosts. | ||
655 | * | ||
656 | * Somewhat similarly, the 16-bit PSW fields in a transfer descriptor are | ||
657 | * reordered on BE. | ||
653 | */ | 658 | */ |
654 | 659 | ||
655 | #ifdef CONFIG_PPC_MPC52xx | ||
656 | #define big_endian_frame_no_quirk(ohci) (ohci->flags & OHCI_QUIRK_FRAME_NO) | ||
657 | #else | ||
658 | #define big_endian_frame_no_quirk(ohci) 0 | ||
659 | #endif | ||
660 | |||
661 | static inline u16 ohci_frame_no(const struct ohci_hcd *ohci) | 660 | static inline u16 ohci_frame_no(const struct ohci_hcd *ohci) |
662 | { | 661 | { |
663 | u32 tmp; | 662 | u32 tmp; |
664 | if (big_endian_desc(ohci)) { | 663 | if (big_endian_desc(ohci)) { |
665 | tmp = be32_to_cpup((__force __be32 *)&ohci->hcca->frame_no); | 664 | tmp = be32_to_cpup((__force __be32 *)&ohci->hcca->frame_no); |
666 | if (!big_endian_frame_no_quirk(ohci)) | 665 | if (!(ohci->flags & OHCI_QUIRK_FRAME_NO)) |
667 | tmp >>= 16; | 666 | tmp >>= 16; |
668 | } else | 667 | } else |
669 | tmp = le32_to_cpup((__force __le32 *)&ohci->hcca->frame_no); | 668 | tmp = le32_to_cpup((__force __le32 *)&ohci->hcca->frame_no); |