qpnp-smb2: Add software based glitch filter for OTG detection

When the USB_ID line is pulled low for a very short time there is a
possibility that the SW misses rising edge(removal) event. This may
lead to the state where charger is stuck in the boost-mode forever.

Fix this my adding a SW based glitch logic which checks for the
USB_ID after a SW debounce time and then notifies its presence/removal to
the USB driver.

CRs-Fixed: 2044958
Change-Id: I31974f7d68b435bbef329278cedbd726ada02e3f
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
4 files changed