Commit Graph

53 Commits (13dd52f11a04e616900f565d6a1e5138e58d579f)

Author SHA1 Message Date
Greg Kroah-Hartman 1cd572fc0c usb: musb: patches for v3.7 merge window
Here we have a bunch of miscellaneous cleanups and fixes
 to the musb driver. It fixes a bunch of mistakes errors
 which nobody has triggered before, so I'm not Ccing stable
 tree.
 
 We are finally improving OMAP's VBUS/ID Mailbox usage so
 that we can introduce our PHY drivers properly. Also, we're
 adding support for multiple instances of the MUSB IP in
 the same SoC, as seen on some platforms from TI which
 have 2 MUSB instances.
 
 Other than that, we have some small fixes like not kicking
 DMA for a zero byte transfer, or properly handling NAK timeout
 on MUSB's host side, and the enabling of DMA Mode1 for any
 transfers which are aligned to wMaxPacketSize.
 
 All patches have been pending on mailing list for a long time
 and I don't expect any big surprises with this pull request.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQT1XLAAoJEIaOsuA1yqREsfMP/jae2huECuECrWtm76TNm6Kl
 +1Movls2IkrYuVIM/QzSSqrmQ0BUVyOYjf1Uuke3tFA1KwkZsITZ12UONokiUGDd
 EuPP0RfXSiwdVNWF6cyJ8PiT5JWXD2fRJn3L22pXSiA4MvocLXM0yJiHrsM5q3Hd
 idg2npo7LEbLI3y1NDRdzR36Gk3y3K40U/ovXSQQQilhyk4yv7wpSbLqOR1UkkN/
 Xcf2FiRb1xFYRdu1HoSHRnIW0CmC2a8MbpAcOuUSoPqH5HIiouA0Cc4Wt5xki4y3
 +e0D0xpGK/Kt42nDkNoi51TaCw6aSY+GOqEFcI96o2/pq819nlcAzOGI77WGQIXX
 sLud3oYsESdc++ux1+jaEX9xju41NyzColxDHn4AnplYF2t4fbTd36Loxed9xco/
 LzHaaK3v1Ll30XiRiEnO5RBcgcwXDfFCMOUIDyVaVqNgCuYRrJIuhoXdlXvhEHAt
 GQjFn/+8izIncVZ2rPQ1H2thshlmVWgrZ4kEwnbKLYtv2sqAVHBN/iaN25iQlm/l
 Jva8ecXKl+9n92++X7vL8X/OmdVecBLey9eoqS+C+a0Kn9pSedOlUgkYpz8lGL38
 dBPZ5Zjukl7J+gQ45ol5IN3cuYA+QcAZjHR1VEkeR7otAY5xsEun7vmyBoY4qazz
 rUGhbofXB1gtGhUaaDBj
 =UHPu
 -----END PGP SIGNATURE-----

Merge tag 'musb-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

usb: musb: patches for v3.7 merge window

Here we have a bunch of miscellaneous cleanups and fixes
to the musb driver. It fixes a bunch of mistakes errors
which nobody has triggered before, so I'm not Ccing stable
tree.

We are finally improving OMAP's VBUS/ID Mailbox usage so
that we can introduce our PHY drivers properly. Also, we're
adding support for multiple instances of the MUSB IP in
the same SoC, as seen on some platforms from TI which
have 2 MUSB instances.

Other than that, we have some small fixes like not kicking
DMA for a zero byte transfer, or properly handling NAK timeout
on MUSB's host side, and the enabling of DMA Mode1 for any
transfers which are aligned to wMaxPacketSize.

