Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cb116a8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "extcon-usb-gpio: Schedule delayed work in probe for ethernet connection"

parents 8cfc2915 71275501
Loading
Loading
Loading
Loading
+7 −22
Original line number Diff line number Diff line
@@ -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,6 +211,11 @@ static int usb_extcon_probe(struct platform_device *pdev)
	platform_set_drvdata(pdev, info);
	device_init_wakeup(dev, true);

	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);