Commit b0ba9720 authored by Xenia Ragiadakou's avatar Xenia Ragiadakou Committed by Sarah Sharp

xhci: replace xhci_readl() with readl()

Function xhci_readl() is used to read 32bit xHC registers residing in MMIO
address space. It takes as first argument a pointer to the xhci_hcd although
it does not use it. xhci_readl() internally simply calls readl(). This creates
an illusion that xhci_readl() is an xhci specific function that has to be
called in a context where a pointer to xhci_hcd is available.

Remove the unnecessary xhci_readl() wrapper function and replace its calls to
with calls to readl() to make the code more straightforward.
Signed-off-by: default avatarXenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 2a100047
...@@ -32,7 +32,7 @@ void xhci_dbg_regs(struct xhci_hcd *xhci) ...@@ -32,7 +32,7 @@ void xhci_dbg_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, "// xHCI capability registers at %p:\n", xhci_dbg(xhci, "// xHCI capability registers at %p:\n",
xhci->cap_regs); xhci->cap_regs);
temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase); temp = readl(&xhci->cap_regs->hc_capbase);
xhci_dbg(xhci, "// @%p = 0x%x (CAPLENGTH AND HCIVERSION)\n", xhci_dbg(xhci, "// @%p = 0x%x (CAPLENGTH AND HCIVERSION)\n",
&xhci->cap_regs->hc_capbase, temp); &xhci->cap_regs->hc_capbase, temp);
xhci_dbg(xhci, "// CAPLENGTH: 0x%x\n", xhci_dbg(xhci, "// CAPLENGTH: 0x%x\n",
...@@ -44,13 +44,13 @@ void xhci_dbg_regs(struct xhci_hcd *xhci) ...@@ -44,13 +44,13 @@ void xhci_dbg_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, "// xHCI operational registers at %p:\n", xhci->op_regs); xhci_dbg(xhci, "// xHCI operational registers at %p:\n", xhci->op_regs);
temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off); temp = readl(&xhci->cap_regs->run_regs_off);
xhci_dbg(xhci, "// @%p = 0x%x RTSOFF\n", xhci_dbg(xhci, "// @%p = 0x%x RTSOFF\n",
&xhci->cap_regs->run_regs_off, &xhci->cap_regs->run_regs_off,
(unsigned int) temp & RTSOFF_MASK); (unsigned int) temp & RTSOFF_MASK);
xhci_dbg(xhci, "// xHCI runtime registers at %p:\n", xhci->run_regs); xhci_dbg(xhci, "// xHCI runtime registers at %p:\n", xhci->run_regs);
temp = xhci_readl(xhci, &xhci->cap_regs->db_off); temp = readl(&xhci->cap_regs->db_off);
xhci_dbg(xhci, "// @%p = 0x%x DBOFF\n", &xhci->cap_regs->db_off, temp); xhci_dbg(xhci, "// @%p = 0x%x DBOFF\n", &xhci->cap_regs->db_off, temp);
xhci_dbg(xhci, "// Doorbell array at %p:\n", xhci->dba); xhci_dbg(xhci, "// Doorbell array at %p:\n", xhci->dba);
} }
...@@ -61,7 +61,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci) ...@@ -61,7 +61,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, "xHCI capability registers at %p:\n", xhci->cap_regs); xhci_dbg(xhci, "xHCI capability registers at %p:\n", xhci->cap_regs);
temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase); temp = readl(&xhci->cap_regs->hc_capbase);
xhci_dbg(xhci, "CAPLENGTH AND HCIVERSION 0x%x:\n", xhci_dbg(xhci, "CAPLENGTH AND HCIVERSION 0x%x:\n",
(unsigned int) temp); (unsigned int) temp);
xhci_dbg(xhci, "CAPLENGTH: 0x%x\n", xhci_dbg(xhci, "CAPLENGTH: 0x%x\n",
...@@ -69,7 +69,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci) ...@@ -69,7 +69,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, "HCIVERSION: 0x%x\n", xhci_dbg(xhci, "HCIVERSION: 0x%x\n",
(unsigned int) HC_VERSION(temp)); (unsigned int) HC_VERSION(temp));
temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params1); temp = readl(&xhci->cap_regs->hcs_params1);
xhci_dbg(xhci, "HCSPARAMS 1: 0x%x\n", xhci_dbg(xhci, "HCSPARAMS 1: 0x%x\n",
(unsigned int) temp); (unsigned int) temp);
xhci_dbg(xhci, " Max device slots: %u\n", xhci_dbg(xhci, " Max device slots: %u\n",
...@@ -79,7 +79,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci) ...@@ -79,7 +79,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, " Max ports: %u\n", xhci_dbg(xhci, " Max ports: %u\n",
(unsigned int) HCS_MAX_PORTS(temp)); (unsigned int) HCS_MAX_PORTS(temp));
temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params2); temp = readl(&xhci->cap_regs->hcs_params2);
xhci_dbg(xhci, "HCSPARAMS 2: 0x%x\n", xhci_dbg(xhci, "HCSPARAMS 2: 0x%x\n",
(unsigned int) temp); (unsigned int) temp);
xhci_dbg(xhci, " Isoc scheduling threshold: %u\n", xhci_dbg(xhci, " Isoc scheduling threshold: %u\n",
...@@ -87,7 +87,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci) ...@@ -87,7 +87,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, " Maximum allowed segments in event ring: %u\n", xhci_dbg(xhci, " Maximum allowed segments in event ring: %u\n",
(unsigned int) HCS_ERST_MAX(temp)); (unsigned int) HCS_ERST_MAX(temp));
temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3); temp = readl(&xhci->cap_regs->hcs_params3);
xhci_dbg(xhci, "HCSPARAMS 3 0x%x:\n", xhci_dbg(xhci, "HCSPARAMS 3 0x%x:\n",
(unsigned int) temp); (unsigned int) temp);
xhci_dbg(xhci, " Worst case U1 device exit latency: %u\n", xhci_dbg(xhci, " Worst case U1 device exit latency: %u\n",
...@@ -95,14 +95,14 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci) ...@@ -95,14 +95,14 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
xhci_dbg(xhci, " Worst case U2 device exit latency: %u\n", xhci_dbg(xhci, " Worst case U2 device exit latency: %u\n",
(unsigned int) HCS_U2_LATENCY(temp)); (unsigned int) HCS_U2_LATENCY(temp));
temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params); temp = readl(&xhci->cap_regs->hcc_params);
xhci_dbg(xhci, "HCC PARAMS 0x%x:\n", (unsigned int) temp); xhci_dbg(xhci, "HCC PARAMS 0x%x:\n", (unsigned int) temp);
xhci_dbg(xhci, " HC generates %s bit addresses\n", xhci_dbg(xhci, " HC generates %s bit addresses\n",
HCC_64BIT_ADDR(temp) ? "64" : "32"); HCC_64BIT_ADDR(temp) ? "64" : "32");
/* FIXME */ /* FIXME */
xhci_dbg(xhci, " FIXME: more HCCPARAMS debugging\n"); xhci_dbg(xhci, " FIXME: more HCCPARAMS debugging\n");
temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off); temp = readl(&xhci->cap_regs->run_regs_off);
xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK); xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
} }
...@@ -110,7 +110,7 @@ static void xhci_print_command_reg(struct xhci_hcd *xhci) ...@@ -110,7 +110,7 @@ static void xhci_print_command_reg(struct xhci_hcd *xhci)
{ {
u32 temp; u32 temp;
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
xhci_dbg(xhci, "USBCMD 0x%x:\n", temp); xhci_dbg(xhci, "USBCMD 0x%x:\n", temp);
xhci_dbg(xhci, " HC is %s\n", xhci_dbg(xhci, " HC is %s\n",
(temp & CMD_RUN) ? "running" : "being stopped"); (temp & CMD_RUN) ? "running" : "being stopped");
...@@ -128,7 +128,7 @@ static void xhci_print_status(struct xhci_hcd *xhci) ...@@ -128,7 +128,7 @@ static void xhci_print_status(struct xhci_hcd *xhci)
{ {
u32 temp; u32 temp;
temp = xhci_readl(xhci, &xhci->op_regs->status); temp = readl(&xhci->op_regs->status);
xhci_dbg(xhci, "USBSTS 0x%x:\n", temp); xhci_dbg(xhci, "USBSTS 0x%x:\n", temp);
xhci_dbg(xhci, " Event ring is %sempty\n", xhci_dbg(xhci, " Event ring is %sempty\n",
(temp & STS_EINT) ? "not " : ""); (temp & STS_EINT) ? "not " : "");
...@@ -163,7 +163,7 @@ static void xhci_print_ports(struct xhci_hcd *xhci) ...@@ -163,7 +163,7 @@ static void xhci_print_ports(struct xhci_hcd *xhci)
for (j = 0; j < NUM_PORT_REGS; ++j) { for (j = 0; j < NUM_PORT_REGS; ++j) {
xhci_dbg(xhci, "%p port %s reg = 0x%x\n", xhci_dbg(xhci, "%p port %s reg = 0x%x\n",
addr, names[j], addr, names[j],
(unsigned int) xhci_readl(xhci, addr)); (unsigned int) readl(addr));
addr++; addr++;
} }
} }
...@@ -177,7 +177,7 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) ...@@ -177,7 +177,7 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num)
u64 temp_64; u64 temp_64;
addr = &ir_set->irq_pending; addr = &ir_set->irq_pending;
temp = xhci_readl(xhci, addr); temp = readl(addr);
if (temp == XHCI_INIT_VALUE) if (temp == XHCI_INIT_VALUE)
return; return;
...@@ -187,17 +187,17 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) ...@@ -187,17 +187,17 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num)
(unsigned int)temp); (unsigned int)temp);
addr = &ir_set->irq_control; addr = &ir_set->irq_control;
temp = xhci_readl(xhci, addr); temp = readl(addr);
xhci_dbg(xhci, " %p: ir_set.control = 0x%x\n", addr, xhci_dbg(xhci, " %p: ir_set.control = 0x%x\n", addr,
(unsigned int)temp); (unsigned int)temp);
addr = &ir_set->erst_size; addr = &ir_set->erst_size;
temp = xhci_readl(xhci, addr); temp = readl(addr);
xhci_dbg(xhci, " %p: ir_set.erst_size = 0x%x\n", addr, xhci_dbg(xhci, " %p: ir_set.erst_size = 0x%x\n", addr,
(unsigned int)temp); (unsigned int)temp);
addr = &ir_set->rsvd; addr = &ir_set->rsvd;
temp = xhci_readl(xhci, addr); temp = readl(addr);
if (temp != XHCI_INIT_VALUE) if (temp != XHCI_INIT_VALUE)
xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n", xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n",
addr, (unsigned int)temp); addr, (unsigned int)temp);
...@@ -219,12 +219,12 @@ void xhci_print_run_regs(struct xhci_hcd *xhci) ...@@ -219,12 +219,12 @@ void xhci_print_run_regs(struct xhci_hcd *xhci)
int i; int i;
xhci_dbg(xhci, "xHCI runtime registers at %p:\n", xhci->run_regs); xhci_dbg(xhci, "xHCI runtime registers at %p:\n", xhci->run_regs);
temp = xhci_readl(xhci, &xhci->run_regs->microframe_index); temp = readl(&xhci->run_regs->microframe_index);
xhci_dbg(xhci, " %p: Microframe index = 0x%x\n", xhci_dbg(xhci, " %p: Microframe index = 0x%x\n",
&xhci->run_regs->microframe_index, &xhci->run_regs->microframe_index,
(unsigned int) temp); (unsigned int) temp);
for (i = 0; i < 7; ++i) { for (i = 0; i < 7; ++i) {
temp = xhci_readl(xhci, &xhci->run_regs->rsvd[i]); temp = readl(&xhci->run_regs->rsvd[i]);
if (temp != XHCI_INIT_VALUE) if (temp != XHCI_INIT_VALUE)
xhci_dbg(xhci, " WARN: %p: Rsvd[%i] = 0x%x\n", xhci_dbg(xhci, " WARN: %p: Rsvd[%i] = 0x%x\n",
&xhci->run_regs->rsvd[i], &xhci->run_regs->rsvd[i],
......
...@@ -94,7 +94,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, ...@@ -94,7 +94,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
*/ */
memset(port_removable, 0, sizeof(port_removable)); memset(port_removable, 0, sizeof(port_removable));
for (i = 0; i < ports; i++) { for (i = 0; i < ports; i++) {
portsc = xhci_readl(xhci, xhci->usb2_ports[i]); portsc = readl(xhci->usb2_ports[i]);
/* If a device is removable, PORTSC reports a 0, same as in the /* If a device is removable, PORTSC reports a 0, same as in the
* hub descriptor DeviceRemovable bits. * hub descriptor DeviceRemovable bits.
*/ */
...@@ -148,7 +148,7 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, ...@@ -148,7 +148,7 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
port_removable = 0; port_removable = 0;
/* bit 0 is reserved, bit 1 is for port 1, etc. */ /* bit 0 is reserved, bit 1 is for port 1, etc. */
for (i = 0; i < ports; i++) { for (i = 0; i < ports; i++) {
portsc = xhci_readl(xhci, xhci->usb3_ports[i]); portsc = readl(xhci->usb3_ports[i]);
if (portsc & PORT_DEV_REMOVE) if (portsc & PORT_DEV_REMOVE)
port_removable |= 1 << (i + 1); port_removable |= 1 << (i + 1);
} }
...@@ -343,7 +343,7 @@ static void xhci_disable_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, ...@@ -343,7 +343,7 @@ static void xhci_disable_port(struct usb_hcd *hcd, struct xhci_hcd *xhci,
/* Write 1 to disable the port */ /* Write 1 to disable the port */
xhci_writel(xhci, port_status | PORT_PE, addr); xhci_writel(xhci, port_status | PORT_PE, addr);
port_status = xhci_readl(xhci, addr); port_status = readl(addr);
xhci_dbg(xhci, "disable port, actual port %d status = 0x%x\n", xhci_dbg(xhci, "disable port, actual port %d status = 0x%x\n",
wIndex, port_status); wIndex, port_status);
} }
...@@ -389,7 +389,7 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, ...@@ -389,7 +389,7 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue,
} }
/* Change bits are all write 1 to clear */ /* Change bits are all write 1 to clear */
xhci_writel(xhci, port_status | status, addr); xhci_writel(xhci, port_status | status, addr);
port_status = xhci_readl(xhci, addr); port_status = readl(addr);
xhci_dbg(xhci, "clear port %s change, actual port %d status = 0x%x\n", xhci_dbg(xhci, "clear port %s change, actual port %d status = 0x%x\n",
port_change_bit, wIndex, port_status); port_change_bit, wIndex, port_status);
} }
...@@ -415,7 +415,7 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array, ...@@ -415,7 +415,7 @@ void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
{ {
u32 temp; u32 temp;
temp = xhci_readl(xhci, port_array[port_id]); temp = readl(port_array[port_id]);
temp = xhci_port_state_to_neutral(temp); temp = xhci_port_state_to_neutral(temp);
temp &= ~PORT_PLS_MASK; temp &= ~PORT_PLS_MASK;
temp |= PORT_LINK_STROBE | link_state; temp |= PORT_LINK_STROBE | link_state;
...@@ -427,7 +427,7 @@ static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci, ...@@ -427,7 +427,7 @@ static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
{ {
u32 temp; u32 temp;
temp = xhci_readl(xhci, port_array[port_id]); temp = readl(port_array[port_id]);
temp = xhci_port_state_to_neutral(temp); temp = xhci_port_state_to_neutral(temp);
if (wake_mask & USB_PORT_FEAT_REMOTE_WAKE_CONNECT) if (wake_mask & USB_PORT_FEAT_REMOTE_WAKE_CONNECT)
...@@ -454,7 +454,7 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, ...@@ -454,7 +454,7 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array,
{ {
u32 temp; u32 temp;
temp = xhci_readl(xhci, port_array[port_id]); temp = readl(port_array[port_id]);
if (temp & port_bit) { if (temp & port_bit) {
temp = xhci_port_state_to_neutral(temp); temp = xhci_port_state_to_neutral(temp);
temp |= port_bit; temp |= port_bit;
...@@ -623,8 +623,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, ...@@ -623,8 +623,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
} }
xhci_ring_device(xhci, slot_id); xhci_ring_device(xhci, slot_id);
} else { } else {
int port_status = xhci_readl(xhci, int port_status = readl(port_array[wIndex]);
port_array[wIndex]);
xhci_warn(xhci, "Port resume took longer than %i msec, port status = 0x%x\n", xhci_warn(xhci, "Port resume took longer than %i msec, port status = 0x%x\n",
XHCI_MAX_REXIT_TIMEOUT, XHCI_MAX_REXIT_TIMEOUT,
port_status); port_status);
...@@ -733,12 +732,12 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -733,12 +732,12 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
/* Set the U1 and U2 exit latencies. */ /* Set the U1 and U2 exit latencies. */
memcpy(buf, &usb_bos_descriptor, memcpy(buf, &usb_bos_descriptor,
USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE); USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE);
temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3); temp = readl(&xhci->cap_regs->hcs_params3);
buf[12] = HCS_U1_LATENCY(temp); buf[12] = HCS_U1_LATENCY(temp);
put_unaligned_le16(HCS_U2_LATENCY(temp), &buf[13]); put_unaligned_le16(HCS_U2_LATENCY(temp), &buf[13]);
/* Indicate whether the host has LTM support. */ /* Indicate whether the host has LTM support. */
temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params); temp = readl(&xhci->cap_regs->hcc_params);
if (HCC_LTC(temp)) if (HCC_LTC(temp))
buf[8] |= USB_LTM_SUPPORT; buf[8] |= USB_LTM_SUPPORT;
...@@ -748,7 +747,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -748,7 +747,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
if (!wIndex || wIndex > max_ports) if (!wIndex || wIndex > max_ports)
goto error; goto error;
wIndex--; wIndex--;
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if (temp == 0xffffffff) { if (temp == 0xffffffff) {
retval = -ENODEV; retval = -ENODEV;
break; break;
...@@ -775,7 +774,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -775,7 +774,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
if (!wIndex || wIndex > max_ports) if (!wIndex || wIndex > max_ports)
goto error; goto error;
wIndex--; wIndex--;
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if (temp == 0xffffffff) { if (temp == 0xffffffff) {
retval = -ENODEV; retval = -ENODEV;
break; break;
...@@ -784,7 +783,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -784,7 +783,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
/* FIXME: What new port features do we need to support? */ /* FIXME: What new port features do we need to support? */
switch (wValue) { switch (wValue) {
case USB_PORT_FEAT_SUSPEND: case USB_PORT_FEAT_SUSPEND:
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if ((temp & PORT_PLS_MASK) != XDEV_U0) { if ((temp & PORT_PLS_MASK) != XDEV_U0) {
/* Resume the port to U0 first */ /* Resume the port to U0 first */
xhci_set_link_state(xhci, port_array, wIndex, xhci_set_link_state(xhci, port_array, wIndex,
...@@ -797,7 +796,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -797,7 +796,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
* a port unless the port reports that it is in the * a port unless the port reports that it is in the
* enabled (PED = ‘1’,PLS < ‘3’) state. * enabled (PED = ‘1’,PLS < ‘3’) state.
*/ */
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) if ((temp & PORT_PE) == 0 || (temp & PORT_RESET)
|| (temp & PORT_PLS_MASK) >= XDEV_U3) { || (temp & PORT_PLS_MASK) >= XDEV_U3) {
xhci_warn(xhci, "USB core suspending device " xhci_warn(xhci, "USB core suspending device "
...@@ -822,11 +821,11 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -822,11 +821,11 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
msleep(10); /* wait device to enter */ msleep(10); /* wait device to enter */
spin_lock_irqsave(&xhci->lock, flags); spin_lock_irqsave(&xhci->lock, flags);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
bus_state->suspended_ports |= 1 << wIndex; bus_state->suspended_ports |= 1 << wIndex;
break; break;
case USB_PORT_FEAT_LINK_STATE: case USB_PORT_FEAT_LINK_STATE:
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
/* Disable port */ /* Disable port */
if (link_state == USB_SS_PORT_LS_SS_DISABLED) { if (link_state == USB_SS_PORT_LS_SS_DISABLED) {
...@@ -841,7 +840,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -841,7 +840,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
PORT_CEC; PORT_CEC;
xhci_writel(xhci, temp | PORT_PE, xhci_writel(xhci, temp | PORT_PE,
port_array[wIndex]); port_array[wIndex]);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
break; break;
} }
...@@ -850,7 +849,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -850,7 +849,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
xhci_dbg(xhci, "Enable port %d\n", wIndex); xhci_dbg(xhci, "Enable port %d\n", wIndex);
xhci_set_link_state(xhci, port_array, wIndex, xhci_set_link_state(xhci, port_array, wIndex,
link_state); link_state);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
break; break;
} }
...@@ -884,7 +883,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -884,7 +883,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
msleep(20); /* wait device to enter */ msleep(20); /* wait device to enter */
spin_lock_irqsave(&xhci->lock, flags); spin_lock_irqsave(&xhci->lock, flags);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if (link_state == USB_SS_PORT_LS_U3) if (link_state == USB_SS_PORT_LS_U3)
bus_state->suspended_ports |= 1 << wIndex; bus_state->suspended_ports |= 1 << wIndex;
break; break;
...@@ -898,7 +897,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -898,7 +897,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
xhci_writel(xhci, temp | PORT_POWER, xhci_writel(xhci, temp | PORT_POWER,
port_array[wIndex]); port_array[wIndex]);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n", wIndex, temp); xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n", wIndex, temp);
spin_unlock_irqrestore(&xhci->lock, flags); spin_unlock_irqrestore(&xhci->lock, flags);
...@@ -913,13 +912,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -913,13 +912,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp = (temp | PORT_RESET); temp = (temp | PORT_RESET);
xhci_writel(xhci, temp, port_array[wIndex]); xhci_writel(xhci, temp, port_array[wIndex]);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
xhci_dbg(xhci, "set port reset, actual port %d status = 0x%x\n", wIndex, temp); xhci_dbg(xhci, "set port reset, actual port %d status = 0x%x\n", wIndex, temp);
break; break;
case USB_PORT_FEAT_REMOTE_WAKE_MASK: case USB_PORT_FEAT_REMOTE_WAKE_MASK:
xhci_set_remote_wake_mask(xhci, port_array, xhci_set_remote_wake_mask(xhci, port_array,
wIndex, wake_mask); wIndex, wake_mask);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
xhci_dbg(xhci, "set port remote wake mask, " xhci_dbg(xhci, "set port remote wake mask, "
"actual port %d status = 0x%x\n", "actual port %d status = 0x%x\n",
wIndex, temp); wIndex, temp);
...@@ -928,12 +927,12 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -928,12 +927,12 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp |= PORT_WR; temp |= PORT_WR;
xhci_writel(xhci, temp, port_array[wIndex]); xhci_writel(xhci, temp, port_array[wIndex]);
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
break; break;
case USB_PORT_FEAT_U1_TIMEOUT: case USB_PORT_FEAT_U1_TIMEOUT:
if (hcd->speed != HCD_USB3) if (hcd->speed != HCD_USB3)
goto error; goto error;
temp = xhci_readl(xhci, port_array[wIndex] + PORTPMSC); temp = readl(port_array[wIndex] + PORTPMSC);
temp &= ~PORT_U1_TIMEOUT_MASK; temp &= ~PORT_U1_TIMEOUT_MASK;
temp |= PORT_U1_TIMEOUT(timeout); temp |= PORT_U1_TIMEOUT(timeout);
xhci_writel(xhci, temp, port_array[wIndex] + PORTPMSC); xhci_writel(xhci, temp, port_array[wIndex] + PORTPMSC);
...@@ -941,7 +940,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -941,7 +940,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
case USB_PORT_FEAT_U2_TIMEOUT: case USB_PORT_FEAT_U2_TIMEOUT:
if (hcd->speed != HCD_USB3) if (hcd->speed != HCD_USB3)
goto error; goto error;
temp = xhci_readl(xhci, port_array[wIndex] + PORTPMSC); temp = readl(port_array[wIndex] + PORTPMSC);
temp &= ~PORT_U2_TIMEOUT_MASK; temp &= ~PORT_U2_TIMEOUT_MASK;
temp |= PORT_U2_TIMEOUT(timeout); temp |= PORT_U2_TIMEOUT(timeout);
xhci_writel(xhci, temp, port_array[wIndex] + PORTPMSC); xhci_writel(xhci, temp, port_array[wIndex] + PORTPMSC);
...@@ -950,13 +949,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -950,13 +949,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
goto error; goto error;
} }
/* unblock any posted writes */ /* unblock any posted writes */
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
break; break;
case ClearPortFeature: case ClearPortFeature:
if (!wIndex || wIndex > max_ports) if (!wIndex || wIndex > max_ports)
goto error; goto error;
wIndex--; wIndex--;
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
if (temp == 0xffffffff) { if (temp == 0xffffffff) {
retval = -ENODEV; retval = -ENODEV;
break; break;
...@@ -965,7 +964,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -965,7 +964,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp = xhci_port_state_to_neutral(temp); temp = xhci_port_state_to_neutral(temp);
switch (wValue) { switch (wValue) {
case USB_PORT_FEAT_SUSPEND: case USB_PORT_FEAT_SUSPEND:
temp = xhci_readl(xhci, port_array[wIndex]); temp = readl(port_array[wIndex]);
xhci_dbg(xhci, "clear USB_PORT_FEAT_SUSPEND\n"); xhci_dbg(xhci, "clear USB_PORT_FEAT_SUSPEND\n");
xhci_dbg(xhci, "PORTSC %04x\n", temp); xhci_dbg(xhci, "PORTSC %04x\n", temp);
if (temp & PORT_RESET) if (temp & PORT_RESET)
...@@ -1070,7 +1069,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) ...@@ -1070,7 +1069,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
spin_lock_irqsave(&xhci->lock, flags); spin_lock_irqsave(&xhci->lock, flags);
/* For each port, did anything change? If so, set that bit in buf. */ /* For each port, did anything change? If so, set that bit in buf. */
for (i = 0; i < max_ports; i++) { for (i = 0; i < max_ports; i++) {
temp = xhci_readl(xhci, port_array[i]); temp = readl(port_array[i]);
if (temp == 0xffffffff) { if (temp == 0xffffffff) {
retval = -ENODEV; retval = -ENODEV;
break; break;
...@@ -1124,7 +1123,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd) ...@@ -1124,7 +1123,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
u32 t1, t2; u32 t1, t2;
int slot_id; int slot_id;
t1 = xhci_readl(xhci, port_array[port_index]); t1 = readl(port_array[port_index]);
t2 = xhci_port_state_to_neutral(t1); t2 = xhci_port_state_to_neutral(t1);
if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) { if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) {
...@@ -1187,7 +1186,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) ...@@ -1187,7 +1186,7 @@ int xhci_bus_resume(struct usb_hcd *hcd)
} }
/* delay the irqs */ /* delay the irqs */
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
temp &= ~CMD_EIE; temp &= ~CMD_EIE;
xhci_writel(xhci, temp, &xhci->op_regs->command); xhci_writel(xhci, temp, &xhci->op_regs->command);
...@@ -1198,7 +1197,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) ...@@ -1198,7 +1197,7 @@ int xhci_bus_resume(struct usb_hcd *hcd)
u32 temp; u32 temp;
int slot_id; int slot_id;
temp = xhci_readl(xhci, port_array[port_index]); temp = readl(port_array[port_index]);
if (DEV_SUPERSPEED(temp)) if (DEV_SUPERSPEED(temp))
temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS); temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS);
else else
...@@ -1238,14 +1237,14 @@ int xhci_bus_resume(struct usb_hcd *hcd) ...@@ -1238,14 +1237,14 @@ int xhci_bus_resume(struct usb_hcd *hcd)
xhci_writel(xhci, temp, port_array[port_index]); xhci_writel(xhci, temp, port_array[port_index]);
} }
(void) xhci_readl(xhci, &xhci->op_regs->command); (void) readl(&xhci->op_regs->command);
bus_state->next_statechange = jiffies + msecs_to_jiffies(5); bus_state->next_statechange = jiffies + msecs_to_jiffies(5);
/* re-enable irqs */ /* re-enable irqs */
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
temp |= CMD_EIE; temp |= CMD_EIE;
xhci_writel(xhci, temp, &xhci->op_regs->command); xhci_writel(xhci, temp, &xhci->op_regs->command);
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
spin_unlock_irqrestore(&xhci->lock, flags); spin_unlock_irqrestore(&xhci->lock, flags);
return 0; return 0;
......
...@@ -1986,7 +1986,7 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports, ...@@ -1986,7 +1986,7 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports,
} }
/* Port offset and count in the third dword, see section 7.2 */ /* Port offset and count in the third dword, see section 7.2 */
temp = xhci_readl(xhci, addr + 2); temp = readl(addr + 2);
port_offset = XHCI_EXT_PORT_OFF(temp); port_offset = XHCI_EXT_PORT_OFF(temp);
port_count = XHCI_EXT_PORT_COUNT(temp); port_count = XHCI_EXT_PORT_COUNT(temp);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
...@@ -2069,7 +2069,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2069,7 +2069,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
int cap_count = 0; int cap_count = 0;
addr = &xhci->cap_regs->hcc_params; addr = &xhci->cap_regs->hcc_params;
offset = XHCI_HCC_EXT_CAPS(xhci_readl(xhci, addr)); offset = XHCI_HCC_EXT_CAPS(readl(addr));
if (offset == 0) { if (offset == 0) {
xhci_err(xhci, "No Extended Capability registers, " xhci_err(xhci, "No Extended Capability registers, "
"unable to set up roothub.\n"); "unable to set up roothub.\n");
...@@ -2106,7 +2106,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2106,7 +2106,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
/* count extended protocol capability entries for later caching */ /* count extended protocol capability entries for later caching */
do { do {
u32 cap_id; u32 cap_id;
cap_id = xhci_readl(xhci, tmp_addr); cap_id = readl(tmp_addr);
if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL) if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL)
cap_count++; cap_count++;
tmp_offset = XHCI_EXT_CAPS_NEXT(cap_id); tmp_offset = XHCI_EXT_CAPS_NEXT(cap_id);
...@@ -2120,7 +2120,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2120,7 +2120,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
while (1) { while (1) {
u32 cap_id; u32 cap_id;
cap_id = xhci_readl(xhci, addr); cap_id = readl(addr);
if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL) if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL)
xhci_add_in_port(xhci, num_ports, addr, xhci_add_in_port(xhci, num_ports, addr,
(u8) XHCI_EXT_PORT_MAJOR(cap_id), (u8) XHCI_EXT_PORT_MAJOR(cap_id),
...@@ -2224,7 +2224,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2224,7 +2224,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
INIT_LIST_HEAD(&xhci->cancel_cmd_list); INIT_LIST_HEAD(&xhci->cancel_cmd_list);
page_size = xhci_readl(xhci, &xhci->op_regs->page_size); page_size = readl(&xhci->op_regs->page_size);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"Supported page size register = 0x%x", page_size); "Supported page size register = 0x%x", page_size);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
...@@ -2247,10 +2247,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2247,10 +2247,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
* Program the Number of Device Slots Enabled field in the CONFIG * Program the Number of Device Slots Enabled field in the CONFIG
* register with the max value of slots the HC can handle. * register with the max value of slots the HC can handle.
*/ */
val = HCS_MAX_SLOTS(xhci_readl(xhci, &xhci->cap_regs->hcs_params1)); val = HCS_MAX_SLOTS(readl(&xhci->cap_regs->hcs_params1));
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// xHC can handle at most %d device slots.", val); "// xHC can handle at most %d device slots.", val);
val2 = xhci_readl(xhci, &xhci->op_regs->config_reg); val2 = readl(&xhci->op_regs->config_reg);
val |= (val2 & ~HCS_SLOTS_MASK); val |= (val2 & ~HCS_SLOTS_MASK);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Setting Max device slots reg = 0x%x.", val); "// Setting Max device slots reg = 0x%x.", val);
...@@ -2331,7 +2331,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2331,7 +2331,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
*/ */
xhci->cmd_ring_reserved_trbs++; xhci->cmd_ring_reserved_trbs++;
val = xhci_readl(xhci, &xhci->cap_regs->db_off); val = readl(&xhci->cap_regs->db_off);
val &= DBOFF_MASK; val &= DBOFF_MASK;
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Doorbell array is located at offset 0x%x" "// Doorbell array is located at offset 0x%x"
...@@ -2382,7 +2382,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2382,7 +2382,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
} }
/* set ERST count with the number of entries in the segment table */ /* set ERST count with the number of entries in the segment table */
val = xhci_readl(xhci, &xhci->ir_set->erst_size); val = readl(&xhci->ir_set->erst_size);
val &= ERST_SIZE_MASK; val &= ERST_SIZE_MASK;
val |= ERST_NUM_SEGS; val |= ERST_NUM_SEGS;
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
...@@ -2431,7 +2431,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) ...@@ -2431,7 +2431,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
* is necessary for allowing USB 3.0 devices to do remote wakeup from * is necessary for allowing USB 3.0 devices to do remote wakeup from
* U3 (device suspend). * U3 (device suspend).
*/ */
temp = xhci_readl(xhci, &xhci->op_regs->dev_notification); temp = readl(&xhci->op_regs->dev_notification);
temp &= ~DEV_NOTE_MASK; temp &= ~DEV_NOTE_MASK;
temp |= DEV_NOTE_FWAKE; temp |= DEV_NOTE_FWAKE;
xhci_writel(xhci, temp, &xhci->op_regs->dev_notification); xhci_writel(xhci, temp, &xhci->op_regs->dev_notification);
......
...@@ -297,7 +297,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci) ...@@ -297,7 +297,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci)
xhci_dbg(xhci, "// Ding dong!\n"); xhci_dbg(xhci, "// Ding dong!\n");
xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]); xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]);
/* Flush PCI posted writes */ /* Flush PCI posted writes */
xhci_readl(xhci, &xhci->dba->doorbell[0]); readl(&xhci->dba->doorbell[0]);
} }
static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) static int xhci_abort_cmd_ring(struct xhci_hcd *xhci)
...@@ -1739,7 +1739,7 @@ static void handle_port_status(struct xhci_hcd *xhci, ...@@ -1739,7 +1739,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
faked_port_index = find_faked_portnum_from_hw_portnum(hcd, xhci, faked_port_index = find_faked_portnum_from_hw_portnum(hcd, xhci,
port_id); port_id);
temp = xhci_readl(xhci, port_array[faked_port_index]); temp = readl(port_array[faked_port_index]);
if (hcd->state == HC_STATE_SUSPENDED) { if (hcd->state == HC_STATE_SUSPENDED) {
xhci_dbg(xhci, "resume root hub\n"); xhci_dbg(xhci, "resume root hub\n");
usb_hcd_resume_root_hub(hcd); usb_hcd_resume_root_hub(hcd);
...@@ -1748,7 +1748,7 @@ static void handle_port_status(struct xhci_hcd *xhci, ...@@ -1748,7 +1748,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) { if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) {
xhci_dbg(xhci, "port resume event for port %d\n", port_id); xhci_dbg(xhci, "port resume event for port %d\n", port_id);
temp1 = xhci_readl(xhci, &xhci->op_regs->command); temp1 = readl(&xhci->op_regs->command);
if (!(temp1 & CMD_RUN)) { if (!(temp1 & CMD_RUN)) {
xhci_warn(xhci, "xHC is not running.\n"); xhci_warn(xhci, "xHC is not running.\n");
goto cleanup; goto cleanup;
...@@ -2831,7 +2831,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -2831,7 +2831,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
spin_lock(&xhci->lock); spin_lock(&xhci->lock);
/* Check if the xHC generated the interrupt, or the irq is shared */ /* Check if the xHC generated the interrupt, or the irq is shared */
status = xhci_readl(xhci, &xhci->op_regs->status); status = readl(&xhci->op_regs->status);
if (status == 0xffffffff) if (status == 0xffffffff)
goto hw_died; goto hw_died;
...@@ -2860,7 +2860,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -2860,7 +2860,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
if (hcd->irq) { if (hcd->irq) {
u32 irq_pending; u32 irq_pending;
/* Acknowledge the PCI interrupt */ /* Acknowledge the PCI interrupt */
irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending); irq_pending = readl(&xhci->ir_set->irq_pending);
irq_pending |= IMAN_IP; irq_pending |= IMAN_IP;
xhci_writel(xhci, irq_pending, &xhci->ir_set->irq_pending); xhci_writel(xhci, irq_pending, &xhci->ir_set->irq_pending);
} }
...@@ -3931,7 +3931,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, ...@@ -3931,7 +3931,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
if (ret) if (ret)
return ret; return ret;
start_frame = xhci_readl(xhci, &xhci->run_regs->microframe_index); start_frame = readl(&xhci->run_regs->microframe_index);
start_frame &= 0x3fff; start_frame &= 0x3fff;
urb->start_frame = start_frame; urb->start_frame = start_frame;
......
...@@ -60,7 +60,7 @@ int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr, ...@@ -60,7 +60,7 @@ int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr,
u32 result; u32 result;
do { do {
result = xhci_readl(xhci, ptr); result = readl(ptr);
if (result == ~(u32)0) /* card removed */ if (result == ~(u32)0) /* card removed */
return -ENODEV; return -ENODEV;
result &= mask; result &= mask;
...@@ -82,11 +82,11 @@ void xhci_quiesce(struct xhci_hcd *xhci) ...@@ -82,11 +82,11 @@ void xhci_quiesce(struct xhci_hcd *xhci)
u32 mask; u32 mask;
mask = ~(XHCI_IRQS); mask = ~(XHCI_IRQS);
halted = xhci_readl(xhci, &xhci->op_regs->status) & STS_HALT; halted = readl(&xhci->op_regs->status) & STS_HALT;
if (!halted) if (!halted)
mask &= ~CMD_RUN; mask &= ~CMD_RUN;
cmd = xhci_readl(xhci, &xhci->op_regs->command); cmd = readl(&xhci->op_regs->command);
cmd &= mask; cmd &= mask;
xhci_writel(xhci, cmd, &xhci->op_regs->command); xhci_writel(xhci, cmd, &xhci->op_regs->command);
} }
...@@ -124,7 +124,7 @@ static int xhci_start(struct xhci_hcd *xhci) ...@@ -124,7 +124,7 @@ static int xhci_start(struct xhci_hcd *xhci)
u32 temp; u32 temp;
int ret; int ret;
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
temp |= (CMD_RUN); temp |= (CMD_RUN);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Turn on HC, cmd = 0x%x.", xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Turn on HC, cmd = 0x%x.",
temp); temp);
...@@ -158,14 +158,14 @@ int xhci_reset(struct xhci_hcd *xhci) ...@@ -158,14 +158,14 @@ int xhci_reset(struct xhci_hcd *xhci)
u32 state; u32 state;
int ret, i; int ret, i;
state = xhci_readl(xhci, &xhci->op_regs->status); state = readl(&xhci->op_regs->status);
if ((state & STS_HALT) == 0) { if ((state & STS_HALT) == 0) {
xhci_warn(xhci, "Host controller not halted, aborting reset.\n"); xhci_warn(xhci, "Host controller not halted, aborting reset.\n");
return 0; return 0;
} }
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Reset the HC"); xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Reset the HC");
command = xhci_readl(xhci, &xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command |= CMD_RESET; command |= CMD_RESET;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
...@@ -422,7 +422,7 @@ static void compliance_mode_recovery(unsigned long arg) ...@@ -422,7 +422,7 @@ static void compliance_mode_recovery(unsigned long arg)
xhci = (struct xhci_hcd *)arg; xhci = (struct xhci_hcd *)arg;
for (i = 0; i < xhci->num_usb3_ports; i++) { for (i = 0; i < xhci->num_usb3_ports; i++) {
temp = xhci_readl(xhci, xhci->usb3_ports[i]); temp = readl(xhci->usb3_ports[i]);
if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) { if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) {
/* /*
* Compliance Mode Detected. Letting USB Core * Compliance Mode Detected. Letting USB Core
...@@ -611,19 +611,19 @@ int xhci_run(struct usb_hcd *hcd) ...@@ -611,19 +611,19 @@ int xhci_run(struct usb_hcd *hcd)
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Set the interrupt modulation register"); "// Set the interrupt modulation register");
temp = xhci_readl(xhci, &xhci->ir_set->irq_control); temp = readl(&xhci->ir_set->irq_control);
temp &= ~ER_IRQ_INTERVAL_MASK; temp &= ~ER_IRQ_INTERVAL_MASK;
temp |= (u32) 160; temp |= (u32) 160;
xhci_writel(xhci, temp, &xhci->ir_set->irq_control); xhci_writel(xhci, temp, &xhci->ir_set->irq_control);
/* Set the HCD state before we enable the irqs */ /* Set the HCD state before we enable the irqs */
temp = xhci_readl(xhci, &xhci->op_regs->command); temp = readl(&xhci->op_regs->command);
temp |= (CMD_EIE); temp |= (CMD_EIE);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Enable interrupts, cmd = 0x%x.", temp); "// Enable interrupts, cmd = 0x%x.", temp);
xhci_writel(xhci, temp, &xhci->op_regs->command); xhci_writel(xhci, temp, &xhci->op_regs->command);
temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); temp = readl(&xhci->ir_set->irq_pending);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Enabling event ring interrupter %p by writing 0x%x to irq_pending", "// Enabling event ring interrupter %p by writing 0x%x to irq_pending",
xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp));
...@@ -698,9 +698,9 @@ void xhci_stop(struct usb_hcd *hcd) ...@@ -698,9 +698,9 @@ void xhci_stop(struct usb_hcd *hcd)
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Disabling event ring interrupts"); "// Disabling event ring interrupts");
temp = xhci_readl(xhci, &xhci->op_regs->status); temp = readl(&xhci->op_regs->status);
xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status); xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status);
temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); temp = readl(&xhci->ir_set->irq_pending);
xhci_writel(xhci, ER_IRQ_DISABLE(temp), xhci_writel(xhci, ER_IRQ_DISABLE(temp),
&xhci->ir_set->irq_pending); &xhci->ir_set->irq_pending);
xhci_print_ir_set(xhci, 0); xhci_print_ir_set(xhci, 0);
...@@ -709,7 +709,7 @@ void xhci_stop(struct usb_hcd *hcd) ...@@ -709,7 +709,7 @@ void xhci_stop(struct usb_hcd *hcd)
xhci_mem_cleanup(xhci); xhci_mem_cleanup(xhci);
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"xhci_stop completed - status = %x", "xhci_stop completed - status = %x",
xhci_readl(xhci, &xhci->op_regs->status)); readl(&xhci->op_regs->status));
} }
/* /*
...@@ -739,7 +739,7 @@ void xhci_shutdown(struct usb_hcd *hcd) ...@@ -739,7 +739,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"xhci_shutdown completed - status = %x", "xhci_shutdown completed - status = %x",
xhci_readl(xhci, &xhci->op_regs->status)); readl(&xhci->op_regs->status));
/* Yet another workaround for spurious wakeups at shutdown with HSW */ /* Yet another workaround for spurious wakeups at shutdown with HSW */
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
...@@ -749,15 +749,15 @@ void xhci_shutdown(struct usb_hcd *hcd) ...@@ -749,15 +749,15 @@ void xhci_shutdown(struct usb_hcd *hcd)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static void xhci_save_registers(struct xhci_hcd *xhci) static void xhci_save_registers(struct xhci_hcd *xhci)
{ {
xhci->s3.command = xhci_readl(xhci, &xhci->op_regs->command); xhci->s3.command = readl(&xhci->op_regs->command);
xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification); xhci->s3.dev_nt = readl(&xhci->op_regs->dev_notification);
xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg); xhci->s3.config_reg = readl(&xhci->op_regs->config_reg);
xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size); xhci->s3.erst_size = readl(&xhci->ir_set->erst_size);
xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base); xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);
xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending); xhci->s3.irq_pending = readl(&xhci->ir_set->irq_pending);
xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control); xhci->s3.irq_control = readl(&xhci->ir_set->irq_control);
} }
static void xhci_restore_registers(struct xhci_hcd *xhci) static void xhci_restore_registers(struct xhci_hcd *xhci)
...@@ -866,7 +866,7 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -866,7 +866,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
/* skipped assuming that port suspend has done */ /* skipped assuming that port suspend has done */
/* step 2: clear Run/Stop bit */ /* step 2: clear Run/Stop bit */
command = xhci_readl(xhci, &xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command &= ~CMD_RUN; command &= ~CMD_RUN;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
...@@ -885,7 +885,7 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -885,7 +885,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
xhci_save_registers(xhci); xhci_save_registers(xhci);
/* step 4: set CSS flag */ /* step 4: set CSS flag */
command = xhci_readl(xhci, &xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command |= CMD_CSS; command |= CMD_CSS;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
if (xhci_handshake(xhci, &xhci->op_regs->status, if (xhci_handshake(xhci, &xhci->op_regs->status,
...@@ -951,7 +951,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -951,7 +951,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_set_cmd_ring_deq(xhci); xhci_set_cmd_ring_deq(xhci);
/* step 3: restore state and start state*/ /* step 3: restore state and start state*/
/* step 3: set CRS flag */ /* step 3: set CRS flag */
command = xhci_readl(xhci, &xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command |= CMD_CRS; command |= CMD_CRS;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
if (xhci_handshake(xhci, &xhci->op_regs->status, if (xhci_handshake(xhci, &xhci->op_regs->status,
...@@ -960,7 +960,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -960,7 +960,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
temp = xhci_readl(xhci, &xhci->op_regs->status); temp = readl(&xhci->op_regs->status);
} }
/* If restore operation fails, re-initialize the HC during resume */ /* If restore operation fails, re-initialize the HC during resume */
...@@ -984,9 +984,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -984,9 +984,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_cleanup_msix(xhci); xhci_cleanup_msix(xhci);
xhci_dbg(xhci, "// Disabling event ring interrupts\n"); xhci_dbg(xhci, "// Disabling event ring interrupts\n");
temp = xhci_readl(xhci, &xhci->op_regs->status); temp = readl(&xhci->op_regs->status);
xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status); xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status);
temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); temp = readl(&xhci->ir_set->irq_pending);
xhci_writel(xhci, ER_IRQ_DISABLE(temp), xhci_writel(xhci, ER_IRQ_DISABLE(temp),
&xhci->ir_set->irq_pending); &xhci->ir_set->irq_pending);
xhci_print_ir_set(xhci, 0); xhci_print_ir_set(xhci, 0);
...@@ -994,7 +994,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -994,7 +994,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_dbg(xhci, "cleaning up memory\n"); xhci_dbg(xhci, "cleaning up memory\n");
xhci_mem_cleanup(xhci); xhci_mem_cleanup(xhci);
xhci_dbg(xhci, "xhci_stop completed - status = %x\n", xhci_dbg(xhci, "xhci_stop completed - status = %x\n",
xhci_readl(xhci, &xhci->op_regs->status)); readl(&xhci->op_regs->status));
/* USB core calls the PCI reinit and start functions twice: /* USB core calls the PCI reinit and start functions twice:
* first with the primary HCD, and then with the secondary HCD. * first with the primary HCD, and then with the secondary HCD.
...@@ -1023,7 +1023,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -1023,7 +1023,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
} }
/* step 4: set Run/Stop bit */ /* step 4: set Run/Stop bit */
command = xhci_readl(xhci, &xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command |= CMD_RUN; command |= CMD_RUN;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
xhci_handshake(xhci, &xhci->op_regs->status, STS_HALT, xhci_handshake(xhci, &xhci->op_regs->status, STS_HALT,
...@@ -1464,7 +1464,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) ...@@ -1464,7 +1464,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
ret = usb_hcd_check_unlink_urb(hcd, urb, status); ret = usb_hcd_check_unlink_urb(hcd, urb, status);
if (ret || !urb->hcpriv) if (ret || !urb->hcpriv)
goto done; goto done;
temp = xhci_readl(xhci, &xhci->op_regs->status); temp = readl(&xhci->op_regs->status);
if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_HALTED)) { if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_HALTED)) {
xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
"HW died, freeing TD."); "HW died, freeing TD.");
...@@ -3585,7 +3585,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) ...@@ -3585,7 +3585,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
spin_lock_irqsave(&xhci->lock, flags); spin_lock_irqsave(&xhci->lock, flags);
/* Don't disable the slot if the host controller is dead. */ /* Don't disable the slot if the host controller is dead. */
state = xhci_readl(xhci, &xhci->op_regs->status); state = readl(&xhci->op_regs->status);
if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) || if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) ||
(xhci->xhc_state & XHCI_STATE_HALTED)) { (xhci->xhc_state & XHCI_STATE_HALTED)) {
xhci_free_virt_device(xhci, udev->slot_id); xhci_free_virt_device(xhci, udev->slot_id);
...@@ -4042,7 +4042,7 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4042,7 +4042,7 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
port_array = xhci->usb2_ports; port_array = xhci->usb2_ports;
port_num = udev->portnum - 1; port_num = udev->portnum - 1;
pm_addr = port_array[port_num] + PORTPMSC; pm_addr = port_array[port_num] + PORTPMSC;
pm_val = xhci_readl(xhci, pm_addr); pm_val = readl(pm_addr);
hlpm_addr = port_array[port_num] + PORTHLPMC; hlpm_addr = port_array[port_num] + PORTHLPMC;
field = le32_to_cpu(udev->bos->ext_cap->bmAttributes); field = le32_to_cpu(udev->bos->ext_cap->bmAttributes);
...@@ -4084,7 +4084,7 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4084,7 +4084,7 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
hlpm_val = xhci_calculate_usb2_hw_lpm_params(udev); hlpm_val = xhci_calculate_usb2_hw_lpm_params(udev);
xhci_writel(xhci, hlpm_val, hlpm_addr); xhci_writel(xhci, hlpm_val, hlpm_addr);
/* flush write */ /* flush write */
xhci_readl(xhci, hlpm_addr); readl(hlpm_addr);
} else { } else {
hird = xhci_calculate_hird_besl(xhci, udev); hird = xhci_calculate_hird_besl(xhci, udev);
} }
...@@ -4092,16 +4092,16 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4092,16 +4092,16 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
pm_val &= ~PORT_HIRD_MASK; pm_val &= ~PORT_HIRD_MASK;
pm_val |= PORT_HIRD(hird) | PORT_RWE | PORT_L1DS(udev->slot_id); pm_val |= PORT_HIRD(hird) | PORT_RWE | PORT_L1DS(udev->slot_id);
xhci_writel(xhci, pm_val, pm_addr); xhci_writel(xhci, pm_val, pm_addr);
pm_val = xhci_readl(xhci, pm_addr); pm_val = readl(pm_addr);
pm_val |= PORT_HLE; pm_val |= PORT_HLE;
xhci_writel(xhci, pm_val, pm_addr); xhci_writel(xhci, pm_val, pm_addr);
/* flush write */ /* flush write */
xhci_readl(xhci, pm_addr); readl(pm_addr);
} else { } else {
pm_val &= ~(PORT_HLE | PORT_RWE | PORT_HIRD_MASK | PORT_L1DS_MASK); pm_val &= ~(PORT_HLE | PORT_RWE | PORT_HIRD_MASK | PORT_L1DS_MASK);
xhci_writel(xhci, pm_val, pm_addr); xhci_writel(xhci, pm_val, pm_addr);
/* flush write */ /* flush write */
xhci_readl(xhci, pm_addr); readl(pm_addr);
if (udev->usb2_hw_lpm_besl_capable) { if (udev->usb2_hw_lpm_besl_capable) {
spin_unlock_irqrestore(&xhci->lock, flags); spin_unlock_irqrestore(&xhci->lock, flags);
mutex_lock(hcd->bandwidth_mutex); mutex_lock(hcd->bandwidth_mutex);
...@@ -4704,7 +4704,7 @@ int xhci_get_frame(struct usb_hcd *hcd) ...@@ -4704,7 +4704,7 @@ int xhci_get_frame(struct usb_hcd *hcd)
{ {
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
/* EHCI mods by the periodic size. Why? */ /* EHCI mods by the periodic size. Why? */
return xhci_readl(xhci, &xhci->run_regs->microframe_index) >> 3; return readl(&xhci->run_regs->microframe_index) >> 3;
} }
int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
...@@ -4748,16 +4748,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) ...@@ -4748,16 +4748,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
xhci->cap_regs = hcd->regs; xhci->cap_regs = hcd->regs;
xhci->op_regs = hcd->regs + xhci->op_regs = hcd->regs +
HC_LENGTH(xhci_readl(xhci, &xhci->cap_regs->hc_capbase)); HC_LENGTH(readl(&xhci->cap_regs->hc_capbase));
xhci->run_regs = hcd->regs + xhci->run_regs = hcd->regs +
(xhci_readl(xhci, &xhci->cap_regs->run_regs_off) & RTSOFF_MASK); (readl(&xhci->cap_regs->run_regs_off) & RTSOFF_MASK);
/* Cache read-only capability registers */ /* Cache read-only capability registers */
xhci->hcs_params1 = xhci_readl(xhci, &xhci->cap_regs->hcs_params1); xhci->hcs_params1 = readl(&xhci->cap_regs->hcs_params1);
xhci->hcs_params2 = xhci_readl(xhci, &xhci->cap_regs->hcs_params2); xhci->hcs_params2 = readl(&xhci->cap_regs->hcs_params2);
xhci->hcs_params3 = xhci_readl(xhci, &xhci->cap_regs->hcs_params3); xhci->hcs_params3 = readl(&xhci->cap_regs->hcs_params3);
xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hc_capbase); xhci->hcc_params = readl(&xhci->cap_regs->hc_capbase);
xhci->hci_version = HC_VERSION(xhci->hcc_params); xhci->hci_version = HC_VERSION(xhci->hcc_params);
xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hcc_params); xhci->hcc_params = readl(&xhci->cap_regs->hcc_params);
xhci_print_registers(xhci); xhci_print_registers(xhci);
get_quirks(dev, xhci); get_quirks(dev, xhci);
......
...@@ -1597,11 +1597,6 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) ...@@ -1597,11 +1597,6 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
/* TODO: copied from ehci.h - can be refactored? */ /* TODO: copied from ehci.h - can be refactored? */
/* xHCI spec says all registers are little endian */ /* xHCI spec says all registers are little endian */
static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
__le32 __iomem *regs)
{
return readl(regs);
}
static inline void xhci_writel(struct xhci_hcd *xhci, static inline void xhci_writel(struct xhci_hcd *xhci,
const unsigned int val, __le32 __iomem *regs) const unsigned int val, __le32 __iomem *regs)
{ {
......
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