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

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

Merge "usb: msm: Add support for the HUB reset for the synopsys core"

parents c349462a 85503c70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ Optional properties :
  after USB is kept into LPM.
- qcom,vbus-present: Indicates that there is no VBUS indication from PMIC. Assume VBUS is
  present if this property is defined.
- qcom,ext-hub-reset-gpio: This corresponds to gpio which is used for HUB reset.
Sub nodes:
- Sub node for "DWC3- USB3 controller".
  This sub node is required property for device node. The properties of this subnode
+18 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <linux/delay.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/usb/ch9.h>
@@ -2024,6 +2025,7 @@ static int dwc3_msm_probe(struct platform_device *pdev)
	u32 tmp;
	bool host_mode;
	int ret = 0;
	int ext_hub_reset_gpio;

	mdwc = devm_kzalloc(&pdev->dev, sizeof(*mdwc), GFP_KERNEL);
	if (!mdwc) {
@@ -2292,6 +2294,22 @@ static int dwc3_msm_probe(struct platform_device *pdev)
		}
	}

	ext_hub_reset_gpio = of_get_named_gpio(node,
					"qcom,ext-hub-reset-gpio", 0);

	if (gpio_is_valid(ext_hub_reset_gpio)
		&& (!devm_gpio_request(&pdev->dev, ext_hub_reset_gpio,
			"qcom,ext-hub-reset-gpio"))) {
		/* reset external hub */
		gpio_direction_output(ext_hub_reset_gpio, 1);
		/*
		 * Hub reset should be asserted for minimum 5microsec
		 * before deasserting.
		 */
		usleep_range(5, 1000);
		gpio_direction_output(ext_hub_reset_gpio, 0);
	}

	if (of_property_read_u32(node, "qcom,dwc-usb3-msm-tx-fifo-size",
				 &mdwc->tx_fifo_size))
		dev_err(&pdev->dev,