iommu/arm-smmu: Add pm_runtime/sleep ops
authorSricharan R <sricharan@codeaurora.org>
Tue, 4 Dec 2018 06:22:09 +0000 (11:52 +0530)
committerWill Deacon <will.deacon@arm.com>
Mon, 10 Dec 2018 14:55:59 +0000 (14:55 +0000)
commit96a299d24cfb6b9659304131b598fa09f4c9041e
treee7ccbd1b86bcb52fbb97cc06e51f69e9cd37734a
parenta868e8530441286342f90c1fd9c5f24de3aa2880
iommu/arm-smmu: Add pm_runtime/sleep ops

The smmu needs to be functional only when the respective
master's using it are active. The device_link feature
helps to track such functional dependencies, so that the
iommu gets powered when the master device enables itself
using pm_runtime. So by adapting the smmu driver for
runtime pm, above said dependency can be addressed.

This patch adds the pm runtime/sleep callbacks to the
driver and the corresponding bulk clock handling for all
the clocks needed by smmu.

Also, while we enable the runtime pm, add a pm sleep suspend
callback that pushes devices to low power state by turning
the clocks off in a system sleep.
Add corresponding clock enable path in resume callback as well.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
[Thor: Rework to get clocks from device tree]
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
[vivek: rework for clock and pm ops]
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu.c