Commit graph

194 commits

Author SHA1 Message Date
Aaro Koskinen c4bdbdd916 staging: octeon-usb: eliminate 64-bit register access wrappers
Eliminate 64-bit register access wrappers. Since we don't implement
register-level debugging outputs, these are useless.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 13:47:10 +01:00
Aaro Koskinen 607078fcb1 staging: octeon-usb: remove internal function parameter sanity checks
Remove some function parameter sanity checks from internal functions
where we can rely them being called with sane parameters.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24 13:47:10 +01:00
Fabian Frederick 877945759d Staging: octeon: constify of_device_id array
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 14:11:29 +01:00
Gustavo A. R. Silva 1cf3273dfb Staging: octeon-usb: Fixed a typo
Fixed a typo in octeon-hcd.c file

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:00:23 -08:00
Linus Torvalds dab363f938 Staging patches for 3.19-rc1
Here's the big staging tree pull request for 3.19-rc1.
 
 We continued to delete more lines than were added, always a good thing,
 but not at a huge rate this release, only about 70k lines removed
 overall mostly from removing the horrid bcm driver.
 
 Lots of normal staging driver cleanups and fixes all over the place,
 well over a thousand of them, the shortlog shows all the horrid details.
 
 The "contentious" thing here is the movement of the Android binder code
 out of staging into the "real" part of the kernel.  This is code that
 has been stable for a few years now and is working as-is in the tens of
 millions of devices with no issues.  Yes, the code is horrid, and the
 userspace api leaves a lot to be desired, but it's not going to change
 due to legacy issues that we have no control over.  Because so many
 devices and companies rely on this, and the code is stable, might as
 well promote it out of staging.
 
 This was all discussed at the Linux Plumbers conference, and everyone
 participating agreed that this was the best way forward.
 
 There is work happening to replace the binder code with something new
 that is happening right now, but I don't expect to see the results of
 that work for another year at the earliest.  If that ever happens, and
 Android switches over to it, I'll gladly remove this version.
 
 As for maintainers, I'll be glad to maintain this code, I've been doing
 it for the past few years with no problems.  I'll send a MAINTAINERS
 entry for it before 3.19-final is out, still need to talk to the Google
 developers about if they are willing to help with it or not, last I
 checked they were, which was good.
 
 All of these patches have been in linux-next for a while with no
 reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSPICkACgkQMUfUDdst+yksdwCfSLE9VUy1o2sAPDRe+J3bQced
 EWEAoL3RtnejKbo5tHS2IT69pLrwiIDS
 =YXyM
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here's the big staging tree pull request for 3.19-rc1.

  We continued to delete more lines than were added, always a good
  thing, but not at a huge rate this release, only about 70k lines
  removed overall mostly from removing the horrid bcm driver.

  Lots of normal staging driver cleanups and fixes all over the place,
  well over a thousand of them, the shortlog shows all the horrid
  details.

  The "contentious" thing here is the movement of the Android binder
  code out of staging into the "real" part of the kernel.  This is code
  that has been stable for a few years now and is working as-is in the
  tens of millions of devices with no issues.  Yes, the code is horrid,
  and the userspace api leaves a lot to be desired, but it's not going
  to change due to legacy issues that we have no control over.  Because
  so many devices and companies rely on this, and the code is stable,
  might as well promote it out of staging.

  This was all discussed at the Linux Plumbers conference, and everyone
  participating agreed that this was the best way forward.

  There is work happening to replace the binder code with something new
  that is happening right now, but I don't expect to see the results of
  that work for another year at the earliest.  If that ever happens, and
  Android switches over to it, I'll gladly remove this version.

  As for maintainers, I'll be glad to maintain this code, I've been
  doing it for the past few years with no problems.  I'll send a
  MAINTAINERS entry for it before 3.19-final is out, still need to talk
  to the Google developers about if they are willing to help with it or
  not, last I checked they were, which was good.

  All of these patches have been in linux-next for a while with no
  reported issues"

* tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits)
  Staging: slicoss: Fix long line issues in slicoss.c
  staging: rtl8712: remove unnecessary else after return
  staging: comedi: change some printk calls to pr_err
  staging: rtl8723au: hal: Removed the extra semicolon
  lustre: Deletion of unnecessary checks before three function calls
  staging: lustre: fix sparse warnings: static function declaration
  staging: lustre: fixed sparse warnings related to static declarations
  staging: unisys: remove duplicate header
  staging: unisys: remove unneeded structure
  staging: ft1000 : replace __attribute ((__packed__) with __packed
  drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c"
  Drivers:staging:rtl8192e: Fixed checkpatch warning
  Drivers:staging:clocking-wizard: Added a newline
  staging: clocking-wizard: check for a valid clk_name pointer
  staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts
  staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily
  staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1()
  staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation
  staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB()
  staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation
  ...
2014-12-15 18:06:13 -08:00
Aaro Koskinen ba0b8e420a staging: octeon-usb: eliminate cvmx_dprintf() usage
Eliminate cvmx_dprintf() usage and use dev_err() instead.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:45:12 -08:00
Aaro Koskinen 2e6ac45c4a staging: octeon-usb: move helper functions
Move helper functions to make them visible to all functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:45:12 -08:00
Wolfram Sang a4d9e08f81 staging: octeon-usb: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:21:41 +02:00
Aleh Suprunovich 9109fcff29 staging: octeon-usb: fix checkpatch.pl warnings
fixed several 'line over 80 characters' in places where it can be done
without changing/refactoring code

Signed-off-by: Aleh Suprunovich <br@ahlamon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:27 +08:00
Tapasweni Pathak dea7503ac4 staging: octeon-usb: use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

Coccinelle script used :

// <smpl>
@haskernel@
@@
@depends on haskernel@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:20 +08:00
Sarah Khan c9a114e70a staging: octeon-usb: Removed unnessecary else after return
WARNING: else is generally not useful after return or break
checkpatch.pl warning in octeon-hcd.c

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:13 +08:00
Nitin Kuppelur 15ef0cc124 Staging: octeon-hcd: removed dummy label
This is a patch to the octeon-hcd.c file that fixes
removes dummy label i.e. label followed by return of
void function

Signed-off-by: Nitin Kuppelur <nitinkuppelur@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:49:13 -07:00
Nitin Kuppelur 9f87b44720 Staging: octeon-hcd: removed unwanted return from void
This is a patch to the octeon-hcd.c file that fixes
checkpatch.pl warning by removing return statement from
void functions.

Signed-off-by: Nitin Kuppelur <nitinkuppelur@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:06:52 -07:00
Aaro Koskinen 96ee2cc81f staging: octeon-usb: use USB_DIR_IN
Replace a magic value with #defined macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 10:48:32 -07:00
Aaro Koskinen e301dfb208 staging: octeon-usb: use generic control packet header
Use generic control packet header structure definition.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 10:48:32 -07:00
Aaro Koskinen e5873388e2 staging: octeon-usb: fix endianness bug
wHubCharacteristics gets wrong value on big-endian CPUs.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:39:22 -07:00
Aaro Koskinen 8dcf4ecea9 staging: octeon-usb: return transferred bytes only on success
Return transferred bytes only when transfer was successful.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:39:22 -07:00
Aaro Koskinen d8c39d3f20 staging: octeon-usb: don't retry on data toggle error
On data toggle error, we don't know if and how many bytes were
successfully transferred by DMA. We should just fail the transaction
instead of trying a retry.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:39:22 -07:00
Aaro Koskinen e5b90898d6 staging: octeon-usb: use usb_hcd_link_urb_to_ep()
The driver did not use link_urb_to_ep() / unlink_urb_from_ep(). This
caused odd behaviour in some error recovery situations, all requests
would start to fail after the first failure.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:39:22 -07:00
Aaro Koskinen cdd15d8925 staging: octeon-usb: drop dequeue tasklet
Cancel requests synchronously instead of using the dequeue tasklet.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:39:22 -07:00
Joe Perches f8628a47ba staging: Convert __FUNCTION__ to __func__
Use the normal mechanism for emitting a function name.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25 11:05:07 -07:00
Paul Davies C e725cef3e5 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: Paul Davies C <pauldaviesc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:03:50 +09:00
Paul Davies C f510643522 staging: octeon-usb: Add blank line after all declarations in octeon-hcd.c
Add blank lines after each declarations in drivers/staging/octeon-usb/octeon-hcd.c.

Signed-off-by: Paul Davies C <pauldaviesc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:02:48 +09:00
Aaro Koskinen 20f6b82992 staging: octeon-usb: use generic prefetch
Use generic prefetch.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:01:09 +09:00
Aaro Koskinen a4570140b3 staging: octeon-usb: delete redudant prefetches
cvmx_usb_pipe fits into a cache-line so additional prefetches are not
really helping anything.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:01:08 +09:00
Paul McQuade 8522851e3b Staging:Octeon-usb:octeon-hcd.c return value
return value instead of function.

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 16:36:16 +09:00
Aaro Koskinen 120ee599b5 staging: octeon-usb: prevent memory corruption
octeon-hcd will crash the kernel when SLOB is used. This usually happens
after the 18-byte control transfer when a device descriptor is read.
The DMA engine is always transfering full 32-bit words and if the
transfer is shorter, some random garbage appears after the buffer.
The problem is not visible with SLUB since it rounds up the allocations
to word boundary, and the extra bytes will go undetected.

Fix by providing quirk functions for DMA map/unmap that allocate a bigger
temporary buffer when necessary. Tested by booting EdgeRouter Lite
to USB stick root file system with SLAB, SLOB and SLUB kernels.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=72121
Reported-by: Sergey Popov <pinkbyte@gentoo.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-20 01:51:12 +00:00
Raluca Oncioiu b49f11335d Staging: octeon-usb: Remove unnecessary brackets
Remove brackets from single line branches of if statements.
Break long lines.

Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 16:10:54 -08:00
Raluca Oncioiu 1da69aa92b Staging: octeon-usb: Break up long lines
Break up long lines.

Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 16:08:01 -08:00
David Daney b91619c284 staging: octeon-usb: Probe via device tree populated platform device.
Extract clocking parameters from the device tree, and remove now dead
code and types.

Signed-off-by: David Daney <david.daney@cavium.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 09:11:28 -08:00
Peter Chen 3c9740a117 usb: hcd: move controller wakeup setting initialization to individual driver
Individual controller driver has different requirement for wakeup
setting, so move it from core to itself. In order to align with
current etting the default wakeup setting is enabled (except for
chipidea host).

Pass compile test with below commands:
	make O=outout/all allmodconfig
	make -j$CPU_NUM O=outout/all drivers/usb

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08 18:06:46 -08:00
Aaro Koskinen 5669601d92 staging: octeon-usb: use list.h for transactions
Use list.h helpers for transactions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:46:00 -07:00
Aaro Koskinen 4a23ee1bd7 staging: octeon-usb: use list.h for pipes
Use list.h helpers for pipes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:46:00 -07:00
Aaro Koskinen f011fefa8a staging: octeon-usb: use list_for_each_entry_safe()
Use list_for_each_entry_safe() when deleting all list items.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:46:00 -07:00
Aaro Koskinen 244544a185 staging: octeon-usb: use list_del_init()
Replace list_del() + INIT_LIST_HEAD() with list_del_init().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen d2695a8a3d staging: octeon-usb: use dynamic allocation for pipes
Use dynamic memory allocation for pipes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen a2dfef06e6 staging: octeon-usb: use dynamic allocation for transactions
Use dynamic memory allocation for transactions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen f121910396 staging: octeon-usb: use a single .h file
Merge USBC and USBN register definitions into a single header
file. Although all HW definitions are purely internal to the driver,
it's better to keep them separate due to the large size of the file.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen 7d7bc26b1d staging: octeon-usb: CN3xxx: program p_xenbn and p_rclk through p_rtype
Do the clock setup through p_rtype on all OCTEONs. This enables to get
rid of duplicated register definitions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen 34b70b9e05 staging: octeon-usb: delete cvmx_usbnx_clk_ctl_cn50xx
Add the missing bits to common clk ctl definition, and we can delete
duplicated definitions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen d8d8e148fd staging: octeon-usb: delete unused cvmx_usbnx_usbp_ctl_status definitions
cvmx_usbnx_usbp_ctl_status was multiplied for different OCTEONS and all
those definitions are unused. Delete them.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:58 -07:00
Aaro Koskinen aa87afe207 staging: octeon-usb: refactor __cvmx_usb_pipe_needs_split
Split a long line and remove redundant parenthesis.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:22 -07:00
Aaro Koskinen 3e1674c093 staging: octeon-usb: eliminate submit_handle
Eliminate submit_handle, use a direct reference instead.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 60f815078f staging: octeon-usb: eliminate pipe_handle
Eliminate pipe_handle, use a direct reference instead.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen be44063df5 staging: octeon-usb: clean up hcpriv usage
Use ep->hcpriv for pipe handle and urb->hcpriv for submit handle,
instead of packing both into the same field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen e16b5e3f14 staging: octeon-usb: cvmx_usb_submit_control: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 9fdbb6964b staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 2ae09e8721 staging: octeon-usb: cvmx_usb_submit_control: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 9ccca70718 staging: octeon-usb: cvmx_usb_submit_bulk: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 0cce1004c1 staging: octeon-usb: replace generic transfer callback data with urb
URB is always passed, so we can use strong typing here.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 75ee512487 staging: octeon-usb: call transfer completion callback directly
The callback is always the same, we can just call it directly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 393e214686 staging: octeon-usb: call port change callback directly
Call port change callback directly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 29a202fa76 staging: octeon-usb: inline cvmx_usb_set_status
Inline a trivial function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen cb61c60098 staging: octeon-usb: eliminate cvmx_usb_internal_state
Eliminate cvmx_usb_internal_state, just use cvmx_usb_state everywhere.
This also enables to allocate only the needed amount of data for the
USB internal state, instead of always allocating 64 KB.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 6570b4a991 staging: octeon-usb: merge cvmx-usb into octeon-hcd
cvmx-usb module provided Cavium "OS abstraction layer" for USB
functionality. To make this driver a proper Linux driver, we need to
refactor this layer out. By making all the code internal to the HCD
driver makes this task easier.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 72b80113a6 staging: octeon-usb: cvmx-usb.h: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:12 -07:00
Aaro Koskinen ab09e5c148 staging: octeon-usb: cvmx-usb.c: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen d0adff6acd staging: octeon-usb: cvmx-usb: delete unused macros
Delete unused cvmx_read_csr / cvmx_write_csr macros.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 5bffcff517 staging: octeon-usb: eliminate CVMX_PREFETCH_PREFX
Eliminate CVMX_PREFETCH_PREFX.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 1e50e9ac31 staging: octeon-usb: eliminate CVMX_PREFETCH_PREF0
Eliminate CVMX_PREFETCH_PREF0.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 10828735df staging: octeon-usb: delete CVMX_PREFETCH128
Delete unused macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 5e77a281eb staging: octeon-usb: inline CVMX_PREFETCH0
Inline CVMX_PREFETCH0 macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen e50aa24e79 staging: octeon-usb: replace CVMX_CLZ with __fls()
Replace CVMX_CLZ macro with __fls().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen e43de55ce2 staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()
Delete redudant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 951a444c61 staging: octeon-usb: delete redundant flags from __cvmx_usb_submit_transaction()
Delete redundant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 5dc0316c1b staging: octeon-usb: delete cvmx_usb_isochronous_flags
Delete unused flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 9be317e69e staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()
The function will always figure out the used clock internally, so delete
a redudant parameter and the flag.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Thomas Meyer 0a69bb4691 staging: octeon-usb: Cocci spatch "noderef"
sizeof when applied to a pointer typed expression gives the size of the
pointer.
Found by coccinelle spatch "misc/noderef.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:53:39 -07:00
Aaro Koskinen b9cc16c03d staging: octeon-usb: eliminate remaining typedef unions
Remaining typedef unions can be trivially eliminated with the pattern:

	foo_t -> union foo

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:50 -07:00
Aaro Koskinen 47509e4a9c staging: octeon-usb: cvmx_usb_control_header_t -> union cvmx_usb_control_header
Replace cvmx_usb_control_header_t with union cvmx_usb_control_header.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:49 -07:00
Aaro Koskinen 2bf249e482 staging: octeon-usb: cvmx_usb_internal_state_t -> struct cvmx_usb_internal_state
Replace cvmx_usb_internal_state_t with struct cvmx_usb_internal_state.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:48 -07:00
Aaro Koskinen 0ff6ac84f9 staging: octeon-usb: cvmx_usb_tx_fifo_t -> struct cvmx_usb_tx_fifo
Replace cvmx_usb_tx_fifo_t with struct cvmx_usb_tx_fifo_t.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:47 -07:00
Aaro Koskinen bb06528d6e staging: octeon-usb: cvmx_usb_pipe_list_t -> struct cvmx_usb_pipe_list
Replace cvmx_usb_pipe_list_t with struct cvmx_usb_pipe_list.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:46 -07:00
Aaro Koskinen 4ec3ae8412 staging: octeon-usb: cvmx_usb_pipe_t -> struct cvmx_usb_pipe
Replace cvmx_usb_pipe_t with struct cvmx_usb_pipe.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:46 -07:00
Aaro Koskinen 48f61f832d staging: octeon-usb: cvmx_usb_transaction_t -> struct cvmx_usb_transaction
Replace cvmx_usb_transaction_t with struct cvmx_usb_transaction.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:45 -07:00
Aaro Koskinen a24ed35a19 staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_state
Replace cvmx_usb_state_t with struct cvmx_usb_state.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:44 -07:00
Aaro Koskinen 6e0e1b0069 staging: octeon-usb: cvmx_usb_iso_packet_t -> struct cvmx_usb_iso_packet
Replace cvmx_usb_iso_packet_t with struct cvmx_usb_iso_packet.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:43 -07:00
Aaro Koskinen 51a19621cc staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_status
Replace cvmx_usb_port_status_t with struct cvmx_usb_port_status.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:43 -07:00
Aaro Koskinen 03f9adf44c staging: octeon-usb: cvmx_usb_stage_t -> enum cvmx_usb_stage
Replace cvmx_usb_stage_t with enum cvmx_usb_stage.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:10 -07:00
Aaro Koskinen 4f1d6ba901 staging: octeon-usb: cvmx_usb_transaction_flags_t -> enum cvmx_usb_transaction_flags
Replace cvmx_usb_transaction_flags_t with enum cvmx_usb_transaction_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:09 -07:00
Aaro Koskinen ff9a3e3982 staging: octeon-usb: cvmx_usb_isochronous_flags_t -> enum cvmx_usb_isochronous_flags
Replace cvmx_usb_isochronous_flags_t with enum cvmx_usb_isochronous_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:08 -07:00
Aaro Koskinen 3f937c51b4 staging: octeon-usb: cvmx_usb_pipe_flags_t -> enum cvmx_usb_pipe_flags
Replace cvmx_usb_pipe_flags_t with enum cvmx_usb_pipe_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:07 -07:00
Aaro Koskinen 1c25754815 staging: octeon-usb: cvmx_usb_initialize_flags_t -> enum cvmx_usb_initialize_flags
Replace cvmx_usb_initialize_flags_t with enum cvmx_usb_initialize_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:06 -07:00
Aaro Koskinen e53b624ae5 staging: octeon-usb: cvmx_usb_callback_t -> enum cvmx_usb_callback
Replace cvmx_usb_callback_t with enum cvmx_usb_callback.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:06 -07:00
Aaro Koskinen 1c1bdf2764 staging: octeon-usb: cvmx_usb_complete_t -> enum cvmx_usb_complete
Replace cvmx_usb_complete_t with enum cvmx_usb_complete.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:06 -07:00
Aaro Koskinen f1e1c1f69e staging: octeon-usb: cvmx_usb_direction_t -> enum cvmx_usb_direction
Replace cvmx_usb_direction_t with enum cvmx_usb_direction.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:05 -07:00
Aaro Koskinen 394d4e080f staging: octeon-usb: cvmx_usb_transfer_t -> enum cvmx_usb_transfer
Replace cvmx_usb_transfer_t with enum cvmx_usb_transfer.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:04 -07:00
Aaro Koskinen 4918072eb0 staging: octeon-usb: cvmx_usb_speed_t -> enum cvmx_usb_speed
Replace cvmx_usb_speed_t with enum cvmx_usb_speed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:04 -07:00
Aaro Koskinen 12aede9f2f staging: octeon-usb: cvmx-usb: reformat documentation
Reformat the high-level documentation to human readable plain text by
removing HTML and other tags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 3d1dc6adf0 staging: octeon-usb: cvmx-usb: delete CVS keyword markers
Delete CVS keyword markers.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 46e0270c25 staging: octeon-usb: cvmx-usb: convert @return
Convert "@return" to "Returns: ".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 116c163f99 staging: octeon-usb: cvmx-usb: convert @param
Convert "@param name" inside comments to "@name:".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:25 -07:00
Aaro Koskinen a6945527d3 staging: octeon-usb: cvmx-usb: delete duplicated documentation from .h file
Delete duplicated function call documentation from the .h file. These
functions are just internal anyway, and the .h file will be completely
removed in the future when the driver will be made a single self-contained
.c file.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:24 -07:00
Aaro Koskinen 6995ae41b3 staging: octeon-usb: cvmx-usb: delete @INTERNAL
Delete "@INTERNAL" from comments.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 1084937123 staging: octeon-usb: cvmx-usb: reformat long comments
Reformat long comments according to multi-line comment style.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen eeb90cb287 staging: octeon-usb: cvmx-usb: fix whitespace issues
Fix most of the whitespace issues reported by checkpatch:
	- use tabs for indentation
	- brace placement vs. newlines
	- (foo_t*) -> (foo_t *)
	- i=0 -> i = 0

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 95e67a7a29 staging: octeon-usb: cvmx-usb: delete __cvmx_usb_complete_to_string()
Delete a redundant function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 5645bcf98b staging: octeon-usb: cvmx-usb: replace cvmx_le16_to_cpu with le16_to_cpu
Replace cvmx_le16_to_cpu() with le16_to_cpu().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen ee7d14ce5e staging: octeon-usb: cvmx-usb: replace cvmx_wait_usec with udelay
Just use udelay().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:29 -07:00
Aaro Koskinen 2e5ae89870 staging: octeon-usb: cvmx-usb: replace long udelays with mdelays
Replace long udelays with mdelays.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00