summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/android.c
AgeCommit message (Collapse)Author
2011-12-16Squashandroid-20111223Benn Pörscke
Change-Id: I2fcf46d1fc4b0cd4c61e5be3654c43b80db86015
2011-10-19Android : Ux500 : USB :Resetting the endpointsSakethram Bommisetti
USB endpoints are not being reset at the time of disabling the functions. Due to this, the endpoint data is not freed. So, during re-assignment of EP's for a new USB configuration, some of EP's are skipped. ST-Ericsson ID: 368396 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I6e5edaa88152ebc767534b1f8fd8f9cc99f18fff Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34357 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2011-10-14Android:Ux500:USB: Boot time detection of USBSakethram Bommisetti
Enabling the usb functions from kernel space rather that enabling from user space using init.rc. Sysfs values in kernel space are not being updated from user space at the time of enumeration during boottime. ST-Ericsson Linux next: NA ST-Ericsson ID: 363818 ST-Ericsson FOSS-OUT ID: NA Change-Id: Ia17e2f9cef5bb1769718617b18fafe09e32226e2 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33816 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2011-09-19USB:Composite Driver PatchSakethram Bommisetti
Added code for ECM. Mass Storage supports 2 luns by default. ST-Ericsson ID: 259958 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
2011-09-19Android: USB: Set android device power mode based on VBUSPhilippe Langlais
According to USB compliance, USB device can be self or bus powered based on the power it consumes from the Host. This patch adds the check before setting the device to self-powered. ST-Ericsson ID: 268507 Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com> Change-Id: I1241ba724ef00e782c527f95981b8011cf3479f8 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/11983 Reviewed-by: QATOOLS Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> Conflicts: drivers/usb/gadget/android.c
2011-06-17USB: gadget: f_mtp: Add PTP variant of MTP USB functionMike Lockwood
This is the same as MTP but with PTP interface descriptor. Also removed obsolete ioctl for switching between MTP and PTP mode Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-17usb: gadget: android: Update android gadget driverBenoit Goby
* Functions and the device descriptor are configured from user space: echo 0 > /sys/class/android_usb/android0/enable echo adb,acm > /sys/class/android_usb/android0/functions echo 2 > /sys/class/android_usb/android0/f_acm/instances echo 1 > /sys/class/android_usb/android0/enable * Driver does not require platform data anymore * Moved function initialization to android.c instead of each function file * Replaced switches by uevents Signed-off-by: Benoit Goby <benoit@android.com> Signed-off-by: Mike Lockwood <lockwood@android.com> Change-Id: If5ad9267c111ad0a442f0d87a0d31082dc5381b6
2011-06-17USB: gadget: f_accessory: New gadget driver for android USB accesoriesMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Misc improvements and cleanup: - Add URI string - Replace type string with a description string - Add a control call to retrieve accessory protocol version (currently 1) - Driver read() and write() calls now fail after USB disconnect until driver file is closed and reopened. - Misc cleanup work Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Clear accessory strings when USB is disconnected Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Clear previous strings on ACCESSORY_GET_PROTOCOL Clearing strings on disconnect does not work since we may receive a disconnect on some devices when transitioning into accessory mode. We require an accessory to send ACCESSORY_GET_PROTOCOL before sending any strings, so any strings from a previous session will be cleared. Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Clear disconnected flag when driver file is opened Fixes a race condition that can occur when entering accessory mode. Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Add string for accessory's unique serial number Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_accessory: Set bNumEndpoints to correct value of 2 Change-Id: I24f4e36f196d45436e0573301500c3b93215953d Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: Fix problem switching vendor IDsMike Lockwood
We need to update the vendor ID in the composite driver as well Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: Support switching vendor ID when configuration changesMike Lockwood
Based on the list of enabled USB functions, we can now switch the vendor ID as well as the product ID. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14usb: gadget: android: fix compilation on 2.6.37Dima Zavin
Change-Id: I9a99f007415c5be1bd1a86b138486eac51784e0d Signed-off-by: Dima Zavin <dima@android.com>
2011-06-14USB: gadget: android Fix gadget descriptor compliance for IAD'sJohn Michelau
USB-IF core team mandates that composite devices containing IAD's must use bDeviceClass=0xEF, bDeviceSubClass=0x02, & bDeviceProtocol=0x01 instead of the usual 0x00 in all fields. This is not a problem currently on Linux hosts, but it is a problem when connecting to Windows hosts. Without this change the default Microsoft composite driver will not group interfaces properly, which is what allows child function drivers with IAD's to load correctly. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14usb: gadget: Fixed Android gadget function discovery & product matchingJohn Michelau
- Don't bind until all required functions have registered - Consider multi-instance functions when matching products Change-Id: I6fa10567db71d49cd81968c01d75e326ff9a17c8 Signed-off-by: John Michelau <john.michelau@motorola.com>
2011-06-14usb: gadget: android: Remove WAKEUP flag from bmAttributesBenoit Goby
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>
2011-06-14USB: gadget: android: Disable MTP when RNDIS function is enabled.Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14drivers: usb: gadget: Fix section mismatch warningDmitry Shmidt
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-06-14USB: composite: Add usb_composite_force_reset utility to force enumerationMike Lockwood
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>
2011-06-14USB: gadget: android: Remove unused function android_usb_set_connected()Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: composite: Add userspace notifications for USB state changesMike Lockwood
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>
2011-06-14USB: gadget: android: check for null _android_dev in android_register_function()Mike Lockwood
This fixes a load ordering issue that occurred if a function driver loads before the android gadget driver is initialized. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: Disable UMS when RNDIS ethernet is active.Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14Add USB_ANDROID_RNDIS_WCEIS option.Steve Kondik
Change-Id: I85973ebfcbfae6b401fb8b402842309c72655149 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: Fix special case for RNDIS ethernet functionMike Lockwood
Only set device descriptor bDeviceClass field to USB_CLASS_COMM when the RNDIS function is actually enabled. Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: Specify USB_CLASS_COMM in device descriptor if using RNDISMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: android: Use composite class driver for enabling and disabling functionsMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: android USB gadget improvements:Mike Lockwood
usb: gadget: f_mass_storage: use dev_set_name() Replacing strcpy() to device->bus_id which no longer exists in 2.6.32 Change-Id: Id978c881f457044c750bfd62f4c5bcc35bcd4fc5 Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_adb: Claim endpoints so they are not reused by another function. Change-Id: Ic9536cca800162e701c81cab36054f51ea759b72 Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_acm: Fix crashes in acm_set_alt() Change-Id: I91b761d392f8b1ca8784c69069b43e402b90d6a4 Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: f_acm: Include android code only if CONFIG_USB_ANDROID_ACM is set. Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: Android support for RNDIS serial ethernet function. Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: android: Add function name to android_register_function printk. Change-Id: I38bf79d9b544cdeaec9385f7482a131417fc4b23 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14USB: gadget: android: android USB gadget improvements:Krishna, Vamsi
USB: android gadget: add remote wakeup attribute to android function Add remote wakeup attribute to configuration descriptor of android function to advertise remote wakeup capability to host Acked-by: Allam, Suresh Reddy <sallam@qualcomm.com> Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: android: Allow functions to handle setup requests. Signed-off-by: Mike Lockwood <lockwood@android.com> Support for specifying the list of USB functions from platform data. The main android.c gadget driver no longer has hard coded references to the mass_storage and adb functions. Support for computing the product ID based on tables in platform data and the currently enabled functions. Moved the adb enable/disable logic from android.c to f_adb.c. Change-Id: I6259d3fb1473ed973f700e55d17744956f3527bb Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-14android_usb: Composite USB gadget driver for android.Mike Lockwood
Change-Id: I4101540916b73a5f4e48684727ff782f98b969c7 Signed-off-by: Mike Lockwood <lockwood@android.com> USB: android gadget: add remote wakeup attribute to android function Add remote wakeup attribute to configuration descriptor of android function to advertise remote wakeup capability to host Acked-by: Allam, Suresh Reddy <sallam@qualcomm.com> Signed-off-by: Mike Lockwood <lockwood@android.com> usb gadget: link fixes for android composite gadget Signed-off-by: Mike Lockwood <lockwood@android.com> usb gadget: Fix null pointer errors in android composite driver Signed-off-by: Mike Lockwood <lockwood@android.com> usb: gadget: android: Allow usb charging to draw up to 500mA instead of 250. Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> usb gadget: android: Add helper function for usb_gadget_connect and disconnect. Signed-off-by: Mike Lockwood <lockwood@android.com> drivers: usb: gadget: call switch_dev_unregister in mass storage unbind callback This fixes a problem unloading the android gadget driver when built as a module Signed-off-by: Mike Lockwood <lockwood@android.com> usb: gadget: android: Add dependency on switch driver. Signed-off-by: Mike Lockwood <lockwood@android.com> USB: gadget: android: Fix USB WHQL Certification Issues Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com> Signed-off-by: Jared Suttles <jared.suttles@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com> drivers: usb: gadget: Add "usb_mass_storage" platform driver. This will be used for configuring vendor, product and release from board file. Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com> Signed-off-by: Jared Suttles <jared.suttles@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com> drivers: usb: gadget: Use usb_mass_storage platform device as parent for lun If a platform device is specified for the f_mass_storage function, use it as the parent driver for the lun files in sysfs. This allows a platform independent file path for controlling USB mass storage from user space. Signed-off-by: Mike Lockwood <lockwood@android.com> drivers: usb: gadget: Add platform data struct for usb_mass_storage device Signed-off-by: Mike Lockwood <lockwood@android.com> usb: gadget: mass_storage: Fix Mass Storage Panic during PC reboot Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com> Signed-off-by: Jared Suttles <jared.suttles@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com> usb: gadget: f_mass_storage: Handle setup request correctly Signed-off-by: Mike Lockwood <lockwood@android.com> usb: gadget: f_mass_storage: Clean up wakelocks on error paths Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> Signed-off-by: Mike Lockwood <lockwood@android.com>