]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: xhci: tegra: Enable ELPG for runtime/system PM
authorJC Kuo <jckuo@nvidia.com>
Wed, 20 Jan 2021 07:34:14 +0000 (15:34 +0800)
committerThierry Reding <treding@nvidia.com>
Thu, 1 Apr 2021 12:44:04 +0000 (14:44 +0200)
commitd64d362f1d8b5da18da24b8209c9a42e435a9756
treed5a6a30e115e587dede8070e702fb49698612978
parentf262f3fa3a22ce59c812365ade7828909f66d785
usb: xhci: tegra: Enable ELPG for runtime/system PM

This commit implements the complete programming sequence for ELPG
entry and exit.

 1. At ELPG entry, invokes tegra_xusb_padctl_enable_phy_sleepwalk()
    and tegra_xusb_padctl_enable_phy_wake() to configure XUSB PADCTL
    sleepwalk and wake detection circuits to maintain USB lines level
    and respond to wake events (wake-on-connect, wake-on-disconnect,
    device-initiated-wake).

 2. At ELPG exit, invokes tegra_xusb_padctl_disable_phy_sleepwalk()
    and tegra_xusb_padctl_disable_phy_wake() to disarm sleepwalk and
    wake detection circuits.

At runtime suspend, XUSB host controller can enter ELPG to reduce
power consumption. When XUSB PADCTL wake detection circuit detects
a wake event, an interrupt will be raised. xhci-tegra driver then
will invoke pm_runtime_resume() for xhci-tegra.

Runtime resume could also be triggered by protocol drivers, this is
the host-initiated-wake event. At runtime resume, xhci-tegra driver
brings XUSB host controller out of ELPG to handle the wake events.

The same ELPG enter/exit procedure will be performed for system
suspend/resume path so USB devices can remain connected across SC7.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/usb/host/xhci-tegra.c