]> git.baikalelectronics.ru Git - kernel.git/commit
soc/tegra: pmc: Fix verification of valid partitions
authorJon Hunter <jonathanh@nvidia.com>
Thu, 11 Feb 2016 18:03:24 +0000 (18:03 +0000)
committerThierry Reding <treding@nvidia.com>
Tue, 5 Apr 2016 13:22:49 +0000 (15:22 +0200)
commit7b769ffd427083ec85eaf66a67b04a3e72a01c71
tree1f399a5eab3ef052521938788f3f19804328966a
parentc7a3dfbaa0eeaae7591df56d9e9bb51d003aa2b5
soc/tegra: pmc: Fix verification of valid partitions

The Tegra power partitions are referenced by numerical IDs which are the
same values programmed into the PMC registers for controlling the
partition. For a given device, the valid partition IDs may not be
contiguous and so simply checking that an ID is not greater than the
maximum ID supported may not mean it is valid. Fix this by checking if
the powergate is defined in the list of powergates for the Tegra SoC.

Add a helper function for checking valid powergates and use where we
need to verify if the powergate ID is valid or not.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c