usb: Update Usb and UsbGadget i2c logic
Update the logic to find the i2c bus number to use either the named i2c
devices or the static i2c bus numbers. This allows us to support both
cases -- v5.10 uses i2c-<devname> while v6.1 uses <i2c-bus#>-<reg>.
Bug: 291606723
Test: verify no errors from the usb services with v5.10 and v6.1
Change-Id: I6d41ac041ead68e72a3766e03d491bcd478468d3
diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h
index a6b63bd..e483a91 100644
--- a/usb/gadget/UsbGadget.h
+++ b/usb/gadget/UsbGadget.h
@@ -119,7 +119,12 @@
// set SDP timeout to a lower value.
void updateSdpEnumTimeout();
+ int getI2cBusNumber();
+ std::string_view getI2cClientPath();
+
private:
+ int mI2cBusNumber;
+ std::string mI2cClientPath;
Status tearDownGadget();
Status getUsbGadgetIrqPath();
Status setupFunctions(long functions, const shared_ptr<IUsbGadgetCallback> &callback,