mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-01-27 18:19:03 +00:00
Mount ptp separately from mtp
Ptp is now mounted in its own directory so the mtp endpoint does not need to be closed to write the ptp descriptors. Bug: 72877174 Test: switch config to mtp/ptp Change-Id: I9cec66eeb882fbf23851cdaf2e3906e8b3150b0a
This commit is contained in:
@@ -30,6 +30,7 @@ on early-boot
|
||||
mkdir /config/usb_gadget/g1/functions/midi.gs5
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.adb
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.mtp
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.ptp
|
||||
mkdir /config/usb_gadget/g1/functions/diag.diag
|
||||
mkdir /config/usb_gadget/g1/functions/cser.dun.0
|
||||
mkdir /config/usb_gadget/g1/functions/cser.nmea.1
|
||||
@@ -44,9 +45,9 @@ on early-boot
|
||||
mkdir /dev/usb-ffs/adb 0770 shell shell
|
||||
mount functionfs adb /dev/usb-ffs/adb rmode=0770,fmode=0660,uid=2000,gid=2000
|
||||
mkdir /dev/usb-ffs/mtp 0770 mtp mtp
|
||||
mkdir /dev/usb-ffs/ptp 0770 mtp mtp
|
||||
mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
|
||||
setprop sys.usb.ffs.max_write 524288
|
||||
setprop sys.usb.ffs.max_read 524288
|
||||
mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
|
||||
setprop sys.usb.mtp.device_type 3
|
||||
setprop sys.usb.controller "a800000.dwc3"
|
||||
write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"
|
||||
|
||||
@@ -335,8 +335,7 @@ V1_0::Status UsbGadget::setupFunctions(
|
||||
int i = 0;
|
||||
std::string bootMode = GetProperty(PERSISTENT_BOOT_MODE, "");
|
||||
|
||||
if (((functions & GadgetFunction::PTP) != 0) ||
|
||||
((functions & GadgetFunction::MTP) != 0)) {
|
||||
if (((functions & GadgetFunction::MTP) != 0)) {
|
||||
ffsEnabled = true;
|
||||
ALOGI("setCurrentUsbFunctions mtp");
|
||||
if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR;
|
||||
@@ -351,6 +350,21 @@ V1_0::Status UsbGadget::setupFunctions(
|
||||
mEndpointList.push_back("/dev/usb-ffs/mtp/ep1");
|
||||
mEndpointList.push_back("/dev/usb-ffs/mtp/ep2");
|
||||
mEndpointList.push_back("/dev/usb-ffs/mtp/ep3");
|
||||
} else if (((functions & GadgetFunction::PTP) != 0)) {
|
||||
ffsEnabled = true;
|
||||
ALOGI("setCurrentUsbFunctions ptp");
|
||||
if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR;
|
||||
|
||||
if (inotify_add_watch(inotifyFd, "/dev/usb-ffs/ptp/", IN_ALL_EVENTS) == -1)
|
||||
return Status::ERROR;
|
||||
|
||||
|
||||
if (linkFunction("ffs.ptp", i++)) return Status::ERROR;
|
||||
|
||||
// Add endpoints to be monitored.
|
||||
mEndpointList.push_back("/dev/usb-ffs/ptp/ep1");
|
||||
mEndpointList.push_back("/dev/usb-ffs/ptp/ep2");
|
||||
mEndpointList.push_back("/dev/usb-ffs/ptp/ep3");
|
||||
}
|
||||
|
||||
if ((functions & GadgetFunction::MIDI) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user