summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
AgeCommit message (Collapse)Author
2012-05-22usb: musb: SW workaround for USB host issuesupriya karanth
For snowball in HOST mode, the eye diagram is facing high distortion in high speed use cases. This patch allows the user to use an external charge pump instead of the internal one to generate the Vbus voltage. This can be done by setting a sysfs entry. The external VBUS is OFF by default and can be made ON by setting the sysfs entry inorder to enumerate high speed devices. Signed-off-by: supriya karanth <supriya.karanth@stericsson.com>
2012-05-22musb: Fix ST-E changes after 3.4 portingPhilippe Langlais
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
2012-05-22USB: Add support for USB OTG 2.0Philippe Langlais
OTG 2.0 support is provided in Kernel 3.0. Srp related modifications are done in ab8500-usb. ST-Ericsson ID: 401192 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10054 Change-Id: I1bf52c8d6f6c4b0bedf5e51004dc72bf52a68020 Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/49006 Reviewed-by: QATOOLS Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Conflicts: drivers/usb/otg/ab8500-usb.c
2012-05-22USB: USB Electrical Test Mode SupportAvinash Kumar
Added the Test device VID/PID in TPL list for OTG 2.0 Removed the is_host_active check while setting the test mode. OTG Test Mode support is added.An OTG device shall support the test device that initiates these test modes. Upon enumeration by the host, the test device presents a VID/PID pair that defines a test mode or operation to execute. Upon enumerating the test device with VID of 0x1A0A, the Targeted Host shall perform the following operations based on the PID presented. PID Test Mode 0x0101 Test_SE0_NAK 0x0102 Test_J 0x0103 Test_K 0x0104 Test_Packet 0x0105 Reserved. 0x0106 HS_HOST_PORT_SUSPEND_RESUME 0x0107 SINGLE_STEP_GET_DEV_DESC 0x0108 SINGLE_STEP_ GET_DEV_DESC_DATA ST-Ericsson ID: 401192 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10054 Change-Id: I63525228da242419ceb54198f117795bf44df483 Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/48813 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: QABUILD Reviewed-by: QATEST
2012-05-22ux500:USB: Use proper musb structure for 8500Sakethram Bommisetti
On 8500 _musb is always NULL hence it will not restore the context._musb is required only on 5500 and hence adding a 5500 check ST-Ericsson Linux next: NA ST-Ericsson ID: 373930 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ic806d6983c97e632188a6ff568efe67bb86b1baa Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/46486 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22u8500:USB:Spurious Session Request InterruptsSakethram Bommisetti
On 8500 we get spurious session request interrupts when the DUT is in B-device.We need to ignore the interrupts when DUT is in B-device. Hence ignoring the interrupt. ST-Ericsson Linux next: NA ST-Ericsson ID: 373930 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I8899d37b22f4db4532e3987fce09230f1643f4a6 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44621 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22Ux500:USB:Handling Host state machineSakethram Bommisetti
Host state machine is being updated at the time of switching off the vbus.It should be handled as part of timer call back from the Disconnect interrupt. ST-Ericsson Linux next: NA ST-Ericsson ID: 373930 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I0a7d35591edcc8e42d4c35f714c76b6f751d932e Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45731 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22u8500: musb: Add pm runtime supportJonas Aberg
Add pm runtime support for musb, including both pin and clock handling. ST-Ericsson Linux next: - ST-Ericsson ID: 370128, 375498 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Idf72a6f226d1309d5a13b358e653ee97469e5ae6 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44709 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22musb: Kconfig: enable by default USB_MUSB_UX500 on ux500 plaformsPhilippe Langlais
Workaround to force musb_ux500 driver to be built-in. Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
2012-05-22usb:musb:ux500: Disable DMA for MTPAjay Jawade
Disable DMA for MTP. ST-Ericsson ID: 325587 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: NA Change-Id: I950aca1233e76f79a547f6d928f2203e064e924e Signed-off-by: Ajay Jawade <ajay.jawade@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43316 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22usb: musb: TXMAXP,TXCSR setting in Device modesupriya karanth
The TXMAXP and TXCSR registers were not set correctly for the BULK IN endpoints causing issues in Full speed in device mode. ST-Ericsson Linux next: NA ST-Ericsson ID: 362969 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I9942821702e5f78b5bcf2439a378eb1a244cb86f Signed-off-by: supriya karanth <supriya.karanth@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/39173 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Rajaram REGUPATHY <ragupathy.rajaram@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22ux500: USB: platform specific musb fifo cfgmaheswarudu
Pass the musb fifo configuration through ux500 platform file. ST-Ericsson ID: 367200 ST-Ericsson FOSS-OUT ID: NA ST-Ericsson Linux next: NA Signed-off-by: maheswarudu <v.maheswarudu@stericsson.com> Change-Id: If7aaddeb85198dc9edce605efec9a87bbfb6658c Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/40604 Reviewed-by: QATOOLS Reviewed-by: QABUILD Tested-by: Tobias ANDERSON <tobias.xx.andersson@stericsson.com> Reviewed-by: Rajaram REGUPATHY <ragupathy.rajaram@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Conflicts: drivers/usb/musb/musb_core.c
2012-05-22ux500:USB:Call is_compatible only in gadget modeSakethram Bommisetti
DMA channel program is called both in host and device modes. We are checking is_compatible in channel program.is_compatible should be used only by the gadget mode. So removing is_compatible in channel program and keeping generic checks. ST-Ericsson Linux next: NA ST-Ericsson ID: 373086 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I9c4d8dcaa93dd46d035c9060eeb437c15950bff2 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37188 Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22ux500:USB:Updating is_compatible with class checksSakethram Bommisetti
Current checks in is_compatible doesn't handle all the needed DMA cases. In case of Ethernet out transactions data size is not known and we cannot use the dma effectively in such cases. So,Using class names to accurately handle all the musb dma limitations/features.Hence, only for mass storage and ACM classes, data will be transfered over DMA. ST-Ericsson Linux next: NA ST-Ericsson ID: 373086 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: If83db00286bdc04c3d8e65e272b3ed586390ecfb Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36991 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22ux500:USB:Endpoint configurationSakethram Bommisetti
New usb_gadget_ops call for endpoint configuration allows the platform to configure the endpoints. ST-Ericsson Linux next: NA ST-Ericsson ID: 369302 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I3dd468a590e4439e540865b67cbc501bbdc4dcf7 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35058 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22usb: musb: TXMAXP,TXCSR setting in Host modesupriya karanth
The TXMAXP and TXCSR registers were not set correctly for the BULK OUT endpoints causing issues in Full speed in Host mode. ST-Ericsson Linux next: NA ST-Ericsson ID: 367049 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: If5f3552235d8909adef4777f08d612df432d8709 Signed-off-by: supriya karanth <supriya.karanth@stericsson.com>
2012-05-22musb: host: Wait for TXPKTRDY to clear in hostThirupathi Chippakurthy
MUSB_TXCSR_TXPKTRDY will not get cleared if the data is not on the bus. So, need to wait for it to clear in the DMA completion callback.As per musb datasheet, generally mode 1 needs to be used for data length greater than or equal to max packet size. Bus reset happening due to scsi timeout,since in this case should not return continue for next transfers. ST-Ericsson ID:ER 365087 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com>
2012-05-22ux500: USB : Save/Restore musb registers correctlymaheswarudu
In suspended state the registers are not saved and restored properly hence back ported. (http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git; a=commit;h=e4e5b136eb6f2d3aa10dca108a1b787dc92d67df) Also the code is aligned as per the latest linux-next. ST-Ericsson ID: 366298, 368370 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: I97ae0b055f6f1300a11190e1083349a6583f0377 Signed-off-by: maheswarudu <v.maheswarudu@stericsson.com>
2012-05-22ux500: usb: restore INDEX register in resume pathThirupathi Chippakurthy
Restoring the missing INDEX register value in ux500_restore_context(). without this Hub enumeration is inconsistent, if we do multiple connect/disconnect. ST-Ericsson ID: 364906 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com>
2012-05-22usb : musb : Do not register musb core PM opsrajaram
Currently musb core PM ops does save and restore of context The platform can enter CPU idle before the platform or runtime suspend is called.But musb core PM ops is not aware of CPU idle. and thus it saves and restores some junk context Since junk context is restored there is instability in usb functions. ux500 USB platform file handles the save and restore properly during cable connect and disconnent.So we don't require handling of context save and restore in musb core and hence not registering musb core PM ops. ST-Ericsson Linux next: NA ST-Ericsson ID: 370868,372121 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ie784c131792b686564561dc9b4bb262042e48504 Signed-off-by: rajaram <rajaram.ragupathy@stericsson.com>
2012-05-22ux500:USB: Handling the null pointer situationSakethram Bommisetti
Connect and boot can cause a NULL pointer access if link status interrupt comes before we enable the MUSB platform initialization happens. ST-Ericsson Linux next: NA ST-Ericsson ID: 365151 ST-Ericsson FOSS-OUT ID: NA Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Change-Id: I91aaa269913a7fdf5b4f59927dd563cf8c456e4f Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32825 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22ux500: usb:handle connection of microA to A cableThirupathi Chippakurthy
Connect Micro-A to phone first,Then connect device usb session should be valid to detect the connected device,Until host cable (micro-A) removal. MUSB session bit is cleared when usb host cable (Micro-A) removal from the phone,Not in case of only device disconnection from the usb host cable. ST-Ericsson ID: 364426 ST-Ericsson FOSS-OUT ID: NA ST-Ericsson Linux next: NA Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com>
2012-05-22u8500 : USB :New notification events for BatManrajaram
Added notification events for ACA cases so that battery manager can distinguish between Standard Host and ACA charger. ST-Ericsson Linux next: NA ST-Ericsson ID: 362951 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: rajaram <rajaram.ragupathy@stericsson.com> Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Change-Id: I02a19bced97b408990d8effb785418bf182ac27b Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34862 Tested-by: Rajaram REGUPATHY <ragupathy.rajaram@stericsson.com> Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22ux500:USB: Fix for CPU Idle from USBSakethram Bommisetti
USB context is stored and restored at each time when the usb cable is pluged in. ST-Ericsson Linux next: NA ST-Ericsson ID: 363987 ST-Ericsson FOSS-OUT ID: NA Change-Id: I5fa7b32dd4f67dcc81f2418e872ed5107f8624c0 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32785 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22musb: host: Wait for TXPKTRDY to clear in hostThirupathi Chippakurthy
MUSB_TXCSR_TXPKTRDY will not get cleared if the data is not on the bus. So, need to wait for it to clear in the DMA completion callback.As per musb datasheet, generally mode 1 needs to be used for data length greater than or equal to max packet size. ST-Ericsson ID:AP 363893 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: I934295798a5fbccf60c6f4004595b625a98098ed Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Signed-off-by: Praveena <praveen.nadahally@stericsson.com> Signed-off-by: rajaram <rajaram.ragupathy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32012 Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22ux500:USB:Handing the state machine for Host and Device modesSakethram Bommisetti
Setting the default state OTG_STATE_B_IDLE when there is removal of USB cable(Either Host or Device). ST-Ericsson ID: 363539 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: Ia066f9a1cb3433bc54bc934f9b0e9eeaf222f89b Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31860 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22musb:host: Fix for musb host receive in PIO modeThirupathi Chippakurthy
restore MUSB_RXCSR code is misplaced,Handling properly. ST-Ericsson ID: AP 363893 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Change-Id: I3f0499487a1d5e4837ade52e6fb8f0f573cce217 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31989 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22musb:host:Notifier call registered for host enableThirupathi Chippakurthy
Registering notifier call handled, to enable the host funtionality. ST-Ericsson ID: 352334 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I4f415ac61153372c81f6fc4d46ffb1e4e63d0d2c Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31572 Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-05-22musb:host: Fix for musb host receive in PIO modeThirupathi Chippakurthy
restore MUSB_RXCSR to original value when dma is not used. ST-Ericsson ID: ER 321774 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ia375a5a8da423bafae107248a4ea25158bce4793 Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31466 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22musb : host : Enable Host DMA supportThirupathi Chippakurthy
This enables host functionality with DMA. ST-Ericsson ID: 352334 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Change-Id: I9f3d65f3cf337f557825725f99d78f4470a651f9 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31260 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22usb:Migrate the patches to kernel 3.0Avinash Kumar
Following patches for usb driver are manually merged to kernel 3.0 d11e52a ux500: usb: add usb device mode support on u5500 1fecc55 ux500: usb: enabling adb and ACM functionality in u5500_defconfig 2847bf4 ux500: usb: error handling in musb for u5500 37f22da ux500: usb: U5500 v2 update e1b079d ux500: usb: Fix for enumeration when ON with cable 181701a ux500: usb: Fix for V2 emmc2 boot USB device issue 3a60721 mach-ux500: Handle the LinkStatus register. 086a83e usb: ux500: usb gpio enable/disable in pair ST-Ericsson ID: 352334 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: Id918b9a55d3b85faf7c003547748f17086af3ec7 Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30860
2012-05-22musb: host: linux Kernel3.0 host dma disabledThirupathi Chippakurthy
The dma driver disabled in Host Mode. Only enabled in Device mode. ST-Ericsson ID: 352334 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by:<thirupathi.chippakurthy@stericsson.com> Change-Id: I5d26d2990d1c01a2ce461eb87f2e8d4518f0e40a Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30823 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
2012-05-22musb: host: unmap the buffer for PIO in EP0Thirupathi Chippakurthy
The USB stack maps the buffer for DMA if the controller supports DMA.The buffer needs to be unmapped before CPU can perform PIO data transfers. ST-Ericsson ID: 353110 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I7811591f4f82f06af036bbde28cfa6f6de40cf8d Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30144 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
2012-05-22musb:host: Linux Kernel3.0 host IntegrationThirupathi Chippakurthy
The handling of device connection in host mode. ST-Ericsson ID: 352334 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Icdf576355fd5743bd48af0c8e33ae34526fc53a4 Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30020 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
2012-05-22USB:Updating the documentationPhilippe Langlais
Documentation from usb. Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
2012-05-22Generic:USB:Pairing suspend/resume correctly for musbSakethram Bommisetti
Changing the resume_noirq call to resume call so that suspend/resume is paired and we will have a stable USB power save. ST-Ericsson ID: ER 280150 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
2012-05-22USB: Double Bufferingsidhartk
Merging patch from gerrit id 6301 The patches enables hardware double buffering support for endpoint to enable Massstorage improve performance. Signed-off-by: sidhartk <sidhartha.kalra@stericsson.com> Change-Id: Ic5d1a4e5a17898b0eb90947a1bc3bb8f2d26f79c Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/8759 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-05-22musb: Update print for change in 3.0Robert Marklund
Change-Id: Ic543021ab89f519ac8811b4608ce9e7ac04ef464 Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
2012-05-22Workaround for hardware problem in host mode for the MUSB chipset. Add ↵Hans Petter Selasky
missed TXPKTRDY check. FIFOFLUSH is broken when a real packet is in the FIFO. This hardware feature only works when the FIFO is empty. The workaround described requires limiting the maximum number of USB devices to 126, 128 - 2. Signed-off-by: Hans Petter Selasky <hans.petter.selasky@stericsson.com> Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
2012-05-22usb: musb: ux500: add ux500 specific code for gadget sideMian Yousaf Kaukab
Although U8500 and U5500 platforms use paltform dma, Inventra dma specific code can work for them for the most part. Only difference is for the Rx path where this patch is making use of request->short_not_ok to select dma mode. usb: musb: ux500: add dma name for ux500 usb: musb: ux500: add dma glue layer for ux500 DMA is mainly intended for mass storage class. Unaligned sizes and buffers are not supported. usb: musb: ux500: add configuration and build options for ux500 dma usb: musb: clear AUTOSET while clearing DMAENAB On the completion of tx dma, dma is disabled by clearing MUSB_TXCSR_DMAENAB in TXCSR. If MUSB_TXCSR_AUTOSET was set in txstate() it will remain set although it is not needed in PIO mode. Clear it as soon as it is not needed. usb: musb: ux500: copy dma mask from platform device to musb device musb code checks dma mask before calling dma hooks. usb: musb: do not release dma channel on channel_program failure Musb hcd releases dma channel (hw_ep->tx_channel / hw_ep->rx_channel ) if ->channel_program() fails. A null hw_ep->tx_channel is then used to continue the transfer in pio mode. Next call to musb_ep_program() will try to allocate the dma channel again. This patch allows the transfer to continue in pio mode if ->channel_program() fails without releasing the dma channel. usb: musb: restore rxcsr on channel_program failure Rxcsr is configured for dma transfer before calling ->channel_program(). Restore rxcsr if ->channel_program() fails. usb: musb: ux500: enable host side dma support Host side dma support for ux500 is enabled by piggybacking on Inventra dma support. Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
2012-04-18usb: musb: davinci.c: add missing unregisterJulia Lawall
usb_nop_xceiv_unregister is needed on failure of usb_get_transceiver, as done in other error-handling code in the same function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-18usb: musb: drop __deprecated flagFelipe Balbi
Looks like we cannot live without that double_buffer_not_ok flag due to many HW bugs this MUSB core has. So, let's drop the __deprecated flag to avoid annoying compile warnings. Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-10usb: musb: omap: fix the error check for pm_runtime_get_syncShubhrajyoti D
pm_runtime_get_sync returns a signed integer. In case of errors it returns a negative value. This patch fixes the error check by making it signed instead of unsigned thus preventing register access if get_sync_fails. Also passes the error cause to the debug message. Cc: stable@vger.kernel.org Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-10usb: musb: omap: fix crash when musb glue (omap) gets initializedKishon Vijay Abraham I
pm_runtime_enable is being called after omap2430_musb_init. Hence pm_runtime_get_sync in omap2430_musb_init does not have any effect (does not enable clocks) resulting in a crash during register access. It is fixed here. Cc: stable@vger.kernel.org # v3.0, v3.1, v3.2, v3.3 Signed-off-by: Kishon Vijay Abraham I <kishon@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 bug in musb_cleanup_urbAjay Kumar Gupta
Control transfers with data expected from device to host will use usb_rcvctrlpipe() for urb->pipe so for such urbs 'is_in' will be set causing control urb to fall into the first "if" condition in musb_cleanup_urb(). Fixed by adding logic to check for non control endpoints. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.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-04-10usb: musb: fix oops on omap2430 module unloadVladimir Zapolskiy
This change prevents runtime suspend and resume actual execution, if omap2430 controller driver is loaded after musb-hdrc, and therefore the controller isn't initialized properly. The problem is reproducible with 3.1.y and 3.2 kernels. Kernel configuration of musb: % cat .config | egrep 'MUSB|GADGET' CONFIG_USB_MUSB_HDRC=y # CONFIG_USB_MUSB_TUSB6010 is not set CONFIG_USB_MUSB_OMAP2PLUS=m # CONFIG_USB_MUSB_AM35X is not set CONFIG_MUSB_PIO_ONLY=y CONFIG_USB_GADGET=y # CONFIG_USB_GADGET_DEBUG is not set # CONFIG_USB_GADGET_DEBUG_FILES is not set # CONFIG_USB_GADGET_DEBUG_FS is not set CONFIG_USB_GADGET_VBUS_DRAW=2 CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 CONFIG_USB_GADGET_MUSB_HDRC=m CONFIG_USB_GADGET_DUALSPEED=y CONFIG_USB_GADGETFS=m # CONFIG_USB_MIDI_GADGET is not set Fixes the following oops on module unloading: Unable to handle kernel NULL pointer dereference at virtual address 00000220 ----8<---- [<bf162088>] (omap2430_runtime_resume+0x24/0x54 [omap2430]) from [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50) [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50) from [<c0031a24>] (_od_runtime_resume+0x28/0x2c) [<c0031a24>] (_od_runtime_resume+0x28/0x2c) from [<c0306cb0>] (__rpm_callback+0x60/0xa0) [<c0306cb0>] (__rpm_callback+0x60/0xa0) from [<c0307f2c>] (rpm_resume+0x3fc/0x6e4) [<c0307f2c>] (rpm_resume+0x3fc/0x6e4) from [<c030851c>] (__pm_runtime_resume+0x5c/0x90) [<c030851c>] (__pm_runtime_resume+0x5c/0x90) from [<c02fd0dc>] (__device_release_driver+0x2c/0xd0) [<c02fd0dc>] (__device_release_driver+0x2c/0xd0) from [<c02fda18>] (driver_detach+0xe8/0xf4) [<c02fda18>] (driver_detach+0xe8/0xf4) from [<c02fcf88>] (bus_remove_driver+0xa0/0x104) [<c02fcf88>] (bus_remove_driver+0xa0/0x104) from [<c02fde54>] (driver_unregister+0x60/0x80) [<c02fde54>] (driver_unregister+0x60/0x80) from [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20) [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20) from [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430]) [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430]) from [<c007d8bc>] (sys_delete_module+0x1f4/0x264) [<c007d8bc>] (sys_delete_module+0x1f4/0x264) from [<c000f000>] (ret_fast_syscall+0x0/0x30) Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@nokia.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable@vger.kernel.org # 3.1 Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-03-29Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds
Pull slave-dmaengine update from Vinod Koul: "This includes the cookie cleanup by Russell, the addition of context parameter for dmaengine APIs, more arm dmaengine driver cleanup by moving code to dmaengine, this time for imx by Javier and pl330 by Boojin along with the usual driver fixes." Fix up some fairly trivial conflicts with various other cleanups. * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (67 commits) dmaengine: imx: fix the build failure on x86_64 dmaengine: i.MX: Fix merge of cookie branch. dmaengine: i.MX: Add support for interleaved transfers. dmaengine: imx-dma: use 'dev_dbg' and 'dev_warn' for messages. dmaengine: imx-dma: remove 'imx_dmav1_baseaddr' and 'dma_clk'. dmaengine: imx-dma: remove unused arg of imxdma_sg_next. dmaengine: imx-dma: remove internal structure. dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure. dmaengine: imx-dma: remove 'in_use' field of 'internal' structure. dmaengine: imx-dma: remove sg member from internal structure. dmaengine: imx-dma: remove 'imxdma_setup_sg_hw' function. dmaengine: imx-dma: remove 'imxdma_config_channel_hw' function. dmaengine: imx-dma: remove 'imxdma_setup_mem2mem_hw' function. dmaengine: imx-dma: remove dma_mode member of internal structure. dmaengine: imx-dma: remove data member from internal structure. dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c dmaengine: at_hdmac: add slave config operation dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic dmaengine/dma_slave: introduce inline wrappers dma: imx-sdma: Treat firmware messages as warnings instead of erros ...
2012-03-21dmaengine/dma_slave: introduce inline wrappersAlexandre Bounine
Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic() interfaces to hide new parameter from current users of affected interfaces. Convert current users to use new wrappers instead of direct calls. Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269]. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>