Commit Graph

3 Commits

Author SHA1 Message Date
Winter Wang 46c313b694 init: usb: disable usb function switch until adbd is ready
In the case of adb enabled, When a usb function switch happens
e.g mtp,adb -> ptp,adb, framework will set sys.usb.config from
"mtp,adb" to "none" and stop adbd first.
At this time, the property "sys.usb.ffs.ready", which is set after
the ready of the perious start adbd, is still "1".
So , when framework goes on setting the sys.usb.config to "ptp,adb",
init.usb.configfs.rc will trigger actions to bind() f_fs without
waiting for adbd is actually ready.

This will produce some error messages:
------------
configfs-gadget ci_hdrc.0: failed to start g1: -19
init: write_file: Unable to write to '/config/usb_gadget/g1/UDC': No such device
------------
this error msg is caused by configFS start binding f_fs before adbd is ready.

Add setting the "sys.usb.ffs.ready" to "0" will help clear this error msg,
as the bind process in kernel gadget driver will wait for the set of
this property, which is the sign of adbd is ready.

Signed-off-by: Winter Wang <wente.wang@nxp.com>
2016-04-08 19:23:00 +08:00
Badhri Jagan Sridharan a6c377b2f6 init: usb: Add configfs commands for USB gadget
Adds init support for:
accessory
audio_source
midi
adb
rndis

Bug=23633457

Change-Id: I12e68e25969adafcf3170769f91ae939d08b7dbc
2015-09-08 20:13:37 -07:00
Badhri Jagan Sridharan e18018639b init: usb: Add init scripts for configfs commands
This CL adds a new init script init.usb.configfs.rc
to add generic configfs commands. Setting
sys.usb.configfs in init.usb.{hardware}.rc
enables executing commands in this script

Bug=23633457

Change-Id: Iaae844a7957d6c9bf510648aaff86d56aa0c6243
2015-09-01 15:39:22 -07:00