summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufshcd.h
diff options
context:
space:
mode:
authorStanley Chu <stanley.chu@mediatek.com>2019-09-16 23:56:50 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2019-09-30 23:01:17 -0400
commit49615ba144a0929c725d08f0d3ba8494c8b77404 (patch)
treed25d1b12cb4d071cd5c5deba3ce8a7a9411b093d /drivers/scsi/ufs/ufshcd.h
parentc74f8056621738f5be9f5d3d7e0caa927b21aef6 (diff)
downloadlwn-49615ba144a0929c725d08f0d3ba8494c8b77404.tar.gz
lwn-49615ba144a0929c725d08f0d3ba8494c8b77404.zip
scsi: ufs: override auto suspend tunables for ufs
Rework from previous work by: Sujit Reddy Thumma <sthumma@codeaurora.org> Override auto suspend tunables for UFS device LUNs during initialization so as to efficiently manage background operations and the power consumption. Link: https://lore.kernel.org/r/1568649411-5127-3-git-send-email-stanley.chu@mediatek.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.h')
-rw-r--r--drivers/scsi/ufs/ufshcd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index c94cfda52829..e0fe247c719e 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -716,6 +716,12 @@ struct ufs_hba {
* the performance of ongoing read/write operations.
*/
#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5)
+ /*
+ * This capability allows host controller driver to automatically
+ * enable runtime power management by itself instead of waiting
+ * for userspace to control the power management.
+ */
+#define UFSHCD_CAP_RPM_AUTOSUSPEND (1 << 6)
struct devfreq *devfreq;
struct ufs_clk_scaling clk_scaling;
@@ -749,6 +755,10 @@ static inline bool ufshcd_can_autobkops_during_suspend(struct ufs_hba *hba)
{
return hba->caps & UFSHCD_CAP_AUTO_BKOPS_SUSPEND;
}
+static inline bool ufshcd_is_rpm_autosuspend_allowed(struct ufs_hba *hba)
+{
+ return hba->caps & UFSHCD_CAP_RPM_AUTOSUSPEND;
+}
static inline bool ufshcd_is_intr_aggr_allowed(struct ufs_hba *hba)
{