soc: qcom: eud: Update the state of extcon too during probe

If EUD is enabled by the bootloader, currently the kernel driver
only enables the interrupts. However, the USB/extcon will still
see that the cable is disconnected as the EUD driver doesn't set
an initial state. Hence, explicitly set the state of the USB
as 'true' (connected) if the driver's probe realises that EUD
is already enabled by the bootloader.

Change-Id: I27c7fde4667c72698fa3da042361829a692792cc
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
This commit is contained in:
Raghavendra Rao Ananta 2020-08-25 11:16:21 -07:00
commit e9e0c0ecf2

View file

@ -717,6 +717,22 @@ static int msm_eud_probe(struct platform_device *pdev)
/* Proceed enable other EUD elements if bootloader has enabled it */
if (msm_eud_hw_is_enabled(pdev)) {
msm_eud_enable_irqs(chip);
/*
* Set the default cable state to usb connect and charger
* enable
*/
ret = extcon_set_state_sync(chip->extcon, EXTCON_USB, true);
if (ret)
dev_warn(&pdev->dev, "Failed to set EXTCON_USB (%d)\n",
ret);
ret = extcon_set_state_sync(chip->extcon,
EXTCON_CHG_USB_SDP, true);
if (ret)
dev_warn(&pdev->dev,
"Failed to set EXTCON_CHG_USB_SDP (%d)\n", ret);
enable = EUD_ENABLE_CMD;
}