All patches have been pending on mailing list for a long time
and I don't expect any big surprises with this pull request.
2012-09-11 13:56:29 -07:00
B, Ravi 65b3d52d02 usb: musb: add musb_ida for multi instance support
Added musb_ida in musb_core.c to manage the multi core ids.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-11 17:34:41 +03:00
Felipe Balbi 032ec49f53 usb: musb: drop useless board_mode usage
we are compiling the driver always with full OTG
capabilities, so that board_mode trick becomes
useless.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-09 12:34:46 +03:00
Felipe Balbi 78c289f876 usb: xceiv: create nop-usb-xceiv.h and avoid pollution on otg.h
nop-usb-xceiv was polluting otg.h with its own
function prototypes. Move those prototypes to
a nop-usb-xceiv.h header.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-03 09:36:18 +03:00
Kishon Vijay Abraham I ded017ee6c usb: phy: fix return value check of usb_get_phy
usb_get_phy will return -ENODEV if it's not able to find the phy. Hence
fixed all the callers of usb_get_phy to check for this error condition
instead of relying on a non-zero value as success condition.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-07-02 10:40:49 +03:00
Kishon Vijay Abraham I 662dca54ca usb: otg: support for multiple transceivers by a single controller
Add a linked list for keeping multiple PHY instances with different
types so that we can have separate USB2 and USB3 PHYs on one single
board. _get_phy_ has been changed so that the controller gets
the transceiver by type. _remove_phy_ has been added to let the phy
be removed from the phy list.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-25 14:05:35 +03:00
Kishon Vijay Abraham I 721002ec1d usb: otg: utils: rename function name in OTG utils
_transceiver() in otg.c is replaced with _phy. usb_set_transceiver is
replaced with usb_add_phy to make it similar to other usb standard
function names like usb_add_hcd.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-25 14:04:26 +03:00
Greg Kroah-Hartman 8062d94a54 Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.
 
 We have known for quite a long time that struct otg_transceiver was
 a bad name for the structure, considering transceiver is far from
 being OTG-specific (see 4e67185).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPTeeMAAoJEIaOsuA1yqRE6ZAP/j2G6DaDyng6vpyYQi2drXaY
 NKx3pA0sC98NACOv6sh+urcMDcDctLmOnwV18U+GNNP+qExQFnyuc7iGsXRxfUOj
 qkIbVPxzPcE0opmEMFJ5ZT85rw33DqKjFnQT4av3wwXe/qSrEkAfBoBSb6wn73rA
 v0JOhceGsFb+kJAc7U9Ji9A9xSjj+6uw08RTuuQv8KBLb5Pws+NoQ6UEjlni8umA
 lkOSelyBZN1OJU+fZKIpS4+SiwtdkZCm2wSIUiwaPosdJgw0w8fz0zNjn/4gAHB1
 oPyjjjP3/VDegp9CuYDRlnBgQa2K4V1vbjrBfhKbyar8fsOSoaPVv1fR9VKgVnT8
 RKlXKSeFEsdP4fOGYCjNKAzjeQH/qSNzdzo+s4GMqoWq7Lm3+b56zdQWvRmTT7Xg
 ++bMqFAi0noeU8aZWwSDMFiYv6O19o+Px4OTS/3aRmR1wdJpUUSk2M7Quw6A/YNj
 4Q5hDvio2eYtI1nya9yMS/j4ZiJ5fDQb5jUfBDB1MKtkZKKzVVSboK8P/rFq5+xf
 xdUfBRd7/fMk+he6RtemfjhMdYTiX6Cm6VzveZVBL4+7dERbnJDRgDhSJOYvA/eW
 Bvc7BY+/EYz7msF0gjLyWu3BBiChajk/D5ukoCIssUPGuIhmO1S7JRi1s+fLaNs3
 Bz8Haxql69YWrNL2ouQf
 =WiB6
 -----END PGP SIGNATURE-----

Merge tag 'xceiv-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB: transceiver changes for 3.4

Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.

We have known for quite a long time that struct otg_transceiver was
a bad name for the structure, considering transceiver is far from
being OTG-specific (see 4e67185).
2012-03-01 08:45:33 -08:00
Heikki Krogerus b96d3b0836 usb: Convert all users to new usb_phy
Use the new usb_phy_* functions with transceiver
operations instead of the old otg functions.

Includes fixes from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-27 15:41:48 +02:00
Heikki Krogerus 8675381109 usb: otg: Rename otg_transceiver to usb_phy
This is the first step in separating USB transceivers from
USB OTG utilities.

Includes fixes to IMX code from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13 13:34:36 +02:00
Felipe Balbi e9e8c85e69 usb: musb: make modules behave better
There's really no point in doing all that
initcall trickery when we can safely let
udev handle module probing for us.

Remove all of that trickery, by moving everybody
to module_init() and making proper use of
platform_device_register() rather than
platform_device_probe().

