* [PATCH v5] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call
[not found] <20180729140522.32173-2-tsotsos@gmail.com>
@ 2018-07-29 22:22 ` Georgios Tsotsos
0 siblings, 0 replies; only message in thread
From: Georgios Tsotsos @ 2018-07-29 22:22 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Georgios Tsotsos, Aaro Koskinen, James Hogan, devel, linux-kernel
Replacing CVMX_WAIT_FOR_FIELD32 macro with equivalent function, and used
simpler approach for new function's parameters.
Signed-off-by: Georgios Tsotsos <tsotsos@gmail.com>
---
v3: Changed CVMX_WAIT_FOR_FIELD32 macro to function according as refereed in
commit message and suggested by Greg Kroah-Hartman
v4: Added patch version text
v5: Fix parameters issue and simplify new function.
drivers/staging/octeon-usb/octeon-hcd.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index edf87d1b3609..c9fbff93bed4 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -574,18 +574,15 @@ static inline int cvmx_usb_get_data_pid(struct cvmx_usb_pipe *pipe)
* Loop through register until txfflsh or rxfflsh become zero.
*
* @usb: USB block
- * @address: 64bit address to read
- * @timeout_usec: Timeout
* @fflsh_type: Indicates fflsh type, 0 for txfflsh, 1 for rxfflsh
*
*/
-static int cvmx_wait_for_field32(struct octeon_hcd *usb, u64 address,
- u64 timeout_usec, int fflsh_type)
+static int cvmx_wait_tx_rx(struct octeon_hcd *usb, int fflsh_type)
{
int result;
- u64 done = cvmx_get_cycle() + timeout_usec *
+ u64 address = CVMX_USBCX_GRSTCTL(usb->index);
+ u64 done = cvmx_get_cycle() + 100 *
(u64)octeon_get_clock_rate / 1000000;
-
union cvmx_usbcx_grstctl c;
while (1) {
@@ -648,9 +645,9 @@ static void cvmx_fifo_setup(struct octeon_hcd *usb)
/* Flush all FIFOs */
USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfnum, 0x10);
USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfflsh, 1);
- cvmx_wait_for_field32(usb, address, 0, 100);
+ cvmx_wait_tx_rx(usb, 0);
USB_SET_FIELD32(address, cvmx_usbcx_grstctl, rxfflsh, 1);
- cvmx_wait_for_field32(usb, address, 1, 100);
+ cvmx_wait_tx_rx(usb, 1);
}
/**
--
2.16.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-07-29 22:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20180729140522.32173-2-tsotsos@gmail.com>
2018-07-29 22:22 ` [PATCH v5] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call Georgios Tsotsos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).