Commit Graph

5615 Commits

Author SHA1 Message Date
Nick Pelly 3922756ef2 mdm6600: Add mdm6600 usb-serial driver.
This is a re-write of the Motorola mdm6600_modem driver.

The usb_serial_generic_* handlers actually cover the USB bulk to serial data
path. So that code disappears.

The USB interrupt data to TIOCMGET ioctl path does not appear to be used by
pppd in userspace, using a temporary BUG_ON() to confirm.

So we end up with very little but a hook to register generic usb-serial
handlers for the MDM6600 vendor id.

I have not spent time testing behavior in low-power-modes, it is likely I will
need to over-ride some of the generic handlers at that point.

Change-Id: I65fdd06c2764416f365995761aa653878c0e393b
Signed-off-by: Nick Pelly <npelly@google.com>
2010-10-06 16:33:35 -07:00
Benoit Goby 1fa241ab56 usb: serial: Fix memory corruption in moto-flashmdm
moto_flashmdm_attach should also override bulk_out_buffers as
usb-serial expects they have the same size as bulk_out_buffer

Change-Id: I97487fa833ed3dee40a15c485ba8565944d0f9e4
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:33:33 -07:00
Nick Pelly 0170b3bfaf mdm6600_modem: fix crash on suspend in mdm6600_modem
This allow's Motorola's mdm6600_modem driver to work with suspend.

Patch provided by Motorola.

mdm6600_modem will shortly be replaced by a re-write, but its useful to commit
this update for easier A/B testing.

Change-Id: I0489f139e59e42ba1b6fb1979cf8b3ea8196a126
Signed-off-by: Nick Pelly <npelly@google.com>
2010-10-06 16:33:32 -07:00
Kazuhiro Ondo e07b275795 Motorola USB flash mode driver.
Change-Id: Idf72cbceeff56523be443013c5cbda79ea829994
2010-10-06 16:33:23 -07:00
Colin Cross 6833fbee23 usb: fsl_udc_core: Prevent udc timeout on suspend
Change-Id: Ic4780063d432860df835c54c17b2b9249132c8c5
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:33:23 -07:00
Dmitry Shmidt 8c44d79e2c usb: otg: cpcap-otg: Fix section mismatch warning
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-10-06 16:33:21 -07:00
Kazuhiro Ondo 468f272738 msm6600_modem: Add TS27.010 MDM6600 modem driver.
Change-Id: Ide01d600124ade39544800cce35f09fd35918e27
Signed-off-by: Nick Pelly <npelly@google.com>
2010-10-06 16:33:21 -07:00
Benoit Goby 6878c410f2 usb: otg: Add CPCAP USB OTG driver
This driver receives notifications from cpcap-whisper and emulates the same
behavior as when the VBUS and ID USB pins are connected to the app processor.

Change-Id: I671e64c58559a2a3036273ef1fe8acb6af516fac
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:33:20 -07:00
Colin Cross 98959c8563 Merge branch 'android-2.6.36' into android-tegra-2.6.36
Conflicts:
	drivers/input/touchscreen/Kconfig

Change-Id: Ifc75266e258f9513d78c47c12e2f1de1d2344f02
2010-10-06 16:32:09 -07:00
Gary King e9ba19bc3f usb: add OTG driver for tegra USB PHY
Change-Id: I23be62e819b658c0e25f70eebfbb8dc0dc76c173
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:59 -07:00
Benoit Goby 4929bfebc7 usb: gadget: fsl_udc: Removed unnecessary checks
The OTG driver disables the gadget device when the cable is
removed, so there is no need to check if the cable is plugged
before touching registers.

Change-Id: I0b1a3a8b07560d3eca2e2e25574b5219e3373808
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:58 -07:00
Benoit Goby 2973ae6586 usb: gadget: fsl_udc: Unlock the spinlock before calling clk_enable
On suspend, dr_controller_stop disable interrupts and on resume, interrupts
are disabled until dr_controller_run is called, so it is safe to call
fsl_udc_clk_suspend/resume with interrupts and the spinlock unlocked.

Change-Id: I33618295ea096a4bfd796d1a07dfc9722e7786b0
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:57 -07:00
Benoit Goby e6483a8c8e usb: gadget: fsl_udc: fix warning
Change-Id: I2123ac05aafe3f89db3c17dbcb16b44ca6222ce2
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:56 -07:00
Benoit Goby 3cea820b3c usb: gadget: fsl_udc: Use dma_alloc_coherent to allocate the status buffer
Change-Id: I7c17b7f8a8b89c6a687f6e2604542dabecc4cfa7
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:51 -07:00
Benoit Goby 7b284e782b usb: host: Add power_off_on_bus_suspend option
If the device connected to a port has out-of-band wakeup
signaling, the phy and controller may be powered off on bus suspend.

