extcon-usb-gpio: Schedule delayed work in probe for ethernet connection
Schedule work with delay in probe() so that GPIO can toggled to reset ethernet bridge after host mode start. Or else ethernet network device is not detected on some platforms having onboard ethernet bridge. Change-Id: Ia8369133206c69320ed95c3a7523dcc6e2667894 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
parent
a7306e9161
commit
7127550173
1 changed files with 7 additions and 22 deletions
|
|
@ -117,7 +117,6 @@ static int usb_extcon_probe(struct platform_device *pdev)
|
|||
struct device_node *np = dev->of_node;
|
||||
struct usb_extcon_info *info;
|
||||
int ret;
|
||||
const char *name = NULL;
|
||||
|
||||
if (!np && !ACPI_HANDLE(dev))
|
||||
return -EINVAL;
|
||||
|
|
@ -159,25 +158,6 @@ static int usb_extcon_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (info->trig_gpiod) {
|
||||
ret = of_property_read_string_index(np, "gpio-names", 0, &name);
|
||||
if (ret) {
|
||||
dev_err(dev, "Could not get gpio name\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = gpiod_export(info->trig_gpiod, 0);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to export gpio\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = gpiod_export_link(dev, name, info->trig_gpiod);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to export gpio link\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
if (info->id_gpiod)
|
||||
ret = gpiod_set_debounce(info->id_gpiod,
|
||||
USB_GPIO_DEBOUNCE_MS * 1000);
|
||||
|
|
@ -231,8 +211,13 @@ static int usb_extcon_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, info);
|
||||
device_init_wakeup(dev, true);
|
||||
|
||||
/* Perform initial detection */
|
||||
usb_extcon_detect_cable(&info->wq_detcable.work);
|
||||
if (info->trig_gpiod)
|
||||
/* Schedule with delay to reset ethernet bridge */
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&info->wq_detcable, msecs_to_jiffies(1500));
|
||||
else
|
||||
/* Perform initial detection */
|
||||
usb_extcon_detect_cable(&info->wq_detcable.work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue