Snap for 12260156 from 686df57c05
to 24Q4-release
Change-Id: I9411adf588c56082f264ce5a2010175369ba41b9
This commit is contained in:
commit
5cfaad9d39
5 changed files with 33 additions and 0 deletions
|
@ -291,6 +291,7 @@ on property:sys.usb.config=charger && property:sys.usb.configfs=1
|
|||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi"
|
||||
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}
|
||||
write /sys/class/typec/port0/device/update_sdp_enum_timeout 0x1
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:ro.bootmode=usbuwb
|
||||
|
|
|
@ -49,6 +49,7 @@ constexpr char kTcpcDevName[] = "i2c-max77759tcpc";
|
|||
constexpr char kI2cClientId[] = "0025";
|
||||
constexpr char kAccessoryLimitCurrent[] = "usb_limit_accessory_current";
|
||||
constexpr char kAccessoryLimitCurrentEnable[] = "usb_limit_accessory_enable";
|
||||
constexpr char kUpdateSdpEnumTimeout[] = "update_sdp_enum_timeout";
|
||||
|
||||
UsbGadget::UsbGadget() : mGadgetIrqPath(""),
|
||||
mI2cClientPath("") {
|
||||
|
@ -103,6 +104,7 @@ Status UsbGadget::getUsbGadgetIrqPath() {
|
|||
void currentFunctionsAppliedCallback(bool functionsApplied, void *payload) {
|
||||
UsbGadget *gadget = (UsbGadget *)payload;
|
||||
gadget->mCurrentUsbFunctionsApplied = functionsApplied;
|
||||
gadget->updateSdpEnumTimeout();
|
||||
}
|
||||
|
||||
ScopedAStatus UsbGadget::getCurrentUsbFunctions(const shared_ptr<IUsbGadgetCallback> &callback,
|
||||
|
@ -369,6 +371,28 @@ ScopedAStatus UsbGadget::reset(const shared_ptr<IUsbGadgetCallback> &callback,
|
|||
return ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
void UsbGadget::updateSdpEnumTimeout() {
|
||||
string update_sdp_enum_timeout_path;
|
||||
|
||||
if (mI2cClientPath.empty()) {
|
||||
for (int i = 0; i < NUM_HSI2C_PATHS; ++i) {
|
||||
mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
|
||||
if (mI2cClientPath.empty()) {
|
||||
ALOGE("%s: Unable to locate i2c bus node", __func__);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update_sdp_enum_timeout_path = mI2cClientPath + kUpdateSdpEnumTimeout;
|
||||
if (!WriteStringToFile("1", update_sdp_enum_timeout_path)) {
|
||||
ALOGE("%s: Unable to write to %s.", __func__, update_sdp_enum_timeout_path.c_str());
|
||||
} else {
|
||||
ALOGI("%s: Updated SDP enumeration timeout value.", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
Status UsbGadget::setupFunctions(long functions,
|
||||
const shared_ptr<IUsbGadgetCallback> &callback, uint64_t timeout,
|
||||
int64_t in_transactionId) {
|
||||
|
@ -427,6 +451,7 @@ Status UsbGadget::setupFunctions(long functions,
|
|||
mCurrentUsbFunctionsApplied = true;
|
||||
if (callback)
|
||||
callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId);
|
||||
updateSdpEnumTimeout();
|
||||
return Status::SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,6 +115,9 @@ struct UsbGadget : public BnUsbGadget {
|
|||
|
||||
ScopedAStatus setVidPid(const char *vid,const char *pid);
|
||||
|
||||
// Indicates to the kernel that the gadget service is ready and the kernel can
|
||||
// set SDP timeout to a lower value.
|
||||
void updateSdpEnumTimeout();
|
||||
std::string mI2cClientPath;
|
||||
|
||||
private:
|
||||
|
|
|
@ -15,6 +15,7 @@ on post-fs
|
|||
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_current
|
||||
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable
|
||||
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable
|
||||
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/update_sdp_enum_timeout
|
||||
chown root graphics /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code
|
||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
|
||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
|
||||
|
@ -39,6 +40,7 @@ on post-fs
|
|||
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_current
|
||||
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable
|
||||
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable
|
||||
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/update_sdp_enum_timeout
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
|
||||
|
|
|
@ -15,6 +15,7 @@ on post-fs
|
|||
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
|
||||
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
|
||||
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
|
||||
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/update_sdp_enum_timeout
|
||||
chown root graphics /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code
|
||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
|
||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
|
||||
|
@ -39,6 +40,7 @@ on post-fs
|
|||
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
|
||||
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
|
||||
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
|
||||
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/update_sdp_enum_timeout
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
|
||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue