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

Commit c74ad097 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: xhci: Power up/down SS phy upon bus suspend/resume"

parents 8263b55d 23f8fe7c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3795,6 +3795,7 @@ static int dwc3_msm_host_notifier(struct notifier_block *nb,
				 * ss phy to avoid turning on pipe clock during
				 * these wake-ups.
				 */
				mdwc->ss_phy->flags |= PHY_WAKEUP_WA_EN;
				usb_phy_powerdown(mdwc->ss_phy);

				/*
@@ -3813,6 +3814,7 @@ static int dwc3_msm_host_notifier(struct notifier_block *nb,
			}
		} else {
			usb_phy_powerup(mdwc->ss_phy);
			mdwc->ss_phy->flags &= ~PHY_WAKEUP_WA_EN;
			/* set rate back to default core clk rate */
			clk_set_rate(mdwc->core_clk, mdwc->core_clk_rate);
			dev_dbg(mdwc->dev, "set core clk rate %ld\n",
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/gfp.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
#include <linux/usb/phy.h>

#include "xhci.h"
#include "xhci-trace.h"
@@ -945,6 +946,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
			spin_lock_irqsave(&xhci->lock, flags);

			if (time_left) {
				usb_phy_powerdown(hcd->usb3_phy);
				slot_id = xhci_find_slot_id_by_port(hcd,
						xhci, wIndex + 1);
				if (!slot_id) {
@@ -1310,6 +1312,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
			/* unlock to execute stop endpoint commands */
			spin_unlock_irqrestore(&xhci->lock, flags);
			xhci_stop_device(xhci, slot_id, 1);
			usb_phy_powerup(hcd->usb3_phy);
			spin_lock_irqsave(&xhci->lock, flags);

			xhci_set_link_state(xhci, port_array, wIndex, XDEV_U3);
@@ -1515,6 +1518,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
				spin_lock_irqsave(&xhci->lock, flags);
				xhci_set_link_state(xhci, port_array, wIndex,
							XDEV_U0);
				usb_phy_powerdown(hcd->usb3_phy);
				clear_bit(wIndex, &bus_state->resuming_ports);
			}
			bus_state->port_c_suspend |= 1 << wIndex;
+11 −1
Original line number Diff line number Diff line
@@ -347,7 +347,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
	if (device_property_read_u32(&pdev->dev, "usb-core-id", &xhci->core_id))
		xhci->core_id = -EINVAL;

	hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
	hcd->usb_phy = devm_usb_get_phy_by_phandle(pdev->dev.parent, "usb-phy",
			0);
	if (IS_ERR(hcd->usb_phy)) {
		ret = PTR_ERR(hcd->usb_phy);
		if (ret == -EPROBE_DEFER)
@@ -359,6 +360,15 @@ static int xhci_plat_probe(struct platform_device *pdev)
			goto put_usb3_hcd;
	}

	hcd->usb3_phy = devm_usb_get_phy_by_phandle(pdev->dev.parent, "usb-phy",
			1);
	if (IS_ERR(hcd->usb3_phy)) {
		ret = PTR_ERR(hcd->usb3_phy);
		if (ret == -EPROBE_DEFER)
			goto put_usb3_hcd;
		hcd->usb3_phy = NULL;
	}

	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
	if (ret)
		goto disable_usb_phy;
+9 −0
Original line number Diff line number Diff line
@@ -853,6 +853,15 @@ static int msm_ssphy_qmp_powerup(struct usb_phy *uphy, bool powerup)
	u8 reg = powerup ? 1 : 0;
	u8 temp;

	if (!(uphy->flags & PHY_WAKEUP_WA_EN))
		return 0;

	temp = readl_relaxed(phy->base +
			phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);

	if (temp == powerup)
		return 0;

	writel_relaxed(reg,
			phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
	temp = readl_relaxed(phy->base +
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ struct usb_hcd {
	 * other external phys should be software-transparent
	 */
	struct usb_phy		*usb_phy;
	struct usb_phy		*usb3_phy;
	struct phy		*phy;

	/* Flags that need to be manipulated atomically because they can
Loading