summaryrefslogtreecommitdiff
path: root/drivers/staging/octeon-usb/octeon-hcd.c
AgeCommit message (Collapse)Author
2013-10-11staging: octeon-usb: use list.h for transactionsAaro Koskinen
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-11staging: octeon-usb: use list.h for pipesAaro Koskinen
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-11staging: octeon-usb: use list_for_each_entry_safe()Aaro Koskinen
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-11staging: octeon-usb: use list_del_init()Aaro Koskinen
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-11staging: octeon-usb: use dynamic allocation for pipesAaro Koskinen
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-11staging: octeon-usb: use dynamic allocation for transactionsAaro Koskinen
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-11staging: octeon-usb: use a single .h fileAaro Koskinen
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-11staging: octeon-usb: CN3xxx: program p_xenbn and p_rclk through p_rtypeAaro Koskinen
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-11staging: octeon-usb: delete cvmx_usbnx_clk_ctl_cn50xxAaro Koskinen
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-06staging: octeon-usb: refactor __cvmx_usb_pipe_needs_splitAaro Koskinen
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-06staging: octeon-usb: eliminate submit_handleAaro Koskinen
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-06staging: octeon-usb: eliminate pipe_handleAaro Koskinen
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-06staging: octeon-usb: clean up hcpriv usageAaro Koskinen
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-06staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen
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-06staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urbAaro Koskinen
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-06staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen
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-06staging: octeon-usb: cvmx_usb_submit_bulk: get params from urbAaro Koskinen
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-06staging: octeon-usb: replace generic transfer callback data with urbAaro Koskinen
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-06staging: octeon-usb: call transfer completion callback directlyAaro Koskinen
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-06staging: octeon-usb: call port change callback directlyAaro Koskinen
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-06staging: octeon-usb: inline cvmx_usb_set_statusAaro Koskinen
Inline a trivial function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06staging: octeon-usb: eliminate cvmx_usb_internal_stateAaro Koskinen
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-06staging: octeon-usb: merge cvmx-usb into octeon-hcdAaro Koskinen
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-03staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()Aaro Koskinen
Delete redudant flags parameter. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: octeon-usb: delete cvmx_usb_isochronous_flagsAaro Koskinen
Delete unused flags. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()Aaro Koskinen
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-07-31staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_stateAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_iso_packet_t -> struct cvmx_usb_iso_packetAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_statusAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_callback_t -> enum cvmx_usb_callbackAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_complete_t -> enum cvmx_usb_completeAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_transfer_t -> enum cvmx_usb_transferAaro Koskinen
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-31staging: octeon-usb: cvmx_usb_speed_t -> enum cvmx_usb_speedAaro Koskinen
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-06-18staging: octeon-usb: octeon-hcd: eliminate printk()sAaro Koskinen
Replace one printk() with dev_dbg(), and delete the other. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18staging: octeon-usb: octeon-hcd: delete commented-out codeAaro Koskinen
Delete commented-out code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18staging: octeon-usb: octeon-hcd: reformat long commentsAaro Koskinen
Fix some comments to fit into 80 colums. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18staging: octeon-usb: octeon-hcd: use dev_dbgAaro Koskinen
Replace DEBUG macros with dev_dbg. Some less useful are completely deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: octeon-usb: octeon-hcd: make internal variable staticAaro Koskinen
Make an internal variable static. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: octeon-usb: octeon-hcd: fix some includesAaro Koskinen
Avoid including from "asm/". Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: octeon-usb: octeon-hcd: add missing bracesAaro Koskinen
One else branch was missing braces. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: octeon-usb: octeon-hcd: use tabs for code indentAaro Koskinen
Replace spaces with tabs where possible. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05staging: octeon-usb: remove duplicated include from octeon-hcd.cWei Yongjun
Remove duplicated include. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05staging: octeon-usb: call device_unregister when ↵Devendra Naga
platform_device_register_simple fails device_register is called before platform_device_register_simple gets called. unregister and reset the octeon_usb_registered variable Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05staging: octeon-usb: check return value of platform_device_register_simpleDevendra Naga
the return value is a pointer having an error set. we have to check for IS_ERR and return PTR_ERR when appropriate Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05staging: octeon-usb: fix more checkpatch errors/warnsDevendra Naga
place the opening brace right after the if, else, else if, switch statements. Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03staging: MIPS: add Octeon USB HCD supportAaro Koskinen
Add support for Octeon USB HCD. Tested on EdgeRouter Lite with USB mass storage. The driver has been extracted from GPL sources of EdgeRouter Lite firmware (based on Linux 2.6.32.13). Some minor fixes and cleanups have been done to make it work with 3.10-rc3. $ uname -a Linux (none) 3.10.0-rc3-edge-00005-g86cb5bc #41 SMP PREEMPT Sat Jun 1 20:41:46 EEST 2013 mips64 GNU/Linux $ modprobe octeon-usb [ 37.971683] octeon_usb: module is from the staging directory, the quality is unknown, you have been warned. [ 37.983649] OcteonUSB: Detected 1 ports [ 37.999360] OcteonUSB OcteonUSB.0: Octeon Host Controller [ 38.004847] OcteonUSB OcteonUSB.0: new USB bus registered, assigned bus number 1 [ 38.012332] OcteonUSB OcteonUSB.0: irq 122, io mem 0x00000000 [ 38.019970] hub 1-0:1.0: USB hub found [ 38.023851] hub 1-0:1.0: 1 port detected [ 38.028101] OcteonUSB: Registered HCD for port 0 on irq 122 [ 38.391443] usb 1-1: new high-speed USB device number 2 using OcteonUSB [ 38.586922] usb-storage 1-1:1.0: USB Mass Storage device detected [ 38.597375] scsi0 : usb-storage 1-1:1.0 [ 39.604111] scsi 0:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0 ANSI: 4 [ 39.619113] sd 0:0:0:0: [sda] 7579008 512-byte logical blocks: (3.88 GB/3.61 GiB) [ 39.630696] sd 0:0:0:0: [sda] Write Protect is off [ 39.635945] sd 0:0:0:0: [sda] No Caching mode page present [ 39.641464] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 39.651341] sd 0:0:0:0: [sda] No Caching mode page present [ 39.656917] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 39.664296] sda: sda1 sda2 [ 39.675574] sd 0:0:0:0: [sda] No Caching mode page present [ 39.681093] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 39.687223] sd 0:0:0:0: [sda] Attached SCSI removable disk Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>