scsi: ufs: Only include power management code if necessary
This patch slightly reduces the UFS driver size if built with power management support disabled. Link: https://lore.kernel.org/r/20210722033439.26550-4-bvanassche@acm.org Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Can Guo <cang@codeaurora.org> Cc: Asutosh Das <asutoshd@codeaurora.org> Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Daejun Park <daejun7.park@samsung.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
f1ecbe1e54
commit
9bb25e5d9d
@ -8805,6 +8805,7 @@ static void ufshcd_vreg_set_lpm(struct ufs_hba *hba)
|
|||||||
usleep_range(5000, 5100);
|
usleep_range(5000, 5100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
static int ufshcd_vreg_set_hpm(struct ufs_hba *hba)
|
static int ufshcd_vreg_set_hpm(struct ufs_hba *hba)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -8832,6 +8833,7 @@ vcc_disable:
|
|||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba)
|
static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba)
|
||||||
{
|
{
|
||||||
@ -9239,6 +9241,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
/**
|
/**
|
||||||
* ufshcd_resume - helper function for resume operations
|
* ufshcd_resume - helper function for resume operations
|
||||||
* @hba: per adapter instance
|
* @hba: per adapter instance
|
||||||
@ -9276,7 +9279,9 @@ out:
|
|||||||
ufshcd_update_evt_hist(hba, UFS_EVT_RESUME_ERR, (u32)ret);
|
ufshcd_update_evt_hist(hba, UFS_EVT_RESUME_ERR, (u32)ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM_SLEEP
|
||||||
/**
|
/**
|
||||||
* ufshcd_system_suspend - system suspend callback
|
* ufshcd_system_suspend - system suspend callback
|
||||||
* @dev: Device associated with the UFS controller.
|
* @dev: Device associated with the UFS controller.
|
||||||
@ -9332,7 +9337,9 @@ out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ufshcd_system_resume);
|
EXPORT_SYMBOL(ufshcd_system_resume);
|
||||||
|
#endif /* CONFIG_PM_SLEEP */
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
/**
|
/**
|
||||||
* ufshcd_runtime_suspend - runtime suspend callback
|
* ufshcd_runtime_suspend - runtime suspend callback
|
||||||
* @dev: Device associated with the UFS controller.
|
* @dev: Device associated with the UFS controller.
|
||||||
@ -9380,6 +9387,7 @@ int ufshcd_runtime_resume(struct device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ufshcd_runtime_resume);
|
EXPORT_SYMBOL(ufshcd_runtime_resume);
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ufshcd_shutdown - shutdown routine
|
* ufshcd_shutdown - shutdown routine
|
||||||
|
@ -1030,10 +1030,14 @@ static inline u8 ufshcd_wb_get_query_index(struct ufs_hba *hba)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
extern int ufshcd_runtime_suspend(struct device *dev);
|
extern int ufshcd_runtime_suspend(struct device *dev);
|
||||||
extern int ufshcd_runtime_resume(struct device *dev);
|
extern int ufshcd_runtime_resume(struct device *dev);
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_PM_SLEEP
|
||||||
extern int ufshcd_system_suspend(struct device *dev);
|
extern int ufshcd_system_suspend(struct device *dev);
|
||||||
extern int ufshcd_system_resume(struct device *dev);
|
extern int ufshcd_system_resume(struct device *dev);
|
||||||
|
#endif
|
||||||
extern int ufshcd_shutdown(struct ufs_hba *hba);
|
extern int ufshcd_shutdown(struct ufs_hba *hba);
|
||||||
extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
|
extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
|
||||||
int agreed_gear,
|
int agreed_gear,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user