* usb abi changes broke it
* FSL never added use_iram to urb struct ever so it never compiled in the first place
* cleanup memcpy usage so it's more readable (breaks 80 column limit but..)
Not enabled in any config. PROBABLY DOESN'T WORK. But at least it can be built and tested now.
It seems that for USB IP on Freescale MX5x processors, it needs >750
usec for the reset to complete. This change should not hurt any other
EHCI hardware.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
In function of gadget unregister the phy will been put to lowpower
mode,however in function of gadget regisger the phy lowpower mode will
not been cleard when OTG pin detect enabled.
Signed-off-by: Huhui <b29976@freescale.com>
(cherry picked from commit 11dc51645fe5a196f53fb30369698b4cb4d1e296)
1. At reset_irq, the status of port reset is unsure, maybe the reset
process(hardware does it) is finished, and the status of port reset
is also cleared by usb controller. So it only needs to compare to USBSTS
at usb irq process.
2. Due to mx35/mx25 phy's bug, it needs to reset phy when re-open
usb clock next time(Begin to use usb next time)
3. mdelay 100 seconds is too long for resume process, as this code
is only added for mx37, add arch macro for this mdelay. This can
minimize the effect for other platforms.
4. Compile is ok for all imx platform, functional tests are finished
for mx35 and mx23.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
support imx53 evk board OTG and Host1 vbus active
and inactive to low the power consume, fix fsl_otg.c
build failt, add vbus power control function pointer
in struct fsl_usb2_platform_data.
Signed-off-by: Hu hui <b29976@freescale.com>
The probe is called only pdev->name is the same with driver_name,
So the statement for name judgement is useless.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
The max packet length bit mask used for isochronous endpoints should
be 0x7FF instead of 0x8FF. 0x8FF will actually clear higher-order bits
in the max packet length field.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
In OTG mode, entering low power mode after udc probe causes
otg controller can not exit from it when switch to host mode.
this patch let gadget class driver handle it.
Signed-off-by: Jun Li <r65092@freescale.com>
Rename stmp_updater to fsl_updater, as the updater will be shared
across all i.MX platforms that needs MFGTool support.
Signed-off-by: Frank Li <Frank.Li@freescale.com>
In order to add IRAM to the USB Gadget driver, there are 2 kconfig
options to enable. One kconfig option was for USB host and the other
was for Gadget. The current SW required both kconfig to be
enable which is confusing. Also need to add iram_alloc function in
the Gadget driver.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Clean-up USB related Kconfigs. Remove the transceiver selections as this
is defined by the chip/board and is selected in platform data.
Use usb device resources defined in devices.c and fix resource sharing.
Use common otg transceiver functions.
Remove unnecessary OTG ifdefs.
Signed-off-by: Rob Herring <r.herring@freescale.com>
There are out of memory when transfer big size file.
There reason is kernel alloc a memory to get data from usb and put to a list,
and wake up uuc to read it. The problem is that read slower than usb transfer
So list become more and more till out of memory
Signed-off-by: Frank Li <Frank.Li@freescale.com>
When add usb gadget driver in OTG mode, cause nobody cared irq,
this pach disable usbintr in udc driver probe.
Signed-off-by: Li Jun <r65092@freescale.com>
1. If there is no usb devices connectted or all connectted usb
devices are in suspend state, usb host can suspend its whole bus,
then put the PHY into low power mode and close all usb clocks.
2. close all usb clocks for usb device low power mode.
(The patch is splitted 2 patches, this is FSL specific driver
part.)
Signed-off-by: Li Jun <r65092@freescale.com>
If there is no usb devices connectted or all connectted usb
devices are in suspend state, usb host can suspend its whole bus,
then put the PHY into low power mode and close all usb clocks.
(The patch is splitted 2 patches, this is common code part.)
Signed-off-by: Li Jun <r65092@freescale.com>
When register platform driver in 2.6.31 kernal, suspend
and resume are not set for device driver.
The patch fix this issue by using platform driver's
suspend/resume rountine directly in otg driver.
Signed-off-by: Li Jun <r65092@freescale.com>
MX233: Restructure the STMP378xxx USB Host and Gadget device structures
to be similar to MXC structures. Enable fsl_otg_arc driver to work on
MX233 platform. Remove FSL_USB2_DONT_REMAP requirement.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Conflicts:
arch/arm/mach-stmp3xxx/Kconfig
arch/arm/mach-stmp3xxx/Makefile
arch/arm/mach-stmp3xxx/devices.c
arch/arm/mach-stmp3xxx/include/mach/stmp3xxx.h
arch/arm/mach-stmp3xxx/stmp378x_devb.c
USB will enter low power mode if no vbus power supply.
Only finished this feature in Mx37.
1. When enter low power mode, driver will close usb related clocks
as possible as could.
set usb IP to stop.
Set PHY to low power suspend by setting PHCD bit of portsc.
2. This patch doesn't support low power mode in OTG mode yet.
Signed-off-by: Albert Chen <r65187@freescale.com>
This is gadget file storage changes needed for STMP universal updater
tool (manufacturing flashing tool).
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Some i.MX parts (MX31, MX37) need to have usb host queue descriptors
and/or buffers in on-chip IRAM in cases of heavily loaded memory
system (i.e. large LCDs).
Signed-off-by: Dinh Nguyen <r00091@freescale.com>
the USBPHY of STMP3xxx SoC has bug. The usb port power
is never enabled during standard ehci reset procedure if the
external device once passed plug/unplug procedure. This work-
around resets and reinitiates USBPHY before the ehci port reset
sequence started.
Signed-off-by: Rob Herring <r.herring@freescale.com>
This patch fix OTG pin-detect failure issue.
via sysfs set power/wakeup, i.MX51 can:
Put usb phy into low power mode when system enters stop or
standby mode; Enable usb device remote wakeup system by Vbus
and usb host remote wakeup system by device connection or
disconnection.
Signed-off-by: Li Jun <r65092@freescale.com>
commit 7152b592593b9d48b33f8997b1dfd6df9143f7ec upstream.
This patch (as1352) fixes a bug in the way isochronous input data is
returned to userspace for usbfs transfers. The entire buffer must be
copied, not just the first actual_length bytes, because the individual
packets will be discontiguous if any of them are short.
Reported-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream
We need to only copy the data received by the device to userspace, not
the whole kernel buffer, which can contain "stale" data.
Thanks to Marcus Meissner for pointing this out and testing the fix.
Reported-by: Marcus Meissner <meissner@suse.de>
Tested-by: Marcus Meissner <meissner@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jeff Mahoney <jeffm@suse.com>
commit ddeee0b2eec2a51b0712b04de4b39e7bec892a53 upstream
USB: usbfs: properly clean up the as structure on error paths
I notice that the processcompl_compat() function seems to be leaking the
'struct async *as' in the error paths.
I think that the calling convention is fundamentally buggered. The
caller is the one that did the "reap_as()" to get the as thing, the
caller should be the one to free it too.
Freeing it in the caller also means that it very clearly always gets
freed, and avoids the need for any "free in the error case too".
From: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Marcus Meissner <meissner@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jeff Mahoney <jeffm@suse.com>
commit 10d2cdb6102669279bee2d9a00a22431b74583d5 upstream.
Resolves kernel.org bug 14914.
Remove entry for 2770:915d (usb digital camera with mass storage
support) from unusual_devs.h. The fix triggered by the entry causes
the file system on the camera to be completely inaccessible (no
partition table, the device is not mountable).
The patch works, but let me clarify a few things about it. All the
patch does is remove the entry for this device from the
drivers/usb/storage/unusual_devs.h, which is supposed to help with a
problem with the device's reported size (I think). I'm pretty sure it
was originally added for a reason, so I'm not sure removing it won't
cause other problems to reappear. Also, I should note that this
unusual_devs.h entry was present (and activating workarounds) in
2.6.29, but in that version everything works fine. Starting with
2.6.30, things no longer work.
Signed-off-by: Ryan May <rmay31@gmail.com>
Cc: Rohan Hart <rohan.hart17@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
commit 2591530204a76fecc843529ade56afe865dd2657 upstream.
Fix a regression introduced by commit
715b1dc01f ("USB: usb_debug,
usb_generic_serial: implement multi urb write").
URB transfer buffer was never freed when using multi-urb writes.
Currently the only driver enabling multi-urb writes is usb_debug.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
commit a91b593edd4b3e8aa91f671b763b27b8119eb49d upstream.
This patch adds a mask bit which was mistakenly omitted from the
as1311 patch (usb-storage: add BAD_SENSE flag).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
commit cec3a53c7fe794237b582e8e77fc0e48465e65ee upstream.
This patch (as1321) fixes a problem with EHCI and UHCI root-hub
suspends: If the suspend occurs while a port is trying to resume, the
resume doesn't finish and simply gets lost. When remote wakeup is
enabled, this is undesirable behavior.
The patch checks first to see if any port resumes are in progress, and
if they are then it fails the root-hub suspend with -EBUSY.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>