am a6c377b2: init: usb: Add configfs commands for USB gadget
* commit 'a6c377b2f62175d6d5268c63885de3d882edbe2b': init: usb: Add configfs commands for USB gadget
This commit is contained in:
commit
c939c61c71
|
@ -2,15 +2,27 @@ on property:sys.usb.config=none && property:sys.usb.configfs=1
|
|||
write /config/usb_gadget/g1/UDC "none"
|
||||
stop adbd
|
||||
write /config/usb_gadget/g1/bDeviceClass 0
|
||||
write /config/usb_gadget/g1/bDeviceSubClass 0
|
||||
write /config/usb_gadget/g1/bDeviceProtocol 0
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
|
||||
rmdir /config/usb_gadget/g1/configs/b.1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ffs1"
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
@ -19,24 +31,20 @@ on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
|
|||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
|
||||
rmdir /config/usb_gadget/g1/configs/b.1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ffs1"
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=ptp && property:sys.usb.configfs=1
|
||||
rmdir /config/usb_gadget/g1/configs/b.1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ffs1"
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
@ -45,13 +53,123 @@ on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
|
|||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
|
||||
rmdir /config/usb_gadget/g1/configs/b.1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ffs1"
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=accessory && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/audio_source.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/audio_source.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=midi && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
|
Loading…
Reference in New Issue