History log of /drivers/usb/gadget/android.c
Revision Date Author Comments
289604826b08179d25455cac86b670c3a4194aca 11-May-2012 Mike Lockwood <lockwood@google.com> USB: gadget: f_audio_source: New gadget driver for audio output

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>
e40c16728ebd5af8992a90907fac99101e56e918 26-Mar-2012 Mike Lockwood <lockwood@google.com> USB: gadget: f_accessory: Add support for HID input devices

Change-Id: I4f1452db32508382df52acdc47c0eb395ae328c7
Signed-off-by: Mike Lockwood <lockwood@google.com>
8535ba66c9be82c52c19c014427e9dae4f2290e3 20-Jan-2012 Benoit Goby <benoit@android.com> usb: gadget: Fix usb string id allocation

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>
49c5e7668f29fddec74fec8504bdf6d9916a94d8 30-Mar-2012 Benoit Goby <benoit@android.com> usb: gadget: android: Add FunctionFS

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>
dcefb2ee8d412a6fab43aabd4fb5668aab12ce04 29-May-2012 Benoit Goby <benoit@android.com> usb: gadget: android: Fix product name

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>
80ba14d22262dc9e21b0220925b493d38d8ab060 20-Mar-2012 Benoit Goby <benoit@android.com> usb: gadget: adb: Only enable the gadget when adbd is ready

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>
cf3fc0646ba03b69a9c18bd430c10e20f25fecce 19-Dec-2011 Benoit Goby <benoit@android.com> usb: gadget: accessory: Add Android Accessory function

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>
2b6862d1abb91b61c0c73fc0808e3d7d0141feea 19-Dec-2011 Benoit Goby <benoit@android.com> usb: gadget: adb: Add ADB function

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>
f0fbc48125af7f02d1582e514f5b97a64266e643 19-Dec-2011 Benoit Goby <benoit@android.com> usb: gadget: mtp: Add MTP/PTP function

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>
1e8ce155ca4507b2644d005d6b2b9e29b133881c 12-Dec-2011 Benoit Goby <benoit@android.com> usb: gadget: Add Android Composite Gadget driver

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>