@@ -368,6 +368,11 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba)
368
368
if (ret )
369
369
return ret ;
370
370
371
+ if (phy -> power_count ) {
372
+ phy_power_off (phy );
373
+ phy_exit (phy );
374
+ }
375
+
371
376
/* phy initialization - calibrate the phy */
372
377
ret = phy_init (phy );
373
378
if (ret ) {
@@ -866,6 +871,7 @@ static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
866
871
*/
867
872
static void ufs_qcom_advertise_quirks (struct ufs_hba * hba )
868
873
{
874
+ const struct ufs_qcom_drvdata * drvdata = of_device_get_match_data (hba -> dev );
869
875
struct ufs_qcom_host * host = ufshcd_get_variant (hba );
870
876
871
877
if (host -> hw_ver .major == 0x2 )
@@ -874,9 +880,8 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
874
880
if (host -> hw_ver .major > 0x3 )
875
881
hba -> quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH ;
876
882
877
- if (of_device_is_compatible (hba -> dev -> of_node , "qcom,sm8550-ufshc" ) ||
878
- of_device_is_compatible (hba -> dev -> of_node , "qcom,sm8650-ufshc" ))
879
- hba -> quirks |= UFSHCD_QUIRK_BROKEN_LSDBS_CAP ;
883
+ if (drvdata && drvdata -> quirks )
884
+ hba -> quirks |= drvdata -> quirks ;
880
885
}
881
886
882
887
static void ufs_qcom_set_phy_gear (struct ufs_qcom_host * host )
@@ -1064,6 +1069,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
1064
1069
struct device * dev = hba -> dev ;
1065
1070
struct ufs_qcom_host * host ;
1066
1071
struct ufs_clk_info * clki ;
1072
+ const struct ufs_qcom_drvdata * drvdata = of_device_get_match_data (hba -> dev );
1067
1073
1068
1074
host = devm_kzalloc (dev , sizeof (* host ), GFP_KERNEL );
1069
1075
if (!host )
@@ -1143,6 +1149,9 @@ static int ufs_qcom_init(struct ufs_hba *hba)
1143
1149
dev_warn (dev , "%s: failed to configure the testbus %d\n" ,
1144
1150
__func__ , err );
1145
1151
1152
+ if (drvdata && drvdata -> no_phy_retention )
1153
+ hba -> spm_lvl = UFS_PM_LVL_5 ;
1154
+
1146
1155
return 0 ;
1147
1156
1148
1157
out_variant_clear :
@@ -1579,13 +1588,6 @@ static void ufs_qcom_config_scaling_param(struct ufs_hba *hba,
1579
1588
}
1580
1589
#endif
1581
1590
1582
- static void ufs_qcom_reinit_notify (struct ufs_hba * hba )
1583
- {
1584
- struct ufs_qcom_host * host = ufshcd_get_variant (hba );
1585
-
1586
- phy_power_off (host -> generic_phy );
1587
- }
1588
-
1589
1591
/* Resources */
1590
1592
static const struct ufshcd_res_info ufs_res_info [RES_MAX ] = {
1591
1593
{.name = "ufs_mem" ,},
@@ -1825,7 +1827,6 @@ static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
1825
1827
.device_reset = ufs_qcom_device_reset ,
1826
1828
.config_scaling_param = ufs_qcom_config_scaling_param ,
1827
1829
.program_key = ufs_qcom_ice_program_key ,
1828
- .reinit_notify = ufs_qcom_reinit_notify ,
1829
1830
.mcq_config_resource = ufs_qcom_mcq_config_resource ,
1830
1831
.get_hba_mac = ufs_qcom_get_hba_mac ,
1831
1832
.op_runtime_config = ufs_qcom_op_runtime_config ,
@@ -1868,9 +1869,15 @@ static void ufs_qcom_remove(struct platform_device *pdev)
1868
1869
platform_device_msi_free_irqs_all (hba -> dev );
1869
1870
}
1870
1871
1872
+ static const struct ufs_qcom_drvdata ufs_qcom_sm8550_drvdata = {
1873
+ .quirks = UFSHCD_QUIRK_BROKEN_LSDBS_CAP ,
1874
+ .no_phy_retention = true,
1875
+ };
1876
+
1871
1877
static const struct of_device_id ufs_qcom_of_match [] __maybe_unused = {
1872
1878
{ .compatible = "qcom,ufshc" },
1873
- { .compatible = "qcom,sm8550-ufshc" },
1879
+ { .compatible = "qcom,sm8550-ufshc" , .data = & ufs_qcom_sm8550_drvdata },
1880
+ { .compatible = "qcom,sm8650-ufshc" , .data = & ufs_qcom_sm8550_drvdata },
1874
1881
{},
1875
1882
};
1876
1883
MODULE_DEVICE_TABLE (of , ufs_qcom_of_match );
0 commit comments