Tested-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Tested-by: Tasslehoff Kjappfot <tasskjapp@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-31 14:18:26 +02:00
Bob Liu ad50c1b20f usb: musb: blackfin: include prefetch head file
After the prefetch/list.h restructure, drivers need to explicitly include
linux/prefetch.h in order to use the prefetch() function.  Otherwise, the
current driver fails to build:
drivers/usb/musb/blackfin.c: In function 'musb_write_fifo':
drivers/usb/musb/blackfin.c:43: error: implicit declaration of function
'prefetch'

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-08-12 11:52:51 +03:00
Felipe Balbi 28e4970555 usb: musb: fix compile error
commit 35a83365da6aa10095c6138cc428c15853409c32
(usb: musb: drop unneeded musb_debug trickery)
introduced a compile error for blackfin and
tusb6010 glue layers. Fix it.

Reported-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-05-18 14:43:12 +03:00
Felipe Balbi 5c8a86e10a usb: musb: drop unneeded musb_debug trickery
We have a generic way of enabling/disabling
different debug messages on a driver called
DYNAMIC_PRINTK. Anyone interested in enabling
just part of the debug messages, please read
the documentation under:

Documentation/dynamic-debug-howto.txt

for information on how to use that great
infrastructure.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-05-13 14:34:04 +03:00
Anatolij Gustschin 3df0045325 usb: fix building musb drivers
Commit 3dacdf11 "usb: factor out state_string() on otg drivers"
broke building musb drivers since there is already another
otg_state_string() function in musb drivers, but with different
prototype. Fix musb drivers to use common otg_state_string(), too.

Also provide a nop for otg_state_string() if CONFIG_USB_OTG_UTILS
is not defined.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 18:16:39 -07:00
Mike Frysinger 132543074a USB: musb: blackfin: work around anomaly 05000450
DMA mode 1 data corruption anomaly on Blackfin systems.  This issue is
specific to the Blackfin silicon as the bug appears to be related to the
connection of the musb ip to the bus/dma fabric.

Data corruption when using USB DMA mode 1. (Issue manager 17-01-0105)
DMA mode 1 allows large size transfers to generate a single interrupt
at the end of the entire transfer.  The transfer is split up in packets
of length specified in the Maximum Packet Size field for that endpoint.
If the transfer size is not an integer multiple of the Maximum Packet
Size, a short packet will be present at the end of the transfer.

Under certain conditions this packet may be corrupted in the USB FIFO.

Workaround:
Use DMA mode 1 to transfer (n* Maximum Packet Size) and schedule DMA
mode 0 to transfer the short packet.

As an example if your transfer size is 33168 bytes and Maximum Packet
Size equals 512, schedule [33168 - (33168 mod 512)] in DMA mode 1 and
the remainder (33168 mod 512) in DMA mode 0.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-04-13 11:51:28 +03:00
Mike Frysinger 45567c28d2 usb: musb: blackfin: fix typo in new bfin_musb_vbus_status func
The common code has a "get" in the middle, but each implementation
does not have it.

Cc: stable@kernel.org
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-23 13:14:31 -07:00
Bob Liu 8f7e7b87ec usb: musb: blackfin: fix typo in new dev_pm_ops struct
Cc: stable@kernel.org
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-23 13:14:30 -07:00
Mike Frysinger 417ddf86c8 usb: musb: blackfin: fix typo in platform driver name
The modularization of the Blackfin driver set the name to "musb-blackfin"
in all the boards, but "musb-bfin" in the driver itself.  Since the driver
file name uses "blackfin", change the driver to "musb-blackfin".  This is
also easier as it's only one file to change.

Cc: stable@kernel.org
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-23 13:14:18 -07:00
Felipe Balbi 0662481855 usb: musb: disable double buffering when it's broken
We know that blackfin doesn't support double
buffering feature as of today. So we add a
flag set by musb_platform_init() to forcefully
disable that feature.

