• JC Kuo's avatar
    usb: xhci: tegra: Unlink power domain devices · 41a7426d
    JC Kuo authored
    This commit unlinks xhci-tegra platform device with SS/host power
    domain devices. Reasons for this change is - at ELPG entry, PHY
    sleepwalk and wake configuration need to be done before powering
    down SS/host partitions, and PHY need be powered off after powering
    down SS/host partitions. Sequence looks like roughly below:
    
      tegra_xusb_enter_elpg() -> xhci_suspend()
                              -> enable PHY sleepwalk and wake if needed
                              -> power down SS/host partitions
                              -> power down PHY
    
    If SS/host power domains are linked to xhci-tegra platform device, we
    are not able to perform the sequence like above.
    
    This commit introduces:
      1. tegra_xusb_unpowergate_partitions() to power up SS and host
         partitions together. If SS/host power domain devices are
         available, it invokes pm_runtime_get_sync() to request power
         driver to power up partitions; If power domain devices are not
         available, tegra_powergate_sequence_power_up() will be used to
         power up partitions.
    
      2. tegra_xusb_powergate_partitions() to power down SS and host
         partitions together. If SS/host power domain devices are
         available, it invokes pm_runtime_put_sync() to request power
         driver to power down partitions; If power domain devices are not
         available, tegra_powergate_power_off() will be used to power down
         partitions.
    Signed-off-by: default avatarJC Kuo <jckuo@nvidia.com>
    Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    41a7426d
xhci-tegra.c 51.7 KB