scsi: ufs-qcom: add QUniPro hardware support and power optimizations
New revisions of UFS host controller supports the new UniPro hardware controller (referred as QUniPro). This patch adds the support to enable this new UniPro controller hardware. This change also adds power optimization for bus scaling feature, as well as support for HS-G3 power mode. Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
6e3fd44d7b
commit
f06fcc7155
+17
-10
@@ -223,8 +223,10 @@ struct ufs_clk_info {
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
#define PRE_CHANGE 0
|
||||
#define POST_CHANGE 1
|
||||
enum ufs_notify_change_status {
|
||||
PRE_CHANGE,
|
||||
POST_CHANGE,
|
||||
};
|
||||
|
||||
struct ufs_pa_layer_attr {
|
||||
u32 gear_rx;
|
||||
@@ -266,13 +268,17 @@ struct ufs_hba_variant_ops {
|
||||
int (*init)(struct ufs_hba *);
|
||||
void (*exit)(struct ufs_hba *);
|
||||
u32 (*get_ufs_hci_version)(struct ufs_hba *);
|
||||
void (*clk_scale_notify)(struct ufs_hba *);
|
||||
int (*setup_clocks)(struct ufs_hba *, bool);
|
||||
int (*clk_scale_notify)(struct ufs_hba *, bool,
|
||||
enum ufs_notify_change_status);
|
||||
int (*setup_clocks)(struct ufs_hba *, bool);
|
||||
int (*setup_regulators)(struct ufs_hba *, bool);
|
||||
int (*hce_enable_notify)(struct ufs_hba *, bool);
|
||||
int (*link_startup_notify)(struct ufs_hba *, bool);
|
||||
int (*hce_enable_notify)(struct ufs_hba *,
|
||||
enum ufs_notify_change_status);
|
||||
int (*link_startup_notify)(struct ufs_hba *,
|
||||
enum ufs_notify_change_status);
|
||||
int (*pwr_change_notify)(struct ufs_hba *,
|
||||
bool, struct ufs_pa_layer_attr *,
|
||||
enum ufs_notify_change_status status,
|
||||
struct ufs_pa_layer_attr *,
|
||||
struct ufs_pa_layer_attr *);
|
||||
int (*suspend)(struct ufs_hba *, enum ufs_pm_op);
|
||||
int (*resume)(struct ufs_hba *, enum ufs_pm_op);
|
||||
@@ -708,17 +714,18 @@ static inline u32 ufshcd_vops_get_ufs_hci_version(struct ufs_hba *hba)
|
||||
return ufshcd_readl(hba, REG_UFS_VERSION);
|
||||
}
|
||||
|
||||
static inline void ufshcd_vops_clk_scale_notify(struct ufs_hba *hba)
|
||||
static inline int ufshcd_vops_clk_scale_notify(struct ufs_hba *hba,
|
||||
bool up, enum ufs_notify_change_status status)
|
||||
{
|
||||
if (hba->vops && hba->vops->clk_scale_notify)
|
||||
return hba->vops->clk_scale_notify(hba);
|
||||
return hba->vops->clk_scale_notify(hba, up, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ufshcd_vops_setup_clocks(struct ufs_hba *hba, bool on)
|
||||
{
|
||||
if (hba->vops && hba->vops->setup_clocks)
|
||||
return hba->vops->setup_clocks(hba, on);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user