1
2
3
4
5 #ifndef UFSHCD_PLTFRM_H_
6 #define UFSHCD_PLTFRM_H_
7
8 #include "ufshcd.h"
9
10 #define UFS_PWM_MODE 1
11 #define UFS_HS_MODE 2
12
13 struct ufs_dev_params {
14 u32 pwm_rx_gear;
15 u32 pwm_tx_gear;
16 u32 hs_rx_gear;
17 u32 hs_tx_gear;
18 u32 rx_lanes;
19 u32 tx_lanes;
20 u32 rx_pwr_pwm;
21 u32 tx_pwr_pwm;
22 u32 rx_pwr_hs;
23 u32 tx_pwr_hs;
24 u32 hs_rate;
25 u32 desired_working_mode;
26 };
27
28 int ufshcd_get_pwr_dev_param(struct ufs_dev_params *dev_param,
29 struct ufs_pa_layer_attr *dev_max,
30 struct ufs_pa_layer_attr *agreed_pwr);
31 int ufshcd_pltfrm_init(struct platform_device *pdev,
32 const struct ufs_hba_variant_ops *vops);
33 void ufshcd_pltfrm_shutdown(struct platform_device *pdev);
34
35 #ifdef CONFIG_PM
36
37 int ufshcd_pltfrm_suspend(struct device *dev);
38 int ufshcd_pltfrm_resume(struct device *dev);
39 int ufshcd_pltfrm_runtime_suspend(struct device *dev);
40 int ufshcd_pltfrm_runtime_resume(struct device *dev);
41 int ufshcd_pltfrm_runtime_idle(struct device *dev);
42
43 #else
44
45 #define ufshcd_pltfrm_suspend NULL
46 #define ufshcd_pltfrm_resume NULL
47 #define ufshcd_pltfrm_runtime_suspend NULL
48 #define ufshcd_pltfrm_runtime_resume NULL
49 #define ufshcd_pltfrm_runtime_idle NULL
50
51 #endif
52
53 #endif