summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-02-19 23:29:21 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-02-22 08:11:18 +0100
commit3c5317e9046c86aa0bbba402b2b1fd173fd4774e (patch)
tree728d445cb1fa39eaf5a765d2c6c0c328da50e95f /drivers/usb
parent956fc9cc056abc878256298e05745fc76732c82c (diff)
downloadbarebox-3c5317e9046c86aa0bbba402b2b1fd173fd4774e.tar.gz
barebox-3c5317e9046c86aa0bbba402b2b1fd173fd4774e.tar.xz
usb: xhci-hcd: Make use of lo_hi_readq/writeq()
Make use of lo_hi_readq/writeq() to implement xhci_read/write_64() helpers, same as it is done in the Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index dfbfe579be..84a14dd1fc 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -24,6 +24,8 @@
#ifndef __XHCI_H
#define __XHCI_H
+#include <io-64-nonatomic-lo-hi.h>
+
#define NUM_COMMAND_TRBS 8
#define NUM_TRANSFER_TRBS 8
#define NUM_EVENT_SEGM 1 /* only one supported */
@@ -1165,19 +1167,11 @@ struct xhci_erst_entry {
*/
static inline u64 xhci_read_64(__le64 __iomem *regs)
{
- __u32 __iomem *ptr = (__u32 __iomem *)regs;
- u64 val_lo = readl(ptr);
- u64 val_hi = readl(ptr + 1);
- return val_lo + (val_hi << 32);
+ return lo_hi_readq(regs);
}
static inline void xhci_write_64(const u64 val, __le64 __iomem *regs)
{
- __u32 __iomem *ptr = (__u32 __iomem *)regs;
- u32 val_lo = lower_32_bits(val);
- u32 val_hi = upper_32_bits(val);
-
- writel(val_lo, ptr);
- writel(val_hi, ptr + 1);
+ lo_hi_writeq(val, regs);
}
/*