Such flag is created and marked as deprecated
to force us to find a solution for the missing
double buffering support on blackfin.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-01 10:41:30 +02:00
Greg Kroah-Hartman 36facadd9e Merge branch 'usb-next' into musb-merge
* usb-next: (132 commits)
  USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
  USB: uas: Ensure we only bind to a UAS interface
  USB: uas: Rename sense pipe and sense urb to status pipe and status urb
  USB: uas: Use kzalloc instead of kmalloc
  USB: uas: Fix up the Sense IU
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  usb: gadget: g_ncm added
  usb: gadget: f_ncm.c added
  usb: gadget: u_ether: prepare for NCM
  usb: pch_udc: Fix setup transfers with data out
  usb: pch_udc: Fix compile error, warnings and checkpatch warnings
  usb: add ab8500 usb transceiver driver
  USB: gadget: Implement runtime PM for MSM bus glue driver
  USB: gadget: Implement runtime PM for ci13xxx gadget
  USB: gadget: Add USB controller driver for MSM SoC
  USB: gadget: Introduce ci13xxx_udc_driver struct
  USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask
  USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc
  USB: gadget: Separate out PCI bus code from ci13xxx_udc
  ...
2010-12-16 10:05:06 -08:00
Greg Kroah-Hartman 224acb1839 Revert "USB: musb: blackfin: pm: make it work"
This reverts commit 1e393c6eec.

Needed to properly merge the musb changes that are in the
usb-next branch into Linus's tree.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16 10:03:27 -08:00
Felipe Balbi 92b48df24e usb: musb: drop board_set_vbus
that's not used anymore. So let's drop it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:33 +02:00
Felipe Balbi fcd22e3b1f usb: musb: blackfin: usb dev_pm_ops structure
instead of using musb_platform_suspend_resume,
we can use dev_pm_ops and let platform_device
core handle when to call musb_core's suspend and
glue layer's suspend.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:31 +02:00
Felipe Balbi 496351413a usb: musb: drop musb_platform_save/restore_context
... that can be easily folded into the
musb_platform_suspend/resume calls.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:26 +02:00
Felipe Balbi f7ec94370f usb: musb: pass platform_ops via platform_data
... then we don't need to export any symbols
from glue layer to musb_core.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:23 +02:00
Felipe Balbi a023c631f5 usb: musb: blackfin: give it a context structure
that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:22 +02:00
Felipe Balbi 9cb0308eec usb: musb: split blackfin to its own platform_driver
Just adding its own platform_driver, not really
using it yet.

Later patches will come to split power management
code from musb_core and move it completely to HW
glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10 10:21:16 +02:00
Felipe Balbi 743411b3f3 usb: musb: make all glue layer export struct musb_platform_ops
preparing to a big refactor on musb code. We need
to be able to compile in all glue layers (or at
least all ARM-based ones) together and have a
working binary.

While preparing for that, we move every glue
layer to export only one symbol, which is
a struct musb_platform_ops, and make all
other functions static.

Later patches will come to allow for compiling
all glue layers together and have a working
binary.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-07 09:19:39 +02:00
Hema Kalliguddi ea65df57c2 usb: musb: remove board_data parameter from musb_platform_init()
Removed the board_data parameter being
passed to musb_platform_init function
as board_data can be extracted from
device structure which is already member
of musb structure.

Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-01 10:56:33 +02:00
Bob Liu 9c7564620f USB: musb: blackfin: push clkin value to platform resources
In order to not touch the driver file for different xtal usage,
push the clkin value to board file and calculate the register
value instead of hardcoding it.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-11-05 14:13:32 +02:00
Bob Liu 68f64714dc USB: musb: blackfin: fix dynamic device<->host changing
We need to restart the timer in order to recognize USB devices in
host-only mode.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-11-05 14:12:22 +02:00
Bob Liu 1e393c6eec USB: musb: blackfin: pm: make it work
Split the USB MMR init steps out into a helper func that both the platform
init and the resume code may call.