Change-Id: Ia206f05d01160411b97aefa83045cd759d35b66d
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:37 -07:00
Benoit Goby cf99404c25 usb: gadget: Enable/disable the gadget device on vbus_session calls
If we use an OTG driver, the driver will detect VBUS changes and notify
the gadget driver through vbus_session. Enable/disable the gadget driver
in vbus session so that there is no need to check the OTG state on every
interrupt.

Change-Id: I617ad5742be2632b2257b71314db8f330be463d5
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:23 -07:00
Benoit Goby c3b5093ac8 usb: host: OTG driver now adds/removes the ehci device based on ID pin status
There is no need anymore to check the OTG state on every interrupts and
use a work thread.

Moved the suspend code from usb_phy.c as this is ehci specific.

Change-Id: I523baab1476323a35360b1d802088370e42d0fd7
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:22 -07:00
Benoit Goby 6e9b65b7d1 usb: host: ehci-hub: Add port_reset_no_wait quirk
Tegra quirk: The PORT_RESET bit in PORTSC1 does not need to be cleared
and there is no need to wait for it to clear. The bit will automatically
change to 0 when the bus-reset sequence is done and an interrupt will be
generated.

Change-Id: I645417013af46785a249096ebc06a1f688228d94
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:21 -07:00
Gary King 2c7d591aa1 usb: host: ehci-hcd: add controller_resets_phy quirk
only reset the controller when doing so won't also reset the phy (Tegra quirk)

Change-Id: I549a18977d0d5ebfa12c32016aa9e6bffaa8643c
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:12 -07:00
Benoit Goby f967fbb601 usb: host: Add support for suspend and bus suspend
On suspend, use phy_suspend save the phy registers so that there is
no need to reset the controller and re-enumerate devices on resume.

Change-Id: I00fe5b87a1b319044724494b8e635b540088a38b
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:47 -07:00
Benoit Goby 51901f9003 usb: gadget: Reset the controller when cable is unplugged
Reset the controller when the cable is unplugged to leave it in the idle
state. The OTG driver will reconfigure it on vbus/id pin detection.

Change-Id: I87903ec86f3c35af64a141f27a34cc0720a61b08
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:46 -07:00
Benoit Goby e72831f9e0 usb: gadget: In OTG mode, power down the controller on probe
The OTG driver will power it up on ID pin detection. This avoids
race conditions when the device is powered on with the otg cable
attached.

Change-Id: I6bd5f1d73284f9b8534ef3dfb936b81a9400fa5b
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:44 -07:00
Benoit Goby e1bc56e357 usb: host: Fix kernel warning on probe
Change-Id: I6d5b10e047807f9bcb36809672705f8a8b2d11a4
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:34 -07:00
Benoit Goby 73254f0cce usb: host: Fix tegra EHCI suspend in OTG mode
Change-Id: Ia46830dfbb8bc39de1280b00ce30efe6022f6bd3
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:29 -07:00
Benoit Goby ce3a041d2e [ARM] tegra: Add USB PHY configuration
Configure board dependant phy settings from the board file.

Change-Id: I29f6ffe0b84a2a6eb55bade1379002f561d92d17
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:18 -07:00
Benoit Goby a0e0319691 [ARM] tegra: Setup USB PHY as recommended by NVIDIA
This fixes enumeration issues with some devices

Change-Id: I6283a6fb49a9e4505ad388cacdd88ecf1bdf1b9d
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:17 -07:00
Benoit Goby 288b58e155 usb: gadget: Fix tegra udc in OTG mode
Check the transceiver state before checking udc->stopped
Enable/disable the PHY and the clock on cable events

Change-Id: Id5a8a1b94f83da8060786f31181014dd1d546fc7
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:16 -07:00
Benoit Goby 2e39427ef6 usb: host: Add EHCI driver for NVIDIA Tegra SoCs
Change-Id: I53c560f2c31e043f139b840f58786429ded6ec62
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:15 -07:00
Benoit Goby d80e1484da usb: gadget: Use USB PHY api
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:09 -07:00
Benoit Goby 0e06e44e33 usb: gadget: Add support for OTG
Based on work by Nvidia

Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:03 -07:00
Erik Gilling 9285c27155 usb: gadget: add utmip phy into to fsl_tegra_udc
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:26:39 -07:00
Colin Cross 8ce033fd1f usb: gadget: fsl_udc: wmb ep_td struct when submitting to controller
Since these get allocated dmacoherent instead of noncacheable in armv7, we need
to do wmb before handing them to hardware.

