It does not really make any sense to keep separate configuration structures for the USB and DP parts of the same PHY so merge them.
Unified · Split
| @@ -798,11 +798,7 @@ static const u8 qmp_dp_v5_voltage_swing_hbr_rbr[4][4] = { · 797 unmodified lines | |||
| 798 | 798 | ||
| 799 | struct qmp_phy; | 799 | struct qmp_phy; |
| 800 | 800 | ||
| 801 | /* struct qmp_phy_cfg - per-PHY initialization config */ | ||
| 802 | struct qmp_phy_cfg { | 801 | struct qmp_phy_cfg { |
| 803 | /* phy-type - PCIE/UFS/USB */ | ||
| 804 | unsigned int type; | ||
| 805 | |||
| 806 | /* Init sequence for PHY blocks - serdes, tx, rx, pcs */ | 802 | /* Init sequence for PHY blocks - serdes, tx, rx, pcs */ |
| 807 | const struct qmp_phy_init_tbl *serdes_tbl; | 803 | const struct qmp_phy_init_tbl *serdes_tbl; |
| 808 | int serdes_tbl_num; | 804 | int serdes_tbl_num; |
| @@ -863,11 +859,6 @@ struct qmp_phy_cfg { · 54 unmodified lines | |||
| 863 | 859 | ||
| 864 | }; | 860 | }; |
| 865 | 861 | ||
| 866 | struct qmp_phy_combo_cfg { | ||
| 867 | const struct qmp_phy_cfg *usb_cfg; | ||
| 868 | const struct qmp_phy_cfg *dp_cfg; | ||
| 869 | }; | ||
| 870 | |||
| 871 | /** | 862 | /** |
| 872 | * struct qmp_phy - per-lane phy descriptor | 863 | * struct qmp_phy - per-lane phy descriptor |
| 873 | * | 864 | * |
| @@ -1007,9 +998,7 @@ static const char * const sc7180_usb3phy_reset_l[] = { · 133 unmodified lines | |||
| 1007 | "phy", | 998 | "phy", |
| 1008 | }; | 999 | }; |
| 1009 | 1000 | ||
| 1010 | static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { | 1001 | static const struct qmp_phy_cfg sc7180_usb3dpphy_cfg = { |
| 1011 | .type = PHY_TYPE_USB3, | ||
| 1012 | |||
| 1013 | .serdes_tbl = qmp_v3_usb3_serdes_tbl, | 1002 | .serdes_tbl = qmp_v3_usb3_serdes_tbl, |
| 1014 | .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl), | 1003 | .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl), |
| 1015 | .tx_tbl = qmp_v3_usb3_tx_tbl, | 1004 | .tx_tbl = qmp_v3_usb3_tx_tbl, |
| @@ -1018,19 +1007,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { · 2 unmodified lines | |||
| 1018 | .rx_tbl_num = ARRAY_SIZE(qmp_v3_usb3_rx_tbl), | 1007 | .rx_tbl_num = ARRAY_SIZE(qmp_v3_usb3_rx_tbl), |
| 1019 | .pcs_tbl = qmp_v3_usb3_pcs_tbl, | 1008 | .pcs_tbl = qmp_v3_usb3_pcs_tbl, |
| 1020 | .pcs_tbl_num = ARRAY_SIZE(qmp_v3_usb3_pcs_tbl), | 1009 | .pcs_tbl_num = ARRAY_SIZE(qmp_v3_usb3_pcs_tbl), |
| 1021 | .clk_list = qmp_v3_phy_clk_l, | ||
| 1022 | .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), | ||
| 1023 | .reset_list = sc7180_usb3phy_reset_l, | ||
| 1024 | .num_resets = ARRAY_SIZE(sc7180_usb3phy_reset_l), | ||
| 1025 | .vreg_list = qmp_phy_vreg_l, | ||
| 1026 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1027 | .regs = qmp_v3_usb3phy_regs_layout, | ||
| 1028 | |||
| 1029 | .has_pwrdn_delay = true, | ||
| 1030 | }; | ||
| 1031 | |||
| 1032 | static const struct qmp_phy_cfg sc7180_dpphy_cfg = { | ||
| 1033 | .type = PHY_TYPE_DP, | ||
| 1034 | 1010 | ||
| 1035 | .dp_serdes_tbl = qmp_v3_dp_serdes_tbl, | 1011 | .dp_serdes_tbl = qmp_v3_dp_serdes_tbl, |
| 1036 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl), | 1012 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl), |
| @@ -1055,16 +1031,19 @@ static const struct qmp_phy_cfg sc7180_dpphy_cfg = { · 18 unmodified lines | |||
| 1055 | .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, | 1031 | .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, |
| 1056 | .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy, | 1032 | .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy, |
| 1057 | .calibrate_dp_phy = qcom_qmp_v3_dp_phy_calibrate, | 1033 | .calibrate_dp_phy = qcom_qmp_v3_dp_phy_calibrate, |
| 1058 | }; | ||
| 1059 | 1034 | ||
| 1060 | static const struct qmp_phy_combo_cfg sc7180_usb3dpphy_cfg = { | 1035 | .clk_list = qmp_v3_phy_clk_l, |
| 1061 | .usb_cfg = &sc7180_usb3phy_cfg, | 1036 | .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), |
| 1062 | .dp_cfg = &sc7180_dpphy_cfg, | 1037 | .reset_list = sc7180_usb3phy_reset_l, |
| 1063 | }; | 1038 | .num_resets = ARRAY_SIZE(sc7180_usb3phy_reset_l), |
| 1039 | .vreg_list = qmp_phy_vreg_l, | ||
| 1040 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1041 | .regs = qmp_v3_usb3phy_regs_layout, | ||
| 1064 | 1042 | ||
| 1065 | static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { | 1043 | .has_pwrdn_delay = true, |
| 1066 | .type = PHY_TYPE_USB3, | 1044 | }; |
| 1067 | 1045 | ||
| 1046 | static const struct qmp_phy_cfg sdm845_usb3dpphy_cfg = { | ||
| 1068 | .serdes_tbl = qmp_v3_usb3_serdes_tbl, | 1047 | .serdes_tbl = qmp_v3_usb3_serdes_tbl, |
| 1069 | .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl), | 1048 | .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl), |
| 1070 | .tx_tbl = qmp_v3_usb3_tx_tbl, | 1049 | .tx_tbl = qmp_v3_usb3_tx_tbl, |
| @@ -1073,24 +1052,11 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { · 2 unmodified lines | |||
| 1073 | .rx_tbl_num = ARRAY_SIZE(qmp_v3_usb3_rx_tbl), | 1052 | .rx_tbl_num = ARRAY_SIZE(qmp_v3_usb3_rx_tbl), |
| 1074 | .pcs_tbl = qmp_v3_usb3_pcs_tbl, | 1053 | .pcs_tbl = qmp_v3_usb3_pcs_tbl, |
| 1075 | .pcs_tbl_num = ARRAY_SIZE(qmp_v3_usb3_pcs_tbl), | 1054 | .pcs_tbl_num = ARRAY_SIZE(qmp_v3_usb3_pcs_tbl), |
| 1076 | .clk_list = qmp_v3_phy_clk_l, | ||
| 1077 | .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), | ||
| 1078 | .reset_list = msm8996_usb3phy_reset_l, | ||
| 1079 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), | ||
| 1080 | .vreg_list = qmp_phy_vreg_l, | ||
| 1081 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1082 | .regs = qmp_v3_usb3phy_regs_layout, | ||
| 1083 | |||
| 1084 | .has_pwrdn_delay = true, | ||
| 1085 | }; | ||
| 1086 | 1055 | ||
| 1087 | static const struct qmp_phy_cfg sdm845_dpphy_cfg = { | 1056 | .dp_serdes_tbl = qmp_v3_dp_serdes_tbl, |
| 1088 | .type = PHY_TYPE_DP, | 1057 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl), |
| 1089 | 1058 | .dp_tx_tbl = qmp_v3_dp_tx_tbl, | |
| 1090 | .serdes_tbl = qmp_v3_dp_serdes_tbl, | 1059 | .dp_tx_tbl_num = ARRAY_SIZE(qmp_v3_dp_tx_tbl), |
| 1091 | .serdes_tbl_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl), | ||
| 1092 | .tx_tbl = qmp_v3_dp_tx_tbl, | ||
| 1093 | .tx_tbl_num = ARRAY_SIZE(qmp_v3_dp_tx_tbl), | ||
| 1094 | 1060 | ||
| 1095 | .serdes_tbl_rbr = qmp_v3_dp_serdes_tbl_rbr, | 1061 | .serdes_tbl_rbr = qmp_v3_dp_serdes_tbl_rbr, |
| 1096 | .serdes_tbl_rbr_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl_rbr), | 1062 | .serdes_tbl_rbr_num = ARRAY_SIZE(qmp_v3_dp_serdes_tbl_rbr), |
| @@ -1110,16 +1076,19 @@ static const struct qmp_phy_cfg sdm845_dpphy_cfg = { · 13 unmodified lines | |||
| 1110 | .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, | 1076 | .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, |
| 1111 | .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy, | 1077 | .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy, |
| 1112 | .calibrate_dp_phy = qcom_qmp_v3_dp_phy_calibrate, | 1078 | .calibrate_dp_phy = qcom_qmp_v3_dp_phy_calibrate, |
| 1113 | }; | ||
| 1114 | 1079 | ||
| 1115 | static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = { | 1080 | .clk_list = qmp_v3_phy_clk_l, |
| 1116 | .usb_cfg = &sdm845_usb3phy_cfg, | 1081 | .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), |
| 1117 | .dp_cfg = &sdm845_dpphy_cfg, | 1082 | .reset_list = msm8996_usb3phy_reset_l, |
| 1118 | }; | 1083 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), |
| 1084 | .vreg_list = qmp_phy_vreg_l, | ||
| 1085 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1086 | .regs = qmp_v3_usb3phy_regs_layout, | ||
| 1119 | 1087 | ||
| 1120 | static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { | 1088 | .has_pwrdn_delay = true, |
| 1121 | .type = PHY_TYPE_USB3, | 1089 | }; |
| 1122 | 1090 | ||
| 1091 | static const struct qmp_phy_cfg sc8180x_usb3dpphy_cfg = { | ||
| 1123 | .serdes_tbl = sm8150_usb3_serdes_tbl, | 1092 | .serdes_tbl = sm8150_usb3_serdes_tbl, |
| 1124 | .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl), | 1093 | .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl), |
| 1125 | .tx_tbl = sm8150_usb3_tx_tbl, | 1094 | .tx_tbl = sm8150_usb3_tx_tbl, |
| @@ -1130,20 +1099,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { · 4 unmodified lines | |||
| 1130 | .pcs_tbl_num = ARRAY_SIZE(sm8150_usb3_pcs_tbl), | 1099 | .pcs_tbl_num = ARRAY_SIZE(sm8150_usb3_pcs_tbl), |
| 1131 | .pcs_usb_tbl = sm8150_usb3_pcs_usb_tbl, | 1100 | .pcs_usb_tbl = sm8150_usb3_pcs_usb_tbl, |
| 1132 | .pcs_usb_tbl_num = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl), | 1101 | .pcs_usb_tbl_num = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl), |
| 1133 | .clk_list = qmp_v4_phy_clk_l, | ||
| 1134 | .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), | ||
| 1135 | .reset_list = msm8996_usb3phy_reset_l, | ||
| 1136 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), | ||
| 1137 | .vreg_list = qmp_phy_vreg_l, | ||
| 1138 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1139 | .regs = qmp_v4_usb3phy_regs_layout, | ||
| 1140 | .pcs_usb_offset = 0x300, | ||
| 1141 | |||
| 1142 | .has_pwrdn_delay = true, | ||
| 1143 | }; | ||
| 1144 | |||
| 1145 | static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { | ||
| 1146 | .type = PHY_TYPE_DP, | ||
| 1147 | 1102 | ||
| 1148 | .dp_serdes_tbl = qmp_v4_dp_serdes_tbl, | 1103 | .dp_serdes_tbl = qmp_v4_dp_serdes_tbl, |
| 1149 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v4_dp_serdes_tbl), | 1104 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v4_dp_serdes_tbl), |
| @@ -1168,24 +1123,7 @@ static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { · 18 unmodified lines | |||
| 1168 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, | 1123 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, |
| 1169 | .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy, | 1124 | .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy, |
| 1170 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, | 1125 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, |
| 1171 | }; | ||
| 1172 | |||
| 1173 | static const struct qmp_phy_combo_cfg sc8180x_usb3dpphy_cfg = { | ||
| 1174 | .usb_cfg = &sm8150_usb3phy_cfg, | ||
| 1175 | .dp_cfg = &sc8180x_dpphy_cfg, | ||
| 1176 | }; | ||
| 1177 | |||
| 1178 | static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { | ||
| 1179 | .type = PHY_TYPE_USB3, | ||
| 1180 | 1126 | ||
| 1181 | .serdes_tbl = sc8280xp_usb43dp_serdes_tbl, | ||
| 1182 | .serdes_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_serdes_tbl), | ||
| 1183 | .tx_tbl = sc8280xp_usb43dp_tx_tbl, | ||
| 1184 | .tx_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_tx_tbl), | ||
| 1185 | .rx_tbl = sc8280xp_usb43dp_rx_tbl, | ||
| 1186 | .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_rx_tbl), | ||
| 1187 | .pcs_tbl = sc8280xp_usb43dp_pcs_tbl, | ||
| 1188 | .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_pcs_tbl), | ||
| 1189 | .clk_list = qmp_v4_phy_clk_l, | 1127 | .clk_list = qmp_v4_phy_clk_l, |
| 1190 | .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), | 1128 | .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), |
| 1191 | .reset_list = msm8996_usb3phy_reset_l, | 1129 | .reset_list = msm8996_usb3phy_reset_l, |
| @@ -1194,10 +1132,19 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { · 2 unmodified lines | |||
| 1194 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | 1132 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), |
| 1195 | .regs = qmp_v4_usb3phy_regs_layout, | 1133 | .regs = qmp_v4_usb3phy_regs_layout, |
| 1196 | .pcs_usb_offset = 0x300, | 1134 | .pcs_usb_offset = 0x300, |
| 1135 | |||
| 1136 | .has_pwrdn_delay = true, | ||
| 1197 | }; | 1137 | }; |
| 1198 | 1138 | ||
| 1199 | static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { | 1139 | static const struct qmp_phy_cfg sc8280xp_usb43dpphy_cfg = { |
| 1200 | .type = PHY_TYPE_DP, | 1140 | .serdes_tbl = sc8280xp_usb43dp_serdes_tbl, |
| 1141 | .serdes_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_serdes_tbl), | ||
| 1142 | .tx_tbl = sc8280xp_usb43dp_tx_tbl, | ||
| 1143 | .tx_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_tx_tbl), | ||
| 1144 | .rx_tbl = sc8280xp_usb43dp_rx_tbl, | ||
| 1145 | .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_rx_tbl), | ||
| 1146 | .pcs_tbl = sc8280xp_usb43dp_pcs_tbl, | ||
| 1147 | .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb43dp_pcs_tbl), | ||
| 1201 | 1148 | ||
| 1202 | .dp_serdes_tbl = qmp_v5_dp_serdes_tbl, | 1149 | .dp_serdes_tbl = qmp_v5_dp_serdes_tbl, |
| 1203 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v5_dp_serdes_tbl), | 1150 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v5_dp_serdes_tbl), |
| @@ -1222,16 +1169,18 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { · 18 unmodified lines | |||
| 1222 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, | 1169 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, |
| 1223 | .configure_dp_phy = qcom_qmp_v5_phy_configure_dp_phy, | 1170 | .configure_dp_phy = qcom_qmp_v5_phy_configure_dp_phy, |
| 1224 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, | 1171 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, |
| 1225 | }; | ||
| 1226 | 1172 | ||
| 1227 | static const struct qmp_phy_combo_cfg sc8280xp_usb43dpphy_cfg = { | 1173 | .clk_list = qmp_v4_phy_clk_l, |
| 1228 | .usb_cfg = &sc8280xp_usb43dp_usb_cfg, | 1174 | .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), |
| 1229 | .dp_cfg = &sc8280xp_usb43dp_dp_cfg, | 1175 | .reset_list = msm8996_usb3phy_reset_l, |
| 1176 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), | ||
| 1177 | .vreg_list = qmp_phy_vreg_l, | ||
| 1178 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1179 | .regs = qmp_v4_usb3phy_regs_layout, | ||
| 1180 | .pcs_usb_offset = 0x300, | ||
| 1230 | }; | 1181 | }; |
| 1231 | 1182 | ||
| 1232 | static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { | 1183 | static const struct qmp_phy_cfg sm8250_usb3dpphy_cfg = { |
| 1233 | .type = PHY_TYPE_USB3, | ||
| 1234 | |||
| 1235 | .serdes_tbl = sm8150_usb3_serdes_tbl, | 1184 | .serdes_tbl = sm8150_usb3_serdes_tbl, |
| 1236 | .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl), | 1185 | .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl), |
| 1237 | .tx_tbl = sm8250_usb3_tx_tbl, | 1186 | .tx_tbl = sm8250_usb3_tx_tbl, |
| @@ -1242,20 +1191,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { · 4 unmodified lines | |||
| 1242 | .pcs_tbl_num = ARRAY_SIZE(sm8250_usb3_pcs_tbl), | 1191 | .pcs_tbl_num = ARRAY_SIZE(sm8250_usb3_pcs_tbl), |
| 1243 | .pcs_usb_tbl = sm8250_usb3_pcs_usb_tbl, | 1192 | .pcs_usb_tbl = sm8250_usb3_pcs_usb_tbl, |
| 1244 | .pcs_usb_tbl_num = ARRAY_SIZE(sm8250_usb3_pcs_usb_tbl), | 1193 | .pcs_usb_tbl_num = ARRAY_SIZE(sm8250_usb3_pcs_usb_tbl), |
| 1245 | .clk_list = qmp_v4_sm8250_usbphy_clk_l, | ||
| 1246 | .num_clks = ARRAY_SIZE(qmp_v4_sm8250_usbphy_clk_l), | ||
| 1247 | .reset_list = msm8996_usb3phy_reset_l, | ||
| 1248 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), | ||
| 1249 | .vreg_list = qmp_phy_vreg_l, | ||
| 1250 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1251 | .regs = qmp_v4_usb3phy_regs_layout, | ||
| 1252 | .pcs_usb_offset = 0x300, | ||
| 1253 | |||
| 1254 | .has_pwrdn_delay = true, | ||
| 1255 | }; | ||
| 1256 | |||
| 1257 | static const struct qmp_phy_cfg sm8250_dpphy_cfg = { | ||
| 1258 | .type = PHY_TYPE_DP, | ||
| 1259 | 1194 | ||
| 1260 | .dp_serdes_tbl = qmp_v4_dp_serdes_tbl, | 1195 | .dp_serdes_tbl = qmp_v4_dp_serdes_tbl, |
| 1261 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v4_dp_serdes_tbl), | 1196 | .dp_serdes_tbl_num = ARRAY_SIZE(qmp_v4_dp_serdes_tbl), |
| @@ -1280,11 +1215,17 @@ static const struct qmp_phy_cfg sm8250_dpphy_cfg = { · 18 unmodified lines | |||
| 1280 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, | 1215 | .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, |
| 1281 | .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy, | 1216 | .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy, |
| 1282 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, | 1217 | .calibrate_dp_phy = qcom_qmp_v4_dp_phy_calibrate, |
| 1283 | }; | ||
| 1284 | 1218 | ||
| 1285 | static const struct qmp_phy_combo_cfg sm8250_usb3dpphy_cfg = { | 1219 | .clk_list = qmp_v4_sm8250_usbphy_clk_l, |
| 1286 | .usb_cfg = &sm8250_usb3phy_cfg, | 1220 | .num_clks = ARRAY_SIZE(qmp_v4_sm8250_usbphy_clk_l), |
| 1287 | .dp_cfg = &sm8250_dpphy_cfg, | 1221 | .reset_list = msm8996_usb3phy_reset_l, |
| 1222 | .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), | ||
| 1223 | .vreg_list = qmp_phy_vreg_l, | ||
| 1224 | .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), | ||
| 1225 | .regs = qmp_v4_usb3phy_regs_layout, | ||
| 1226 | .pcs_usb_offset = 0x300, | ||
| 1227 | |||
| 1228 | .has_pwrdn_delay = true, | ||
| 1288 | }; | 1229 | }; |
| 1289 | 1230 | ||
| 1290 | static void qmp_combo_configure_lane(void __iomem *base, | 1231 | static void qmp_combo_configure_lane(void __iomem *base, |
| @@ -2697,10 +2638,7 @@ static int qmp_combo_probe(struct platform_device *pdev) · 1406 unmodified lines | |||
| 2697 | void __iomem *serdes; | 2638 | void __iomem *serdes; |
| 2698 | void __iomem *usb_serdes; | 2639 | void __iomem *usb_serdes; |
| 2699 | void __iomem *dp_serdes = NULL; | 2640 | void __iomem *dp_serdes = NULL; |
| 2700 | const struct qmp_phy_combo_cfg *combo_cfg = NULL; | ||
| 2701 | const struct qmp_phy_cfg *cfg = NULL; | 2641 | const struct qmp_phy_cfg *cfg = NULL; |
| 2702 | const struct qmp_phy_cfg *usb_cfg = NULL; | ||
| 2703 | const struct qmp_phy_cfg *dp_cfg = NULL; | ||
| 2704 | int num, id, expected_phys; | 2642 | int num, id, expected_phys; |
| 2705 | int ret; | 2643 | int ret; |
| 2706 | 2644 | ||
| @@ -2711,13 +2649,10 @@ static int qmp_combo_probe(struct platform_device *pdev) · 4 unmodified lines | |||
| 2711 | qmp->dev = dev; | 2649 | qmp->dev = dev; |
| 2712 | dev_set_drvdata(dev, qmp); | 2650 | dev_set_drvdata(dev, qmp); |
| 2713 | 2651 | ||
| 2714 | combo_cfg = of_device_get_match_data(dev); | 2652 | cfg = of_device_get_match_data(dev); |
| 2715 | if (!combo_cfg) | 2653 | if (!cfg) |
| 2716 | return -EINVAL; | 2654 | return -EINVAL; |
| 2717 | 2655 | ||
| 2718 | usb_cfg = combo_cfg->usb_cfg; | ||
| 2719 | cfg = usb_cfg; /* Setup clks and regulators */ | ||
| 2720 | |||
| 2721 | usb_serdes = serdes = devm_platform_ioremap_resource(pdev, 0); | 2656 | usb_serdes = serdes = devm_platform_ioremap_resource(pdev, 0); |
| 2722 | if (IS_ERR(serdes)) | 2657 | if (IS_ERR(serdes)) |
| 2723 | return PTR_ERR(serdes); | 2658 | return PTR_ERR(serdes); |
| @@ -2730,7 +2665,6 @@ static int qmp_combo_probe(struct platform_device *pdev) · 6 unmodified lines | |||
| 2730 | if (IS_ERR(dp_serdes)) | 2665 | if (IS_ERR(dp_serdes)) |
| 2731 | return PTR_ERR(dp_serdes); | 2666 | return PTR_ERR(dp_serdes); |
| 2732 | 2667 | ||
| 2733 | dp_cfg = combo_cfg->dp_cfg; | ||
| 2734 | expected_phys = 2; | 2668 | expected_phys = 2; |
| 2735 | 2669 | ||
| 2736 | mutex_init(&qmp->phy_mutex); | 2670 | mutex_init(&qmp->phy_mutex); |
| @@ -2769,7 +2703,6 @@ static int qmp_combo_probe(struct platform_device *pdev) · 32 unmodified lines | |||
| 2769 | id = 0; | 2703 | id = 0; |
| 2770 | for_each_available_child_of_node(dev->of_node, child) { | 2704 | for_each_available_child_of_node(dev->of_node, child) { |
| 2771 | if (of_node_name_eq(child, "dp-phy")) { | 2705 | if (of_node_name_eq(child, "dp-phy")) { |
| 2772 | cfg = dp_cfg; | ||
| 2773 | serdes = dp_serdes; | 2706 | serdes = dp_serdes; |
| 2774 | 2707 | ||
| 2775 | /* Create per-lane phy */ | 2708 | /* Create per-lane phy */ |
| @@ -2787,7 +2720,6 @@ static int qmp_combo_probe(struct platform_device *pdev) · 11 unmodified lines | |||
| 2787 | goto err_node_put; | 2720 | goto err_node_put; |
| 2788 | } | 2721 | } |
| 2789 | } else if (of_node_name_eq(child, "usb3-phy")) { | 2722 | } else if (of_node_name_eq(child, "usb3-phy")) { |
| 2790 | cfg = usb_cfg; | ||
| 2791 | serdes = usb_serdes; | 2723 | serdes = usb_serdes; |
| 2792 | 2724 | ||
| 2793 | /* Create per-lane phy */ | 2725 | /* Create per-lane phy */ |