aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musb_core.c
AgeCommit message (Collapse)Author
2013-03-22usb: musb: core: log VBUS errorGrazvydas Ignotas
VBUS_ERROR is a serious error that the driver often doesn't recover from in my tests, so we should at least inform the user about it. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-22usb: musb: core: honour initial transceiver stateGrazvydas Ignotas
As the usb transceiver driver usually starts first, it should already have default_a variable set according to ID pin state, so don't override it. In case default_a was not changed by trasceiver, it will default to 0 and this code will work as before. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: otg: prefix otg_state_string with usb_Felipe Balbi
all other functions under drivers/usb/ start with usb_, let's do the same thing. This patch is in preparation for moving otg_state_string to usb-common.c and deleting otg.c completely. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: musb: switch over to devm_ioremap_resource()Felipe Balbi
this will make sure that request_memory_region() will be called and that we don't need to manually call iounmap() on ->remove(). Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18usb: musb: core: remove unnecessary pr_info()Felipe Balbi
there's really no need for that message. It's been a while since it printed something useful. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-11usb: musb: core: fix possible build error with randconfigFelipe Balbi
when making commit e574d57 (usb: musb: fix compile warning) I forgot to git add this part of the patch which ended up introducing a possible build error. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05usb: musb: fix compile warningFelipe Balbi
When running 100 randconfig iterations, I found the following warning: drivers/usb/musb/musb_core.c: In function ‘musb_init_controller’: drivers/usb/musb/musb_core.c:1981:1: warning: label ‘fail5’ defined \ but not used [-Wunused-label] this patch fixes it by removing the unnecessary ifdef CONFIG_SYSFS. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-25Merge tag 'musb-for-v3.9' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: musb: patches for v3.9 merge window Mostly fixes all over which weren't urgent enough for the late -rc cycle. There is a Double Buffering fix for Host Mode TX, a dependency fix for the transceiver driver, some fixes to the error path and a fix for the use of omap_musb_maibox. Other than these fixes, there a removal duplicate headers from the dsps glue layer and removal of redundant assignments in omap2430_probe().
2013-01-17usb: musb: core: fix failure pathMing Lei
In the fail1~fail5 failure path, pm_runtime_disable() should be called to avoid 'Unbalanced pm_runtime_enable' error in next probe() which may be triggered by defer probe or next 'modprobe musb_hdrc'. Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: <stable@vger.kernel.org> v3.8 Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-01-07Merge tag 'fixes-for-v3.8-rc2' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe says: usb: fixes for v3.8-rc2 Here is the first set of fixes for v3.8-rc cycle. There is a build fix for musb's dsps glue layer caused by some header cleanup on the OMAP tree. Marvel's USB drivers got a fix up for clk API usage switching over to clk_prepare() calls. u_serial has a bug fix for a missing wake_up() which would make gs_cleanup() wait forever for gs_close() to finish. A minor bug fix on dwc3's debugfs interface which would make us read wrong addresses when dumping all registers. dummy_hcd learned how to enumerate g_multi. s3c-hsotg now understands that we shouldn't kfree() memory allocated with devm_*. Other than that, there are a bunch of other minor fixes on renesas_usbhs, tcm_usb_gadget and amd5536udc. All patches have been pending on mailing for many weeks and shouldn't cause any problems.
2012-12-17usb: musb: use io{read,write}*_rep accessorsMatthew Leach
The {read,write}s{b,w,l} operations are not defined by all architectures and are being removed from the asm-generic/io.h interface. This patch replaces the usage of these string functions in the musb accessors with io{read,write}{8,16,32}_rep calls instead. Signed-off-by: Matthew Leach <matthew@mattleach.net> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ben Herrenschmidt <benh@kernel.crashing.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-13usb: musb: core: print new line in the driver banner againSergei Shtylyov
Commit 5c8a86e10a7c164f44537fabdc169fd8b4e7a440 (usb: musb: drop unneeded musb_debug trickery) erroneously removed '\n' from the driver's banner. Concatenate all the banner substrings while adding it back... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-21usb: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21usb: remove use of __devinitdataBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21usb: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Geoff Levand <geoff@infradead.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21usb: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-06usb: musb: remove generic_interruptPhilippe De Swert
This patch is based on the discussion of a previous patch to fix an issue where the omap2430 musb driver is not working for N9/N950. Moving all the interrupt handling to the devices. Avoids inclusion of generic interrupt and breakage due to sometimes misleading CONFIG options. This makes sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950. Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases where I removed it. Also helps with the removal work of those options that Tony Lindgren predicted would happen at some point. Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-11-01usb: musb: remove hand-crafted id handlingSebastian Andrzej Siewior
This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO value which should do the same thing. This patch probably also fixes ux500 because I did not find the "musbid" variable to remove. And we close a tiny-unlikely race window becuase the old code gave the id back before device was destroyed in the remove case. [ balbi@ti.com : fixed up two failed hunks when applying patch ] Cc: B, Ravi <ravibabu@ti.com> Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Cc: Bob Liu <lliubbo@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31usb: musb: Perform only write access on MUSB_INTRTXESebastian Andrzej Siewior
This is part of the workaround for AM35x advisory Advisory 1.1.20. The advisory says that the IPSS bridge can't handle 8 & 16 bit read access. An 16bit read access to MUSB_INTRTXE results in an 32bit read access which also reads INTRRX and therefore may lose interrupts. This patch uses a shadow register of MUSB_INTRTXE so we only perform write access to it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31usb: musb: Perform only write access on MUSB_INTRRXESebastian Andrzej Siewior
This is part of the workaround for AM35x advisory Advisory 1.1.20. The advisory says that the IPSS bridge can't handle 8 & 16 bit read access. An 16bit read access to MUSB_INTRRXE results in an 32bit read access which also reads INTRUSB and therefore may lose interrupts. This patch uses a shadow register of MUSB_INTRRXE so we only perform write access to it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-10-31usb: musb: read MUSB_POWER register only when required.Sebastian Andrzej Siewior
This is part of the workaround for AM35x advisory Advisory 1.1.20. The advisory says that the IPSS bridge can't handle 8 & 16 bit read access. An 8bit read access to MUSB_POWER results in an 32bit read access which also reads INTRTX and therefore may lose interrupts. This patch tries to minimize reads to MUSB_POWER and perform them only when required. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-11usb: musb: kill global and static for multi instanceAjay Kumar Gupta
Moved global variable "musb_debugfs_root" and static variable "old_state" to 'struct musb' to help support multi instance of musb controller as present on AM335x platform. Also removed the global variable "orig_dma_mask" and filled the dev->dma_mask with parent device's dma_mask. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Santhapuri, Damodar <damodar.santhapuri@ti.com> Signed-off-by: Ravi Babu <ravibabu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-11usb: musb: add musb_ida for multi instance supportB, Ravi
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-08-31usb: musb: core: fix kernel-doc of musb_init_controller()Sergei Shtylyov
Some parameter names in this function's kernel-doc don't match the real parameters. While at it, give the 'nIrq' parameter slightly more verbose description. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-09usb: musb: Prevent the masking of the return valueShubhrajyoti D
Currently the errors returned by fifo_setup get masked by EINVAL, propagate the same to the caller. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-09usb: musb: drop is_host_capable() and is_peripheral_capable()Felipe Balbi
those two were defined to 1 anyway, quite useless. Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-09usb: musb: drop useless board_mode usageFelipe Balbi
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-07usb: musb: Fix bad call to kfree() in musb_freeBrian Downing
Commit 622859634a663c5e55d0e2a2cdbb55ac058d97b3 (usb: musb: drop a gigantic amount of ifdeferry) included this change: @@ -1901,11 +1844,7 @@ static void musb_free(struct musb *musb) dma_controller_destroy(c); } -#ifdef CONFIG_USB_MUSB_HDRC_HCD - usb_put_hcd(musb_to_hcd(musb)); -#else kfree(musb); -#endif } /* Since musb comes from struct usb_hcd's hcd_priv, which is allocated on the end of that struct, kfree'ing it is not going to work. Replace kfree(musb) with usb_put_hcd(musb_to_hcd(musb)), which appears to be the right thing to do here. Signed-off-by: Brian Downing <bdowning@lavos.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-07usb: musb: fix sparse warningsFelipe Balbi
The following warnings are fixed: drivers/usb/musb/musb_core.c:357:6: warning: symbol 'musb_otg_timer_func' was not declared. Should it be static? drivers/usb/musb/musb_core.c:1339:27: warning: incorrect type in initializer (different address spaces) drivers/usb/musb/musb_core.c:1339:27: expected void *mbase drivers/usb/musb/musb_core.c:1339:27: got void [noderef] <asn:2>*mregs drivers/usb/musb/musb_core.c:1347:17: warning: incorrect type in argument 1 (different address spaces) drivers/usb/musb/musb_core.c:1347:17: expected void [noderef] <asn:2>*addr drivers/usb/musb/musb_core.c:1347:17: got void *mbase drivers/usb/musb/musb_core.h:487:27: warning: incorrect type in initializer (different address spaces) drivers/usb/musb/musb_core.h:487:27: expected void *mbase drivers/usb/musb/musb_core.h:487:27: got void [noderef] <asn:2>*mregs drivers/usb/musb/musb_core.h:491:26: warning: incorrect type in argument 1 (different address spaces) drivers/usb/musb/musb_core.h:491:26: expected void const [noderef] <asn:2>*addr drivers/usb/musb/musb_core.h:491:26: got void *mbase drivers/usb/musb/tusb6010.c:270:48: warning: incorrect type in argument 2 (different address spaces) drivers/usb/musb/tusb6010.c:270:48: expected void [noderef] <asn:2>*buf drivers/usb/musb/tusb6010.c:270:48: got unsigned char [usertype] *[assigned] buf drivers/usb/musb/tusb6010.c:164:32: warning: incorrect type in argument 1 (different address spaces) drivers/usb/musb/tusb6010.c:164:32: expected void *to drivers/usb/musb/tusb6010.c:164:32: got void [noderef] <asn:2>*buf drivers/usb/musb/tusb6010.c:172:24: warning: incorrect type in argument 1 (different address spaces) drivers/usb/musb/tusb6010.c:172:24: expected void *to drivers/usb/musb/tusb6010.c:172:24: got void [noderef] <asn:2>*[assigned] buf Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-03usb: musb: check for zero byte in musb_read/write_fifoAjay Kumar Gupta
Added a check in musb_{read | write}_fifo for zero byte length. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-25usb: otg: utils: rename function name in OTG utilsKishon Vijay Abraham I
_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-05-04usb: musb: Add support for ti81xx platformAjay Kumar Gupta
TI81XX platform has two musb interfaces and uses CPPI4.1 DMA engine. It has builtin USB PHYs as AM35x. The current set of patches adds support for one instance and only in PIO mode. [ balbi@ti.com : make it compile and solve a "may be used uninitialized" warning ] Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Ravi Babu <ravibabu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-10usb: musb: wake the device before ulpi transfersGrazvydas Ignotas
musb can be suspended at the time some other driver wants to do ulpi transfers using usb_phy_io_* functions, and that can cause data abort, as it happened with isp1704_charger: http://article.gmane.org/gmane.linux.kernel/1226122 Add pm_runtime to ulpi functions to rectify this. This also adds io_dev to usb_phy so that pm_runtime_* functions can be used. Cc: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-10usb: musb: fix some runtime_pm issuesGrazvydas Ignotas
When runtime_pm was originally added, it was done in rather confusing way: omap2430_musb_init() (called from musb_init_controller) would do runtime_pm_get_sync() and musb_init_controller() itself would do runtime_pm_put to balance it out. This is not only confusing but also wrong if non-omap2430 glue layer is used. This confusion resulted in commit 772aed45b604 "usb: musb: fix pm_runtime mismatch", that removed runtime_pm_put() from musb_init_controller as that looked unbalanced, and also happened to fix unrelated isp1704_charger crash. However this broke runtime PM functionality (musb is now always powered, even without gadget active). Avoid these confusing runtime pm dependences by making musb_init_controller() and omap2430_musb_init() do their own runtime get/put pairs; also cover error paths. Remove unneeded runtime_pm_put in omap2430_remove too. isp1704_charger crash that motivated 772aed45b604 will be fixed by following patch. Cc: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-03-01usb: core: hcd: make hcd->irq unsignedFelipe Balbi
There's really no point in having hcd->irq as a signed integer when we consider the fact that IRQ 0 means NO_IRQ. In order to avoid confusion, make hcd->irq unsigned and fix users who were passing -1 as the IRQ number to usb_add_hcd. Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-01Merge tag 'xceiv-for-v3.4' of ↵Greg Kroah-Hartman
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-01Merge tag 'musb-for-v3.4' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next USB: MUSB changes for 3.4 Here are a set of changes to the MUSB driver. In summary we have a patch making modules behave better, there's a fix on debugfs' error path, a small change removing an unnecessary pm_runtime call on musb_shutdown() and a fix to relesect the endpoint in Interrupt context. This last patch is needed because we must drop musb's lock when calling request->complete() and that could cause problems if another thread queues a request and ends up changing MUSB_INDEX register.
2012-02-27usb: otg: Convert all users to pass struct usb_otg for OTG functionsHeikki Krogerus
This changes the otg functions so that they receive struct otg instead of struct usb_phy as parameter and converts all users of these functions to pass the otg member of their usb_phy. Includes fixes to IMX code from Sascha Hauer. [ balbi@ti.com : fixed a compile warning on ehci-mv.c ] Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Igor Grinberg <grinberg@compulab.co.il> 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-27usb: Convert all users to new usb_phyHeikki Krogerus
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-13usb: musb: Start using struct usb_otgHeikki Krogerus
Use struct usb_otg members with OTG specific functions instead of usb_phy members. [ balbi@ti.com: added a missing change on musb_gadget.c to avoid a compile error on a later patch ] Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-13usb: otg: Rename otg_transceiver to usb_phyHeikki Krogerus
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-01-31usb: musb: make modules behave betterFelipe Balbi
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-24usb: musb: fix shutdown while usb gadget is in useGrazvydas Ignotas
If we shutdown without stopping the gadget first or removing the cable, gadget manages to configure itself again: root@pandora /root# poweroff The system is going down NOW! Requesting system poweroff [ 47.714385] musb-hm halted. [ 48.120697] gadget: suspend [ 48.123748] gadget: reset config [ 48.127227] gadget: ecm deactivated [ 48.130981] usb0: gether_disconnect [ 48.281799] gadget: high-speed config #1: CDC Ethernet (ECM) [ 48.287872] gadget: init ecm [ 48.290985] gadget: notify connect false [ 48.295288] gadget: notify speed 425984000 This is not only unwanted, it's also happening on half-unitialized state, after musb_shutdown() has returned, which sometimes causes hardware to fail to work after reboot. Let's better properly stop gadget on shutdown too. This patch moves musb_gadget_cleanup out of musb_free(), which has 2 callsites: probe error path and musb_remove. On probe error path it was superflous since musb_gadget_cleanup is called explicitly there, and musb_remove() calls musb_shutdown(), so cleanup will get called as before. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: musb: drop superfluous pm_runtime calls around musb_shutdownGrazvydas Ignotas
Since commit 4f9edd2d7e8d "usb: musb: Fix the crash issue during reboot" musb_shutdown() does pm_runtime_get_sync/pm_runtime_put by itself, so this no longer needs to be done by the caller. Also, musb_exit_debugfs() doesn't access the device, so just drop those runtime_pm calls. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-12-22Merge branch 'for-next/musb' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next * 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: usb: musb: remove extern qualifier from musb_debug.h header usb: musb: cleanup kconfig usb: musb: trivial Kconfig cleanups musb: omap2430: avoid pm_runtime_disable() usb: musb: remove a bit of indentation usb: musb: trivial cleanup usb: musb: fix pm_runtime mismatch
2011-12-20usb: musb: fix pm_runtime mismatchFelipe Contreras
In musb_init_controller() there's a pm_runtime_put(), but there's no pm_runtime_get(), which creates a mismatch that causes the driver to sleep when it shouldn't. This was introduced in 7acc619[1], but it wasn't triggered in my setup until 18a2689[2] was merged to Linus' branch at point df0914[3]. IOW; when PM is working as it was supposed to. However, it seems most of the time this is used in a way that keeps the counter above 0, so nobody noticed. Also, it seems to depend on the configuration used in versions before 3.1, but not later (or in it). I found the problem by loading isp1704_charger before any usb gadgets: http://article.gmane.org/gmane.linux.kernel/1226122 All versions after 2.6.39 are affected. [1] usb: musb: Idle path retention and offmode support for OMAP3 [2] OMAP2+: musb: hwmod adaptation for musb registration [3] Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 Cc: stable@vger.kernel.org Cc: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12Merge branch 'for-next/musb' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next * 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: usb: musb: omap2430: fix compile warning usb: musb: fix pm_runtime calls while atomic usb: musb: drop ARCH dependency usb: musb: headers cleanup usb: musb: allow building USB_MUSB_TUSB6010 as a module usb: musb: use a Kconfig choice to pick the right DMA method usb: musb: omap2+: save and restore OTG_INTERFSEL usb: musb: omap2+: fix context api's usb: musb: ux500: optimize DMA callback routine
2011-12-12Merge branch 'for-next/dwc3' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next * 'for-next/dwc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (392 commits) usb: dwc3: ep0: fix for possible early delayed_status usb: dwc3: gadget: fix stream enable bit usb: dwc3: ep0: fix GetStatus handling (again) usb: dwc3: ep0: use dwc3_request for ep0 requsts instead of usb_request usb: dwc3: use correct hwparam register for power mgm check usb: dwc3: omap: move to module_platform_driver usb: dwc3: workaround: missing disconnect event usb: dwc3: workaround: missing USB3 Reset event usb: dwc3: workaround: U1/U2 -> U0 transiton usb: dwc3: gadget: return early in dwc3_cleanup_done_reqs() usb: dwc3: ep0: handle delayed_status again usb: dwc3: ep0: push ep0state into xfernotready processing usb: dwc3: fix sparse errors usb: dwc3: fix few coding style problems usb: dwc3: move generic dwc3 code from gadget into core usb: dwc3: use a helper function for operation mode setting usb: dwc3: ep0: don't use ep0in for transfers usb: dwc3: ep0: use proper endianess in SetFeature for wIndex usb: dwc3: core: drop DWC3_EVENT_BUFFERS_MAX usb: dwc3: omap: add multiple instances support to OMAP ...
2011-12-12usb: musb: allow building USB_MUSB_TUSB6010 as a moduleArnd Bergmann
Commit 1376d92f9 "usb: musb: allow musb and glue layers to be modules" made the USB_MUSB_TUSB6010 option modular, but actually building the driver as a module does not work, so various randconfig builds actually fail. This changes all code that depends on the option to also check for modular builds, and exports the necessary symbols. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>