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

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

Merge "dock: msm: Moved Ethernet reset and HUB reset to be optional"

parents 76719c46 23f6d9a6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -11,12 +11,12 @@ Required properties:
	       also supported but deprecated.
 - qcom,dock-detect-gpio: phandle to a GPIO node corresponding to the input
                         signal indicating when the dock is connected
 - qcom,dock-hub-reset-gpio: phandle to a GPIO node corresponding to the output
                            signal that resets the USB ports
 - qcom,dock-eth-reset-gpio: phandle to a GPIO node corresponding to the output
                            signal that resets the Ethernet ports
 - qcom,usb-host: phandle to the USB host controller connected to the dock port

Optional properties:
 - qcom,dock-enable-gpio: phandle to a GPIO node corresponding to the output
                         signal that turns on/off power to the ports
 - qcom,dock-hub-reset-gpio: phandle to a GPIO node corresponding to the output
                            signal that resets the USB ports
 - qcom,dock-eth-reset-gpio: phandle to a GPIO node corresponding to the output
                            signal that resets the Ethernet ports
+19 −15
Original line number Diff line number Diff line
@@ -82,7 +82,9 @@ static void dock_detected_work(struct work_struct *w)

	if (docked) {
		/* assert RESETs before turning on power */
		if (dock->dock_hub_reset >= 0)
			gpio_direction_output(dock->dock_hub_reset, 1);
		if (dock->dock_eth_reset >= 0)
			gpio_direction_output(dock->dock_eth_reset, 1);

		if (device_attach(&dock->usb3_pdev->dev) != 1) {
@@ -95,7 +97,9 @@ static void dock_detected_work(struct work_struct *w)
			gpio_direction_output(dock->dock_enable, 1);

		msleep(20); /* short delay before de-asserting RESETs */
		if (dock->dock_hub_reset >= 0)
			gpio_direction_output(dock->dock_hub_reset, 0);
		if (dock->dock_eth_reset >= 0)
			gpio_direction_output(dock->dock_eth_reset, 0);
	} else {
		device_release_driver(&dock->usb3_pdev->dev);
@@ -153,25 +157,25 @@ static int liquid_dock_probe(struct platform_device *pdev)
						 "qcom,dock-hub-reset-gpio", 0);
	if (dock->dock_hub_reset < 0) {
		dev_err(dock->dev, "unable to get dock-hub-reset-gpio\n");
		return dock->dock_hub_reset;
	}

	} else {
	    ret = devm_gpio_request(dock->dev, dock->dock_hub_reset,
				    "dock_hub_reset");
	    if (ret)
			return ret;
	}

	dock->dock_eth_reset = of_get_named_gpio(node,
						 "qcom,dock-eth-reset-gpio", 0);
	if (dock->dock_eth_reset < 0) {
		dev_err(dock->dev, "unable to get dock-eth-reset-gpio\n");
		return dock->dock_eth_reset;
	}

	} else {
	    ret = devm_gpio_request(dock->dev, dock->dock_eth_reset,
				    "dock_eth_reset");
	    if (ret)
			return ret;
	}



	dock->dock_enable = of_get_named_gpio(node, "qcom,dock-enable-gpio", 0);
	if (dock->dock_enable < 0) { /* optional */