soc/tegra: pmc: Move powergate initialisation to probe
authorJon Hunter <jonathanh@nvidia.com>
Tue, 16 Apr 2019 16:48:08 +0000 (17:48 +0100)
committerThierry Reding <treding@nvidia.com>
Wed, 17 Apr 2019 08:32:33 +0000 (10:32 +0200)
commit6ac2a01de1700c1b6d889f02f61c4c9602573a8d
treef68fbc16fd4c80f1ffce1e46eeaad1405bc3ba01
parenta46b51cd2a57d52d5047e1d48240536243eeab34
soc/tegra: pmc: Move powergate initialisation to probe

Commit 8df127456f29 ("soc/tegra: pmc: Enable XUSB partitions on boot")
was added as a workaround to ensure that the XUSB powergates or domains
were turned on early during boot because as this time the Tegra XHCI
driver did not handle the power domains at all. Now that the Tegra XHCI
driver has been updated to properly managed the power domains, the
workaround to enable the XUSB power domain early has been removed. This
also means that we can now move the initialisation of the powergates
into the PMC driver probe. Therefore, move the powergate initialisation
into the PMC driver probe and return any errors detected. To handle any
errors, functions to cleanup and remove any power-domains registered
with the generic power-domain framework have been added.

Finally the initialisation of the 'powergates_available' bitmask is kept
in the PMC early init function to allow the legacy PMC powergate APIs to
be called during early boot for enabling secondary CPUs on 32-bit Tegra
devices.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c