Change-Id: I413eeb6da3bfeb754c4b475b19fe5823d83d3d04
Signed-off-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
2010-10-06 16:26:36 -07:00
Erik Gilling fd9c8bc964 usb: gadget: add preliminary Tegra support to fsl driver
Based on work by Gary King.

Further abstraction of the chipidea core support needs to be done.

Signed-off-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Gary King <GKing@nvidia.com>
2010-10-06 16:26:35 -07:00
Benoit Goby 461a510e68 usb: gadget: android: Remove WAKEUP flag from bmAttributes
Remove USB_CONFIG_ATT_WAKEUP from bmAttributes as we don't
support remote wakeup. This fixes an issue with the USB 2.0
compliance test tool.

Change-Id: Ic15e44710069f3f05ace6a82bbfa2b85a3649027
Signed-off-by: Benoit Goby <benoit@android.com>
2010-09-29 17:49:49 -07:00
Mike Lockwood 399bd7a333 USB: gadget: android: Disable MTP when RNDIS function is enabled.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:45 -07:00
Mike Lockwood b4ff5d8efe USB: g_mass_storage: Always allow disabling mass storage by writing to lun file
For android builds we disable the check for curlun->prevent_medium_removal.
Instead we let the framework manage unmounting policy, as we sometimes need
to unmount after the media has been removed.
This also helps support hosts that do not inform the device when the media
has been unmounted.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:42 -07:00
Mike Lockwood 73b1c8a4ea USB: gadget: f_mtp: Add ioctl for sending events via the interrupt endpoint
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:40 -07:00
Dmitry Shmidt d046c853ab drivers: usb: gadget: rndis: Fix section mismatch warning
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:40 -07:00
Dmitry Shmidt a9459724d5 drivers: usb: gadget: mass_storage: Fix section mismatch warning
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:40 -07:00
Dmitry Shmidt 53847ce6d7 drivers: usb: gadget: Fix section mismatch warning
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:40 -07:00
Mike Lockwood 35ee07a4df USB: composite: Add usb_composite_force_reset utility to force enumeration
Use this rather than calling usb_gadget_disconnect and usb_gadget_connect
directly to avoid sending USB disconnect events to userspace when resetting
the bus.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood d620052f3e USB: gadget: android: Remove unused function android_usb_set_connected()
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood 136826b4f1 USB: gadget: composite: Move switch_set_state calls to a work queue
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood 140277b8f7 USB: gadget: f_mtp: USB gadget function driver for MTP and PTP device support.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood b3a4a18a4c USB: composite: Add support for functions overriding USB_DT_STRING descriptors
Needed for MTP support.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood a9946e705c USB: gadget: composite: Add userspace notifications for USB state changes
Add switch to notify current USB configuration.  This can be used to detect
USB connect and disconnect events.

Broadcast a change via the usb_composite class when a USB function is
enabled or disabled.

Rename usb_function.hidden to usb_function.disabled.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood ff9cdcd465 USB: gadget: f_mass_storage: Integrate android customizations
Integrate support for android composite driver and platform data
within CONFIG_USB_ANDROID_MASS_STORAGE.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Velempati Chiranjeevi c600bd3a24 USB: android gadget: mass storage: Fix format issue for Vista Host
As part of formating the mass storage device, Host sends the INQUIRY
scsi command. As per the standard, the command length for this
command should be 6 bytes, whereas the Vista host sends 12 bytes.

When the command length of the command is not equal to the standard
length, the device sends a phase error as part of the status phase.
When the host receives a phase error, it re-enumerates, hence the
error.

If the command is INQUIRY, and the command length is 12 bytes,
treating this as a good command and not sending the phase error
to the host fixes this issue.

Signed-off-by: Velempati Chiranjeevi <c_cvelem@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Mike Lockwood e2dd99e8e2 USB: gadget: f_mass_storage: Defer handling interface changes until it is safe.
Pulling in some code from file_storage.c, we now handle interface changes
in do_set_config(), which is now not called until any pending requests have
been successfully completed or cancelled.

This fixes a race condition that resulted in usb_ep_free_request() being called
while the request is still busy.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Arve Hjønnevåg 372a94c2ed USB: gadget: android: mass_storage: Use spin_lock_irqsave/spin_unlock_irqrestore
The old code did not allways disable interrupts when called from thread
context, but tried to lock the same spinlock from interrupt context.

This was merged from a change to drivers/usb/function/mass_storage.c
in the android-msm-2.6.29 branch.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00