@@ -204,8 +204,7 @@ struct qcom_pcie {
204204 union qcom_pcie_resources res ;
205205 struct phy * phy ;
206206 struct gpio_desc * reset ;
207- const struct qcom_pcie_ops * ops ;
208- unsigned int pipe_clk_need_muxing :1 ;
207+ const struct qcom_pcie_cfg * cfg ;
209208};
210209
211210#define to_qcom_pcie (x ) dev_get_drvdata((x)->dev)
@@ -229,8 +228,8 @@ static int qcom_pcie_start_link(struct dw_pcie *pci)
229228 struct qcom_pcie * pcie = to_qcom_pcie (pci );
230229
231230 /* Enable Link Training state machine */
232- if (pcie -> ops -> ltssm_enable )
233- pcie -> ops -> ltssm_enable (pcie );
231+ if (pcie -> cfg -> ops -> ltssm_enable )
232+ pcie -> cfg -> ops -> ltssm_enable (pcie );
234233
235234 return 0 ;
236235}
@@ -1176,7 +1175,7 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie)
11761175 if (ret < 0 )
11771176 return ret ;
11781177
1179- if (pcie -> pipe_clk_need_muxing ) {
1178+ if (pcie -> cfg -> pipe_clk_need_muxing ) {
11801179 res -> pipe_clk_src = devm_clk_get (dev , "pipe_mux" );
11811180 if (IS_ERR (res -> pipe_clk_src ))
11821181 return PTR_ERR (res -> pipe_clk_src );
@@ -1209,7 +1208,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
12091208 }
12101209
12111210 /* Set TCXO as clock source for pcie_pipe_clk_src */
1212- if (pcie -> pipe_clk_need_muxing )
1211+ if (pcie -> cfg -> pipe_clk_need_muxing )
12131212 clk_set_parent (res -> pipe_clk_src , res -> ref_clk_src );
12141213
12151214 ret = clk_bulk_prepare_enable (res -> num_clks , res -> clks );
@@ -1284,7 +1283,7 @@ static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie)
12841283 struct qcom_pcie_resources_2_7_0 * res = & pcie -> res .v2_7_0 ;
12851284
12861285 /* Set pipe clock as clock source for pcie_pipe_clk_src */
1287- if (pcie -> pipe_clk_need_muxing )
1286+ if (pcie -> cfg -> pipe_clk_need_muxing )
12881287 clk_set_parent (res -> pipe_clk_src , res -> phy_pipe_clk );
12891288
12901289 return clk_prepare_enable (res -> pipe_clk );
@@ -1384,24 +1383,24 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
13841383
13851384 qcom_ep_reset_assert (pcie );
13861385
1387- ret = pcie -> ops -> init (pcie );
1386+ ret = pcie -> cfg -> ops -> init (pcie );
13881387 if (ret )
13891388 return ret ;
13901389
13911390 ret = phy_power_on (pcie -> phy );
13921391 if (ret )
13931392 goto err_deinit ;
13941393
1395- if (pcie -> ops -> post_init ) {
1396- ret = pcie -> ops -> post_init (pcie );
1394+ if (pcie -> cfg -> ops -> post_init ) {
1395+ ret = pcie -> cfg -> ops -> post_init (pcie );
13971396 if (ret )
13981397 goto err_disable_phy ;
13991398 }
14001399
14011400 qcom_ep_reset_deassert (pcie );
14021401
1403- if (pcie -> ops -> config_sid ) {
1404- ret = pcie -> ops -> config_sid (pcie );
1402+ if (pcie -> cfg -> ops -> config_sid ) {
1403+ ret = pcie -> cfg -> ops -> config_sid (pcie );
14051404 if (ret )
14061405 goto err ;
14071406 }
@@ -1410,12 +1409,12 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
14101409
14111410err :
14121411 qcom_ep_reset_assert (pcie );
1413- if (pcie -> ops -> post_deinit )
1414- pcie -> ops -> post_deinit (pcie );
1412+ if (pcie -> cfg -> ops -> post_deinit )
1413+ pcie -> cfg -> ops -> post_deinit (pcie );
14151414err_disable_phy :
14161415 phy_power_off (pcie -> phy );
14171416err_deinit :
1418- pcie -> ops -> deinit (pcie );
1417+ pcie -> cfg -> ops -> deinit (pcie );
14191418
14201419 return ret ;
14211420}
@@ -1559,8 +1558,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
15591558
15601559 pcie -> pci = pci ;
15611560
1562- pcie -> ops = pcie_cfg -> ops ;
1563- pcie -> pipe_clk_need_muxing = pcie_cfg -> pipe_clk_need_muxing ;
1561+ pcie -> cfg = pcie_cfg ;
15641562
15651563 pcie -> reset = devm_gpiod_get_optional (dev , "perst" , GPIOD_OUT_HIGH );
15661564 if (IS_ERR (pcie -> reset )) {
@@ -1586,7 +1584,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
15861584 goto err_pm_runtime_put ;
15871585 }
15881586
1589- ret = pcie -> ops -> get_resources (pcie );
1587+ ret = pcie -> cfg -> ops -> get_resources (pcie );
15901588 if (ret )
15911589 goto err_pm_runtime_put ;
15921590
0 commit comments