diff options
author | Po-Wen Kao <powen.kao@mediatek.com> | 2022-08-03 02:54:37 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-08-23 05:58:30 +0300 |
commit | b7dbc686f60b28d0843ed572f8aa59c3e76e142b (patch) | |
tree | 7f3937d48165d84e2951a538df517b1f2d51a643 /drivers/ufs/host/ufs-mediatek.h | |
parent | 2873e0453b0165117bdc28dee3e38d69dd82f4c5 (diff) | |
download | linux-b7dbc686f60b28d0843ed572f8aa59c3e76e142b.tar.xz |
scsi: ufs: ufs-mediatek: Support clk-scaling to optimize power consumption
Provide clk-scaling feature in MediaTek UFS platforms.
MediaTek platform supports clk-scaling by switching parent clock mux of
UFSHCI main clocks: ufs_sel.
The driver needs to prevent changing the rate of ufs_sel because its parent
PLL clock may be shared between multiple IPs. In order to achieve this
goal, the maximum and minimum clock rates of ufs_sel defined in dts should
match the rate of "ufs_sel_max_src" and "ufs_sel_min_src" respectively.
Link: https://lore.kernel.org/r/20220802235437.4547-6-stanley.chu@mediatek.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/host/ufs-mediatek.h')
-rw-r--r-- | drivers/ufs/host/ufs-mediatek.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/ufs/host/ufs-mediatek.h b/drivers/ufs/host/ufs-mediatek.h index aa26d415527b..2fc6d7b87694 100644 --- a/drivers/ufs/host/ufs-mediatek.h +++ b/drivers/ufs/host/ufs-mediatek.h @@ -124,6 +124,12 @@ struct ufs_mtk_crypt_cfg { int vcore_volt; }; +struct ufs_mtk_clk { + struct ufs_clk_info *ufs_sel_clki; /* Mux */ + struct ufs_clk_info *ufs_sel_max_clki; /* Max src */ + struct ufs_clk_info *ufs_sel_min_clki; /* Min src */ +}; + struct ufs_mtk_hw_ver { u8 step; u8 minor; @@ -139,6 +145,7 @@ struct ufs_mtk_host { struct reset_control *crypto_reset; struct ufs_hba *hba; struct ufs_mtk_crypt_cfg *crypt; + struct ufs_mtk_clk mclk; struct ufs_mtk_hw_ver hw_ver; enum ufs_mtk_host_caps caps; bool mphy_powered_on; |