Then while suspending, the gpio_vrsel will change from high to low which
will generate a wakeup event and resume the system immediately, so we need
to manually drive it low before we sleep.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-11-05 14:10:57 +02:00
Sergei Shtylyov 00be545e49 usb: musb: blackfin: call gpio_free() on error path in musb_platform_init()
Blackfin's musb_platform_init() needs to call gpio_free() for error cleanup iff
otg_get_transceiver() call returns NULL.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:21:59 -07:00
Sergei Shtylyov 3daad24d6c usb: musb: blackfin: call usb_nop_xceiv_unregister() in musb_platform_exit()
Blackfin's musb_platform_exit() forgets to call usb_nop_xceiv_unregister().
While fixing this, also remove the unneeded blank line there.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:21:59 -07:00
Sergei Shtylyov f405387435 USB: MUSB: fix kernel WARNING/oops when unloading module in OTG mode
Since commit 461972d8a4 (musb_core: don't call
musb_platform_exit() twice), unloading the driver module results in a WARNING
"kobject: '(null)' (c73de788): is not initialized, yet kobject_put() is being
called." (or even kernel oops) on e.g. DaVincis, though only in the OTG mode.
There exists dubious and unbalanced put_device() call in musb_free() which
takes place only in the OTG mode.  As this commit caused musb_platform_exit()
to be called (and so unregister the NOP transceiver) before this put_device()
call, this function references already freed memory.

On the other hand, all the glue layers miss the otg_put_transceiver() call,
complementary to the otg_get_transceiver() call that they do.  So, I think
the solution is to get rid of the strange put_device() call, and instead
call otg_put_transceiver() in the glue layers...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:21:58 -07:00
Sergei Shtylyov d55d221a93 MUSB: Blackfin: remove musb_platform_{suspend|resume}()
These functions do nothing and also are both unnecessarily 'extern'; actually,
musb_platform_resume() in not even called...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:35 -07:00
Sergei Shtylyov 69b2cd7200 MUSB: Blackfin: remove bfin_vbus_power()
This function does nothing...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:35 -07:00
Cliff Cai ff927addd6 USB: musb: support host/gadget role switching on Blackfin parts
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:35 -07:00
Cliff Cai 6ddc6dae4a USB: musb: allow the Blackfin vrsel gpio to be active low
Rather than hardcoding the gpio levels for vrsel, allow the platform
resources to handle this so boards can be active high or low.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Maulik Mankad de2e1b0c98 usb: musb: Set transceiver interface type
Program the OTG_INTERFSEL register based on
transcevier type passed from board file.

Adapt signature of musb_platform_init() function
for davinci, blackfin and tusb6010.

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:32 -07:00
Sergei Shtylyov 2f831751c5 MUSB: Blackfin: don't fake blackfin_interrupt() result
Commit a5073b5283 (musb_gadget: fix unhandled
endpoint 0 IRQs) misses this change to blackfin.c: stop faking successful
result of blackfin_interrupt() and emitting a debug message on an unhandled
interrupt.

Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-30 09:25:08 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Bryan Wu 1ca9e9ca31 usb: musb: clean up commit 'workaround Blackfin FIFO anomalies'
The version applied had a few comments which are now
done.

Thanks to Sergei for pointing out.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-02 14:53:47 -08:00
Bryan Wu 1c4bdc01b8 USB: musb: workaround Blackfin FIFO anomalies
Some of these workarounds are already in place, but labeled as affecting
all BF52x parts.  Since we have official anomaly numbers now, use those
defines.  And since writing to the FIFO has a similar hang issue as reading
from the FIFO, implement the workaround there too when necessary.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-23 11:34:19 -08:00
Bryan Wu 2002e7684d USB: musb: fix musb_platform_set_mode() definition
Update function definition to match latest MUSB framework.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:24 -08:00
Bryan Wu 42c8424736 USB: musb: kill some useless comments in Blackfin driver
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:24 -08:00
Mike Frysinger 04f4086fdc USB: musb: tweak musb_read_fifo() to avoid unused warnings
Otherwise gcc will whine about epnum/dma_reg being unused when building
for BF54x parts.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:23 -08:00
Mike Frysinger b20cf90650 USB: musb: make HAVE_CLK support optional
The Blackfin port doesn't support HAVE_CLK and the musb driver works fine
with support stubbed out, so take the existing Blackfin clk stubs and move
them to common musb code so we can drop the Kconfig dependency.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-09 13:52:07 -07:00
David Brownell 84e250ffa7 musb: proper hookup to transceiver drivers
Let the otg_transceiver in MUSB be managed by an external driver;
don't assume it's integrated.  OMAP3 chips need it to be external,
and there may be ways to interact with the transceiver which add
functionality to the system.

Platform init code is responsible for setting up the transeciver,
probably using the NOP transceiver for integrated transceivers.
External ones will use whatever the board init code provided,
such as twl4030 or something more hands-off.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:40 -07:00