UsbGadget: Update SDP enum timeout when gadget is pulled up

Indicate to the kernel that the usb gadget is pulled up
by writing to `update_sdp_enum_timeout` sysfs node. Write
to this node will inform the kernel that it can lower the SDP
timeout alarm value which is used to detect an SDP port
vs a DCP.

Bug:356685367
Test: Check `update_sdp_enum_timeout` is written into after usb
      gadget is pulled up. Verify that the alarm timeout lowers.
Flag: EXEMPT bugfix
Change-Id: Id3ae7e7a20b236cec6604414a7f81860e868bdd0
(ported from commit d8e2a02998fc1db9be00dab69a213378fb3caede)
Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
This commit is contained in:
Amit Sunil Dhamne 2024-08-16 00:46:36 -07:00
parent e0f64c3efd
commit 7f688ffd28
4 changed files with 32 additions and 0 deletions

View file

@ -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: