aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufshcd.h
diff options
context:
space:
mode:
authorsubhashj@codeaurora.org2017-02-03 16:57:02 -0800
committerMartin K. Petersen2017-02-07 18:04:12 -0500
commita3cd5ec55f6c72834f812f9150deb38ddc019782 (patch)
treed2112fd0c88f0308c0a7a8b04b73bfbfa493f6c1 /drivers/scsi/ufs/ufshcd.h
parent7fabb77b3aa01651f9ebc7c139a253bcabb06880 (diff)
scsi: ufs: add load based scaling of UFS gear
UFS driver's load based clock scaling feature scales down the ufs related clocks in order to allow low power modes of chipsets. UniPro 1.6 supports maximum gear up to HS-G3 (High Speed Gear3) and some of the chipsets low power modes may not be allowed in HS-G3 hence this change adds support to scale gear between HS-G3 and HS-G1 based on same existing load based clock scaling logic. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> 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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index b7ce12996a19..4da2bbd617e8 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -45,6 +45,7 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/rwsem.h>
#include <linux/workqueue.h>
#include <linux/errno.h>
#include <linux/types.h>
@@ -351,6 +352,11 @@ struct ufs_clk_gating {
int active_reqs;
};
+struct ufs_saved_pwr_info {
+ struct ufs_pa_layer_attr info;
+ bool is_valid;
+};
+
struct ufs_clk_scaling {
ktime_t busy_start_t;
bool is_busy_started;
@@ -358,6 +364,7 @@ struct ufs_clk_scaling {
unsigned long window_start_t;
struct device_attribute enable_attr;
bool is_allowed;
+ struct ufs_saved_pwr_info saved_pwr_info;
};
/**
@@ -634,6 +641,8 @@ struct ufs_hba {
enum bkops_status urgent_bkops_lvl;
bool is_urgent_bkops_lvl_checked;
+
+ struct rw_semaphore clk_scaling_lock;
};
/* Returns true if clocks can be gated. Otherwise false */