Commit 5990e5dd authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

xhci: replace custom implementation of readq / writeq

The readq() and writeq() helpers are available in the
asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic-lo-hi.h
headers. Replace custom implementation by the generic helpers.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c840d6ce
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/usb/hcd.h> #include <linux/usb/hcd.h>
#include <asm-generic/io-64-nonatomic-lo-hi.h>
/* Code sharing between pci-quirks and xhci hcd */ /* Code sharing between pci-quirks and xhci hcd */
#include "xhci-ext-caps.h" #include "xhci-ext-caps.h"
#include "pci-quirks.h" #include "pci-quirks.h"
...@@ -1707,20 +1709,12 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) ...@@ -1707,20 +1709,12 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
static inline u64 xhci_read_64(const struct xhci_hcd *xhci, static inline u64 xhci_read_64(const struct xhci_hcd *xhci,
__le64 __iomem *regs) __le64 __iomem *regs)
{ {
__u32 __iomem *ptr = (__u32 __iomem *) regs; return lo_hi_readq(regs);
u64 val_lo = readl(ptr);
u64 val_hi = readl(ptr + 1);
return val_lo + (val_hi << 32);
} }
static inline void xhci_write_64(struct xhci_hcd *xhci, static inline void xhci_write_64(struct xhci_hcd *xhci,
const u64 val, __le64 __iomem *regs) const u64 val, __le64 __iomem *regs)
{ {
__u32 __iomem *ptr = (__u32 __iomem *) regs; lo_hi_writeq(val, regs);
u32 val_lo = lower_32_bits(val);
u32 val_hi = upper_32_bits(val);
writel(val_lo, ptr);
writel(val_hi, ptr + 1);
} }
static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment