Letux Kernel

Issue 473: Android usb gadget

Reported by Nikolaus Schaller, Jul 31, 2013

Android needs some USB gadget driver for ADB:

drivers/usb/gadget/android.c

Comment 1 by Nikolaus Schaller, Aug 2, 2013

This appears to be the latest source for this gadget:

https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3
.4/drivers/usb/gadget/android.c

We also need some Kconfig/Makefile patch...

And configure "CONFIG_USB_G_ANDROID"

Comment 2 by Nikolaus Schaller, Aug 2, 2013

Well, this is not sufficient...

The android.c file consists of a ladder of #include 
"f_something.c".

This means these files have to be added as well!

Comment 3 by Nikolaus Schaller, Aug 2, 2013

According to:

http://elinux.org/Android_Mainlining_Project

there has been some work, and there was already some code in Linux 
3.5 - 3.9 for a ccg (Configurable Composite Gadget - reincarnation 
of Android Composite Gadget):

http://lxr.free-electrons.com/source/drivers/staging/ccg/?v=3.9

It is not immediately clear what happened to it in 3.10/3.11.

Comment 4 by Nikolaus Schaller, Aug 2, 2013

Marek wrote:
Unfortunately it was removed (in 3.10 probably):

https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commi
t/?h=staging-next&id=ad76663264f5237a79fd000c95970360dcac7073

Comment 5 by Nikolaus Schaller, Aug 3, 2013

The initial Configurable Composite Gadget from Linux 3.5 has been 
added to the code, but not yet been tested.

To configure it, one must unconfigure the other gadgets (mainly the 
usb-ethernet gadget).

Comment 6 by Nikolaus Schaller, Oct 1, 2013

The ccg has now been removed because there appears to be a better 
patch from Linaro that is compatible to the Android sysfs node names.
Labels: Milestone:3.12
Owner: slyon

Comment 7 by Lukas M, Oct 27, 2013

I've now integrated the ADB driver from the official AOSP 3.10 
kernel tree:
https://android.googlesource.com/kernel/common/+log/experimental/andr
oid-3.10/drivers/usb/gadget/android.c

Our 3.12-wip-replicant4 kernel now boots to the Android UI and it is 
possible to connect with "adb shell" from the host.
Status: Fixed

Comment 8 by Lukas M, Nov 22, 2013

Here is a VERY interesting comment by John Stultz, that it is 
possible to use adb via the FunctionFS driver, which is already part 
of the mainline Linux. It is not as flexible as the original adb 
driver, though.
https://plus.google.com/111524780435806926688/posts/AaEccFjKNHE

Progress is tracked here:
https://blueprints.launchpad.net/linux-linaro/+spec/android-adb-upstr
eaming

Created: 10 years 8 months ago by Nikolaus Schaller

Updated: 10 years 4 months ago

Status: Fixed

Owner: Lukas M

Labels:
Type:Enhancement
Priority:Critical
Milestone:3.12