]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: ufs: core: Add OPP support for scaling clocks and regulators
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 12 Oct 2023 17:21:26 +0000 (22:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:14 +0000 (16:03 +0200)
commit847af89aa1635f42dac2f40ae042eb5d368b23d4
tree83fceacb029068ef66c141d0331ce73d1a133b55
parent95ffe734518d99647409010046ea2d8a6f9c6f7f
scsi: ufs: core: Add OPP support for scaling clocks and regulators

[ Upstream commit 930bd77ebe3dc23b18aa49e55e6a515d5663d67a ]

UFS core is only scaling the clocks during devfreq scaling and
initialization. But for an optimum power saving, regulators should also be
scaled along with the clocks.

So let's use the OPP framework which supports scaling clocks, regulators,
and performance state using OPP table defined in devicetree. For
accomodating the OPP support, the existing APIs (ufshcd_scale_clks,
ufshcd_is_devfreq_scaling_required and ufshcd_devfreq_scale) are modified
to accept "freq" as an argument which in turn used by the OPP helpers.

The OPP support is added along with the old freq-table based clock scaling
so that the existing platforms work as expected.

Co-developed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231012172129.65172-3-manivannan.sadhasivam@linaro.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 2e083cd80229 ("scsi: ufs: core: Fix clk scaling to be conditional in reset and restore")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h