diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2013-11-14 22:34:09 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-12-02 15:59:50 -0500 |
commit | 7dd09a1af2c7150269350aaa567a11b06e831003 (patch) | |
tree | d471de024c220174132915ba2f38a7d63dcd2462 /drivers/usb/host/xhci.c | |
parent | e8b373326d8efcaf9ec1da8b618556c89bd5ffc4 (diff) |
xhci: replace xhci_write_64() with writeq()
Function xhci_write_64() is used to write 64bit xHC registers residing in MMIO.
On 32bit systems, xHC registers need to be written with 32bit accesses by
writing first the lower 32bits and then the higher 32bits. The header file
asm-generic/io-64-nonatomic-lo-hi.h ensures that on 32bit systems writeq() will
will write 64bit registers in 32bit chunks with low-high order.
Replace all calls to xhci_write_64() with calls to writeq().
This is done to reduce code duplication since 64bit low-high write logic
is already implemented and to take advantage of inherent "atomic" 64bit
write operations on 64bit systems.
Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 858e992729c9..7fe6f664054f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -762,11 +762,11 @@ static void xhci_restore_registers(struct xhci_hcd *xhci) | |||
762 | { | 762 | { |
763 | writel(xhci->s3.command, &xhci->op_regs->command); | 763 | writel(xhci->s3.command, &xhci->op_regs->command); |
764 | writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification); | 764 | writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification); |
765 | xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); | 765 | writeq(xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); |
766 | writel(xhci->s3.config_reg, &xhci->op_regs->config_reg); | 766 | writel(xhci->s3.config_reg, &xhci->op_regs->config_reg); |
767 | writel(xhci->s3.erst_size, &xhci->ir_set->erst_size); | 767 | writel(xhci->s3.erst_size, &xhci->ir_set->erst_size); |
768 | xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base); | 768 | writeq(xhci->s3.erst_base, &xhci->ir_set->erst_base); |
769 | xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue); | 769 | writeq(xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue); |
770 | writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending); | 770 | writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending); |
771 | writel(xhci->s3.irq_control, &xhci->ir_set->irq_control); | 771 | writel(xhci->s3.irq_control, &xhci->ir_set->irq_control); |
772 | } | 772 | } |
@@ -785,7 +785,7 @@ static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci) | |||
785 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 785 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
786 | "// Setting command ring address to 0x%llx", | 786 | "// Setting command ring address to 0x%llx", |
787 | (long unsigned long) val_64); | 787 | (long unsigned long) val_64); |
788 | xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); | 788 | writeq(val_64, &xhci->op_regs->cmd_ring); |
789 | } | 789 | } |
790 | 790 | ||
791 | /* | 791 | /* |