Commit e725cef3 authored by Paul Davies C's avatar Paul Davies C Committed by Greg Kroah-Hartman

staging: octeon-usb: Fix lines with more than 80 chars in octeon-hcd.c

Some lines with more than 80 characters are converted in to multiple lines.
Signed-off-by: default avatarPaul Davies C <pauldaviesc@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f5106435
...@@ -460,7 +460,8 @@ struct octeon_hcd { ...@@ -460,7 +460,8 @@ struct octeon_hcd {
} while (0) } while (0)
/* Returns the IO address to push/pop stuff data from the FIFOs */ /* Returns the IO address to push/pop stuff data from the FIFOs */
#define USB_FIFO_ADDRESS(channel, usb_index) (CVMX_USBCX_GOTGCTL(usb_index) + ((channel)+1)*0x1000) #define USB_FIFO_ADDRESS(channel, usb_index) \
(CVMX_USBCX_GOTGCTL(usb_index) + ((channel)+1)*0x1000)
/** /**
* struct octeon_temp_buffer - a bounce buffer for USB transfers * struct octeon_temp_buffer - a bounce buffer for USB transfers
...@@ -1288,7 +1289,8 @@ static struct cvmx_usb_pipe *cvmx_usb_open_pipe(struct cvmx_usb_state *usb, ...@@ -1288,7 +1289,8 @@ static struct cvmx_usb_pipe *cvmx_usb_open_pipe(struct cvmx_usb_state *usb,
if (__cvmx_usb_pipe_needs_split(usb, pipe)) { if (__cvmx_usb_pipe_needs_split(usb, pipe)) {
pipe->interval = interval*8; pipe->interval = interval*8;
/* Force start splits to be schedule on uFrame 0 */ /* Force start splits to be schedule on uFrame 0 */
pipe->next_tx_frame = ((usb->frame_number+7)&~7) + pipe->interval; pipe->next_tx_frame = ((usb->frame_number+7)&~7) +
pipe->interval;
} else { } else {
pipe->interval = interval; pipe->interval = interval;
pipe->next_tx_frame = usb->frame_number + pipe->interval; pipe->next_tx_frame = usb->frame_number + pipe->interval;
...@@ -1339,9 +1341,13 @@ static void __cvmx_usb_poll_rx_fifo(struct cvmx_usb_state *usb) ...@@ -1339,9 +1341,13 @@ static void __cvmx_usb_poll_rx_fifo(struct cvmx_usb_state *usb)
return; return;
/* Get where the DMA engine would have written this data */ /* Get where the DMA engine would have written this data */
address = __cvmx_usb_read_csr64(usb, CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8); address = __cvmx_usb_read_csr64(usb,
CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8);
ptr = cvmx_phys_to_ptr(address); ptr = cvmx_phys_to_ptr(address);
__cvmx_usb_write_csr64(usb, CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8, address + bytes); __cvmx_usb_write_csr64(usb,
CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8,
address + bytes);
/* Loop writing the FIFO data for this packet into memory */ /* Loop writing the FIFO data for this packet into memory */
while (bytes > 0) { while (bytes > 0) {
...@@ -1546,19 +1552,27 @@ static void __cvmx_usb_start_channel_control(struct cvmx_usb_state *usb, ...@@ -1546,19 +1552,27 @@ static void __cvmx_usb_start_channel_control(struct cvmx_usb_state *usb,
usbc_hctsiz.s.pid = 3; /* Setup */ usbc_hctsiz.s.pid = 3; /* Setup */
bytes_to_transfer = sizeof(*header); bytes_to_transfer = sizeof(*header);
/* All Control operations start with a setup going OUT */ /* All Control operations start with a setup going OUT */
USB_SET_FIELD32(CVMX_USBCX_HCCHARX(channel, usb->index), union cvmx_usbcx_hccharx, epdir, CVMX_USB_DIRECTION_OUT); USB_SET_FIELD32(CVMX_USBCX_HCCHARX(channel, usb->index),
union cvmx_usbcx_hccharx, epdir,
CVMX_USB_DIRECTION_OUT);
/* /*
* Setup send the control header instead of the buffer data. The * Setup send the control header instead of the buffer data. The
* buffer data will be used in the next stage * buffer data will be used in the next stage
*/ */
__cvmx_usb_write_csr64(usb, CVMX_USBNX_DMA0_OUTB_CHN0(usb->index) + channel*8, transaction->control_header); __cvmx_usb_write_csr64(usb,
CVMX_USBNX_DMA0_OUTB_CHN0(usb->index) + channel*8,
transaction->control_header);
break; break;
case CVMX_USB_STAGE_SETUP_SPLIT_COMPLETE: case CVMX_USB_STAGE_SETUP_SPLIT_COMPLETE:
usbc_hctsiz.s.pid = 3; /* Setup */ usbc_hctsiz.s.pid = 3; /* Setup */
bytes_to_transfer = 0; bytes_to_transfer = 0;
/* All Control operations start with a setup going OUT */ /* All Control operations start with a setup going OUT */
USB_SET_FIELD32(CVMX_USBCX_HCCHARX(channel, usb->index), union cvmx_usbcx_hccharx, epdir, CVMX_USB_DIRECTION_OUT); USB_SET_FIELD32(CVMX_USBCX_HCCHARX(channel, usb->index),
USB_SET_FIELD32(CVMX_USBCX_HCSPLTX(channel, usb->index), union cvmx_usbcx_hcspltx, compsplt, 1); union cvmx_usbcx_hccharx, epdir,
CVMX_USB_DIRECTION_OUT);
USB_SET_FIELD32(CVMX_USBCX_HCSPLTX(channel, usb->index),
union cvmx_usbcx_hcspltx, compsplt, 1);
break; break;
case CVMX_USB_STAGE_DATA: case CVMX_USB_STAGE_DATA:
usbc_hctsiz.s.pid = __cvmx_usb_get_data_pid(pipe); usbc_hctsiz.s.pid = __cvmx_usb_get_data_pid(pipe);
...@@ -1688,6 +1702,7 @@ static void __cvmx_usb_start_channel(struct cvmx_usb_state *usb, ...@@ -1688,6 +1702,7 @@ static void __cvmx_usb_start_channel(struct cvmx_usb_state *usb,
/* Clear all channel status bits */ /* Clear all channel status bits */
usbc_hcint.u32 = __cvmx_usb_read_csr32(usb, usbc_hcint.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HCINTX(channel, usb->index)); CVMX_USBCX_HCINTX(channel, usb->index));
__cvmx_usb_write_csr32(usb, __cvmx_usb_write_csr32(usb,
CVMX_USBCX_HCINTX(channel, usb->index), CVMX_USBCX_HCINTX(channel, usb->index),
usbc_hcint.u32); usbc_hcint.u32);
...@@ -1718,19 +1733,31 @@ static void __cvmx_usb_start_channel(struct cvmx_usb_state *usb, ...@@ -1718,19 +1733,31 @@ static void __cvmx_usb_start_channel(struct cvmx_usb_state *usb,
__cvmx_usb_write_csr32(usb, CVMX_USBCX_HCINTMSKX(channel, usb->index), usbc_hcintmsk.u32); __cvmx_usb_write_csr32(usb, CVMX_USBCX_HCINTMSKX(channel, usb->index), usbc_hcintmsk.u32);
/* Enable the channel interrupt to propagate */ /* Enable the channel interrupt to propagate */
usbc_haintmsk.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HAINTMSK(usb->index)); usbc_haintmsk.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HAINTMSK(usb->index));
usbc_haintmsk.s.haintmsk |= 1<<channel; usbc_haintmsk.s.haintmsk |= 1<<channel;
__cvmx_usb_write_csr32(usb, CVMX_USBCX_HAINTMSK(usb->index), usbc_haintmsk.u32); __cvmx_usb_write_csr32(usb,
CVMX_USBCX_HAINTMSK(usb->index),
usbc_haintmsk.u32);
} }
/* Setup the locations the DMA engines use */ /* Setup the locations the DMA engines use */
{ {
uint64_t dma_address = transaction->buffer + transaction->actual_bytes; uint64_t dma_address = transaction->buffer +
transaction->actual_bytes;
if (transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS) if (transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS)
dma_address = transaction->buffer + transaction->iso_packets[0].offset + transaction->actual_bytes; dma_address = transaction->buffer +
__cvmx_usb_write_csr64(usb, CVMX_USBNX_DMA0_OUTB_CHN0(usb->index) + channel*8, dma_address); transaction->iso_packets[0].offset +
__cvmx_usb_write_csr64(usb, CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8, dma_address); transaction->actual_bytes;
__cvmx_usb_write_csr64(usb,
CVMX_USBNX_DMA0_OUTB_CHN0(usb->index) + channel*8,
dma_address);
__cvmx_usb_write_csr64(usb,
CVMX_USBNX_DMA0_INB_CHN0(usb->index) + channel*8,
dma_address);
} }
/* Setup both the size of the transfer and the SPLIT characteristics */ /* Setup both the size of the transfer and the SPLIT characteristics */
...@@ -2040,8 +2067,15 @@ static void __cvmx_usb_schedule(struct cvmx_usb_state *usb, int is_sof) ...@@ -2040,8 +2067,15 @@ static void __cvmx_usb_schedule(struct cvmx_usb_state *usb, int is_sof)
* Without DMA we need to be careful to not schedule something * Without DMA we need to be careful to not schedule something
* at the end of a frame and cause an overrun. * at the end of a frame and cause an overrun.
*/ */
union cvmx_usbcx_hfnum hfnum = {.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index))}; union cvmx_usbcx_hfnum hfnum = {
union cvmx_usbcx_hfir hfir = {.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFIR(usb->index))}; .u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HFNUM(usb->index))
};
union cvmx_usbcx_hfir hfir = {
.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HFIR(usb->index))
};
if (hfnum.s.frrem < hfir.s.frint/4) if (hfnum.s.frrem < hfir.s.frint/4)
goto done; goto done;
...@@ -2660,7 +2694,9 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel) ...@@ -2660,7 +2694,9 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel)
} }
/* Disable the channel interrupts now that it is done */ /* Disable the channel interrupts now that it is done */
__cvmx_usb_write_csr32(usb, CVMX_USBCX_HCINTMSKX(channel, usb->index), 0); __cvmx_usb_write_csr32(usb,
CVMX_USBCX_HCINTMSKX(channel, usb->index),
0);
usb->idle_hardware_channels |= (1<<channel); usb->idle_hardware_channels |= (1<<channel);
/* Make sure this channel is tied to a valid pipe */ /* Make sure this channel is tied to a valid pipe */
...@@ -3026,7 +3062,8 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel) ...@@ -3026,7 +3062,8 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel)
*/ */
if (!buffer_space_left || if (!buffer_space_left ||
(bytes_this_transfer < 188)) { (bytes_this_transfer < 188)) {
pipe->next_tx_frame += pipe->interval; pipe->next_tx_frame +=
pipe->interval;
__cvmx_usb_perform_complete( __cvmx_usb_perform_complete(
usb, usb,
pipe, pipe,
...@@ -3132,17 +3169,21 @@ static int cvmx_usb_poll(struct cvmx_usb_state *usb) ...@@ -3132,17 +3169,21 @@ static int cvmx_usb_poll(struct cvmx_usb_state *usb)
prefetch_range(usb, sizeof(*usb)); prefetch_range(usb, sizeof(*usb));
/* Update the frame counter */ /* Update the frame counter */
usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index)); usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HFNUM(usb->index));
if ((usb->frame_number&0x3fff) > usbc_hfnum.s.frnum) if ((usb->frame_number&0x3fff) > usbc_hfnum.s.frnum)
usb->frame_number += 0x4000; usb->frame_number += 0x4000;
usb->frame_number &= ~0x3fffull; usb->frame_number &= ~0x3fffull;
usb->frame_number |= usbc_hfnum.s.frnum; usb->frame_number |= usbc_hfnum.s.frnum;
/* Read the pending interrupts */ /* Read the pending interrupts */
usbc_gintsts.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_GINTSTS(usb->index)); usbc_gintsts.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_GINTSTS(usb->index));
/* Clear the interrupts now that we know about them */ /* Clear the interrupts now that we know about them */
__cvmx_usb_write_csr32(usb, CVMX_USBCX_GINTSTS(usb->index), usbc_gintsts.u32); __cvmx_usb_write_csr32(usb,
CVMX_USBCX_GINTSTS(usb->index),
usbc_gintsts.u32);
if (usbc_gintsts.s.rxflvl) { if (usbc_gintsts.s.rxflvl) {
/* /*
...@@ -3199,7 +3240,8 @@ static int cvmx_usb_poll(struct cvmx_usb_state *usb) ...@@ -3199,7 +3240,8 @@ static int cvmx_usb_poll(struct cvmx_usb_state *usb)
*/ */
union cvmx_usbcx_haint usbc_haint; union cvmx_usbcx_haint usbc_haint;
usbc_haint.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HAINT(usb->index)); usbc_haint.u32 = __cvmx_usb_read_csr32(usb,
CVMX_USBCX_HAINT(usb->index));
while (usbc_haint.u32) { while (usbc_haint.u32) {
int channel; int channel;
...@@ -3492,7 +3534,8 @@ static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf) ...@@ -3492,7 +3534,8 @@ static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf)
return buf[0] != 0; return buf[0] != 0;
} }
static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength) static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
u16 wIndex, char *buf, u16 wLength)
{ {
struct octeon_hcd *priv = hcd_to_octeon(hcd); struct octeon_hcd *priv = hcd_to_octeon(hcd);
struct device *dev = hcd->self.controller; struct device *dev = hcd->self.controller;
......
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