aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* usb: otg: otg-wakelock: Fix build for 3.12Paul Kocialkowski2014-05-032-10/+7
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* usb: otg: otg-wakelock: Fix build for 3.7Arve Hjønnevåg2014-05-021-3/+6
| | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* usb: otg: otg-wakelock: Fix build for 3.4Benoit Goby2014-05-021-5/+5
| | | | | Change-Id: I97e21e9e6645bf18522675039e512f85fe836794 Signed-off-by: Benoit Goby <benoit@android.com>
* usb: otg: otg-wakelock: fix build for 3.3Colin Cross2014-05-021-0/+1
| | | | | | | Add missing module.h include Change-Id: Ib0538ca569c9e0713ceefcd1f91c6bc089d2f2ba Signed-off-by: Colin Cross <ccross@android.com>
* usb: otg: Temporarily grab wakelock on charger and disconnect eventsTodd Poynor2014-05-021-77/+56
| | | | | Change-Id: If995d4af4adcb08e8369009483f2956ad9627267 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* USB: OTG: Take wakelock when VBUS presentTodd Poynor2014-05-023-0/+199
| | | | | | | | Enabled by default, can disable with: echo N > /sys/module/otg_wakelock/parameters/enabled Change-Id: I34974624c52ae23490852b44c270d2f326cf6116 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* usb: gadget: android: 3.12 fixesPaul Kocialkowski2014-05-021-1/+2
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* drivers: usb: gadget: 64-bit related type fixesGreg Hackmann2014-05-022-14/+18
| | | | | Change-Id: I2f9b12e1e0cdfe64ffe20db78d319a6221821184 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* fix false disconnect due to a signal sent to the reading processkeunyoung2014-05-021-5/+27
| | | | | | | | | | | | | | - In the current implementation, when a signal is sent to the reading process, read is cancelled by calling usb_ep_dequeue, which lead into calling acc_complete_out with ECONNRESET, but the current logic treats it as disconnection, which makes the device inaccessible until cable is actually disconnected. - The fix calls disconnect only when ESHUTDOWN error is passed. - If data has already arrived while trying cancelling, the data is marked as available, and it will be read out on the next read. This is necessary as USB bulk is assumed to guarantee no data loss. Signed-off-by: keunyoung <keunyoung@google.com>
* usb: gadget: f_mtp: move userspace interface to uapiColin Cross2014-05-021-0/+11
| | | | | | | | | Move the most of linux/usb/f_mtp.h header to uapi. Move the only remaining structure definition into f_mtp.c, the only place that uses it. Change-Id: I952c1a9dc15c36bf295a0eb4d74b6b1ad912ed03 Signed-off-by: Colin Cross <ccross@android.com>
* usb: gadget: android: Remove device if probe failsBenoit Goby2014-05-021-1/+3
| | | | | | | | Make sure the android0 device is removed before we can destroy the class. Change-Id: Id584888c407beb80a1df4990f73fe31ccb9d4767 Signed-off-by: Benoit Goby <benoit@android.com>
* USB: remove duplicate out endpoint creation in MTP modePeter Oh2014-05-021-9/+0
| | | | | | | | | | | | | | | | | | Android MTP gadget uses 3 endpoints which are 1 in endpoint, 1 out endpoint, and 1 interrupt endpoint. However when MTP gadget creates its endpoints, it creates the out endpoint twice and overwrites the first created out endpoint with the second one, so that it causes a leak of endpoint resources. Change-Id: Iba82950095610b26b362f4b10a67cedfb1fee366 Signed-off-by: Peter Oh <poh@broadcom.com> Reviewed-on: http://mps-gerrit.broadcom.com/37744 Reviewed-by: Graham Williams <gwilli@broadcom.com> Reviewed-by: John Garry <jgarry@broadcom.com> Branch-Open: Branch Status <branch_status_noreply@broadcom.com> Reviewed-by: Checkpatch Status <checkpatch_status_noreply@broadcom.com> Reviewed-by: Joyjit Nath <joyjit@broadcom.com> Tested-by: AutoSubmit Status <autosubmit_status_noreply@broadcom.com>
* usb: gadget: android: 3.10 fixesArve Hjønnevåg2014-05-023-21/+58
| | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* usb: gadget: android: move init to late_initcall for nowArve Hjønnevåg2014-05-021-1/+1
| | | | | | gserial_alloc_line crashes when called from module_init Signed-off-by: Arve Hjønnevåg <arve@android.com>
* usb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.9Arve Hjønnevåg2014-05-021-8/+28
| | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* usb: gadget: Fix android gadget driver buildBenoit Goby2014-05-024-751/+43
| | | | | | | Removed obsolete f_adb function Change-Id: Idfb4110429bc0ea63f493c68ad667f49ca471987 Signed-off-by: Benoit Goby <benoit@android.com>
* HACK: usb: gadget: Fix enumeration on bootBenoit Goby2014-05-021-1/+9
| | | | | | | | | | | The Android gadget driver disconnects the gadget on bind and expects the gadget to stay disconnected until it calls usb_gadget_connect when userspace is ready. Removed the call to usb_gadget_connect in usb_gadget_probe_driver to avoid enabling the pullup before userspace is ready. Change-Id: I63707ac6e16a44eca52351a4bf80407d25fbd35e Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.8Arve Hjønnevåg2014-05-025-16/+10
| | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* usb: gadget: accessory: Fix section mismatch (again)Todd Poynor2014-05-021-1/+1
| | | | | | | | create_bulk_endpoints should not be __init since it is called when accessory is enabled. Change-Id: Iac6e9f29d53c93760e926efd8e7603432632acb4 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* usb: gadget: f_fs: Fix enumeration in fullspeed modeBenoit Goby2014-05-021-1/+6
| | | | | | | | | ffs_func_eps_enable always take the highspeed usb_endpoint_descriptor if it is available. Choose the correct usb_endpoint_descriptor depending on the gadget speed instead. Change-Id: I5b8444cfdf1b6fe1eef25525fb7a0a0f617a353e Signed-off-by: Benoit Goby <benoit@android.com>
* USB: gadget: f_audio_source: New gadget driver for audio outputMike Lockwood2014-05-022-0/+891
| | | | | | | | This driver presents a standard USB audio class interface to the host and an ALSA PCM device to userspace Change-Id: If16b14a5ff27045f9cb2daaf1ae9195c5eeab7d0 Signed-off-by: Mike Lockwood <lockwood@google.com>
* USB: gadget: f_accessory: Add support for HID input devicesMike Lockwood2014-05-022-8/+388
| | | | | Change-Id: I4f1452db32508382df52acdc47c0eb395ae328c7 Signed-off-by: Mike Lockwood <lockwood@google.com>
* USB: gadget: Add ACCESSORY_SET_AUDIO_MODE control request and ioctlMike Lockwood2014-05-021-1/+10
| | | | | | | | The control request will be used by the host to enable/disable USB audio and the ioctl will be used by userspace to read the audio mode Change-Id: I81c38611b588451e80eacdccc417ca6e11c60cab Signed-off-by: Mike Lockwood <lockwood@google.com>
* usb: gadget: Fix usb string id allocationBenoit Goby2014-05-022-1/+12
| | | | | | | | | Don't reset next_string_id every time the gadget is enabled, this makes the next strings allocated overwrite strings allocated at probe time. Instead, fix rndis not to allocate new string ids on every config bind. Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4 Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: accessory: Fix section mismatchBenoit Goby2014-05-021-1/+1
| | | | | | | | create_bulk_endpoints should not be __init since it is called when accessory is enabled Change-Id: If827a4531f0f6c15af938345163923186368e2a5 Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: android: Add FunctionFSBenoit Goby2014-05-021-4/+188
| | | | | | | | | | | | | | | | | Add support for FunctionFS (ffs) to implement usb functions in userspace. The aliases property stores the list of functions that are implemented using functionfs. For example: echo "adb,mtp" > /sys/class/android_usb/android0/f_ffs/aliases Then when the function are enabled: echo "adb,acm" > /sys/class/android_usb/android0/functions Internally, ffs and acm will be used. Change-Id: I44117b183d48a5a99ddbee3ef2cf8998be74598e Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: android: Fix product nameBenoit Goby2014-05-021-4/+1
| | | | | | | | Product names may contain spaces and scanf %s only matches the 1st word. Use strlcpy instead. Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0 Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: composite: Fix corruption when changing configurationBenoit Goby2014-05-021-4/+6
| | | | | | | | | Remove the config from the configs list before releasing the spinlock. Otherwise the other cpu might be processing a SET_CONFIGURATION that will switch to the configuration that is being released. Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: adb: Only enable the gadget when adbd is readyBenoit Goby2014-05-022-10/+118
| | | | | | | | | | | | | | | | | When adb is enabled, only connect the gadget when adbd is ready. If adbd dies or is restarted (e.g. "adb root"), the gadget is disconnected when the adb device is close, and it is re-connected once adb re-open the device. - Add callbacks to adb, similar to FunctionFs callbacks, to notify the gadget when the daemon is ready or closed. - Refcount calls to android_enable/android_disable to enable the gadget only once all the function daemons are ready. - Add enable/disble to android_usb_function to notify the function when it is added/removed from the list of enabled functions. Change-Id: Id54ff85aec9cf8715c94b4f9bd6137a79ad58bfc Signed-off-by: Benoit Goby <benoit@android.com>
* usb: gadget: adb: do not set error flag when dequeuing reqColin Cross2014-05-021-1/+1
| | | | | | | | When an ep_out req is dequeued because of userspace freezing, don't set the error flag. Change-Id: I680f1a1059b8ac2244aaa069e7d42dc44abf98e9 Signed-off-by: Colin Cross <ccross@android.com>
* usb: gadget: adb: allow freezing in adb_readColin Cross2014-05-021-1/+2
| | | | | | | | | | wait_event_interruptible in adb_read might return -ERESTARTSYS if userspace is frozen during adb_read or another signal is delivered to adb. If so, don't set dev->error to avoid resetting the adb connection. Change-Id: I5a7baa013a9a3a3b5305de7e6a0d18546a560018 Signed-off-by: Colin Cross <ccross@android.com>
* usb: gadget: accessory: Add Android Accessory functionBenoit Goby2014-05-022-0/+841
| | | | | | | | | | | | | USB accessory mode allows users to connect USB host hardware specifically designed for Android-powered devices. The accessories must adhere to the Android accessory protocol outlined in the http://accessories.android.com documentation. This allows Android devices that cannot act as a USB host to still interact with USB hardware. When an Android device is in USB accessory mode, the attached Android USB accessory acts as the host, provides power to the USB bus, and enumerates connected devices. Signed-off-by: Mike Lockwood <lockwood@android.com>
* usb: gadget: adb: Add ADB functionBenoit Goby2014-05-022-0/+640
| | | | | | | | | | Android Debug Bridge (adb) is a command line tool that lets users communicate with a Android-powered device. It is used mainly to debug applications and tranfer files. f_adb implements the transport layer between the ADB Server (on the host) and the ADBD daemon (on the device). Signed-off-by: Mike Lockwood <lockwood@android.com>
* usb: gadget: mtp: Add MTP/PTP functionBenoit Goby2014-05-022-0/+1349
| | | | | | | | | USB gadget function driver used by the Android framework to implement the MTP and PTP protocols. It creates a character device that provides an interface for fast transfer of files and supports transferring files greater than 4GB. Signed-off-by: Mike Lockwood <lockwood@android.com>
* usb: gadget: Add Android Composite Gadget driverBenoit Goby2014-05-023-0/+1087
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Android Gadget driver is a composite driver that allows userspace to change at runtime the list of functions enabled in its configuration and to configure these functions. It supports multiple functions: acm, adb, rndis, mtp/ptp, mass storage and accessory. It is usually controlled by a daemon that changes the configuration based on user settings. For example, rndis is enabled when the user enables sharing the phone data connection and adb (Android Debug Bridge) is only enabled when the user wants to debug applications for security reasons. As an example on how to use it, the following shell commands will make the gadget disconnect from the host and make it be re-enumerated as a composite with 1 rndis and 2 acm interfaces, and a different product id: echo 0 > /sys/class/android_usb/android0/enable echo rndis,acm > /sys/class/android_usb/android0/functions echo 2 > /sys/class/android_usb/android0/f_acm/instances echo 2d01 > /sys/class/android_usb/android0/idProduct echo 1 > /sys/class/android_usb/android0/enable The driver requires a gadget controller that supports software control of the D+ pullup and the controller driver must support disabling the pullup during composite_bind. Signed-off-by: Mike Lockwood <lockwood@android.com> Signed-off-by: Benoit Goby <benoit@android.com>
* Revert "Import Android gadget driver"Paul Kocialkowski2014-05-026-4819/+0
| | | | This reverts commit c51e7924d64de814cfdeff2b415ab6b721d49254.
* Revert "gadget/android.c: fix compilation on 3.11"Paul Kocialkowski2014-05-022-16/+6
| | | | This reverts commit 941b99efa3dd974009fbaa5e932825343d533f8a.
* Revert "Android Gadget: disable android_acm for now, to prevent kernel panic."Paul Kocialkowski2014-05-021-1/+1
| | | | This reverts commit d395bccb46686f961351d20d79b2e879d8650aec.
* Revert "usb: gadget: adb: Add ADB function"Paul Kocialkowski2014-05-022-639/+0
| | | | This reverts commit 85a5ad272ffb64067b8dd3c72a631c54169b6153.
* Revert "Android Gadget: make ADB work"Paul Kocialkowski2014-05-021-1/+1
| | | | This reverts commit 4f6caa8b5bda4c2d4103568bed5a25acf443924a.
* Merge branch 'suspend' into 3.12-replicant4H. Nikolaus Schaller2013-11-216-219/+161
|\
| * This is now Linux-3.12.0 for the GTA04!H. Nikolaus Schaller2013-11-043-218/+63
| |\ | | | | | | | | | Merge remote-tracking branch 'linus/master'
| | * USB: serial: ftdi_sio: add id for Z3X Box deviceАлексей Крамаренко2013-11-012-0/+7
| | | | | | | | | | | | | | | | | | | | | Custom VID/PID for Z3X Box device, popular tool for cellphone flashing. Signed-off-by: Alexey E. Kramarenko <alexeyk13@yandex.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "USB: pl2303: restrict the divisor based baud rate encoding method to ↵Greg Kroah-Hartman2013-11-011-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "HX" chip type" This reverts commit b8bdad608213caffa081a97d2e937e5fe08c4046. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: fix+improve the divsor based baud rate encoding method"Greg Kroah-Hartman2013-11-011-52/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 57ce61aad748ceaa08c859da04043ad7dae7c15e. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: do not round to the next nearest standard baud rate for ↵Greg Kroah-Hartman2013-11-011-37/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the divisor based baud rate encoding method" This reverts commit 75417d9f99f89ab241de69d7db15af5842b488c4. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: remove 500000 baud from the list of standard baud rates"Greg Kroah-Hartman2013-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b9208c721ce736125fe58d398319513a27850fd8. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: move the two baud rate encoding methods to separate ↵Greg Kroah-Hartman2013-11-011-114/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions" This reverts commit e917ba01d69ad705a4cd6a6c77538f55d84f5907. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: increase the allowed baud rate range for the divisor ↵Greg Kroah-Hartman2013-11-011-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | based encoding method" This reverts commit b5c16c6a031c52cc4b7dda6c3de46462fbc92eab. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Revert "usb: pl2303: also use the divisor based baud rate encoding method ↵Greg Kroah-Hartman2013-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for baud rates < 115200 with HX chips" This reverts commit 61fa8d694b8547894b57ea0d99d0120a58f6ebf8. Revert all of the pl2303 changes that went into 3.12-rc1 and -rc2 as they cause regressions on some versions of the chip. This will all be revisited for later kernel versions when we can figure out how to handle this in a way that does not break working devices. Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>