Skip to content

Commit ea57d7f

Browse files
quic-kdybciovinodkoul
authored andcommitted
phy: qcom: pcie: Determine has_nocsr_reset dynamically
Decide the in-driver logic based on whether the nocsr reset is present and defer checking the appropriateness of that to dt-bindings to save on boilerplate. Reset controller APIs are fine consuming a nullptr, so no additional checks are necessary there. Signed-off-by: Konrad Dybcio <[email protected]> Signed-off-by: Wenbin Yao <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Tested-by: Aleksandrs Vinarskis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent bdeff6d commit ea57d7f

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,8 +3021,6 @@ struct qmp_phy_cfg {
30213021

30223022
bool skip_start_delay;
30233023

3024-
bool has_nocsr_reset;
3025-
30263024
/* QMP PHY pipe clock interface rate */
30273025
unsigned long pipe_clock_rate;
30283026

@@ -4020,7 +4018,6 @@ static const struct qmp_phy_cfg sm8550_qmp_gen4x2_pciephy_cfg = {
40204018

40214019
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
40224020
.phy_status = PHYSTATUS_4_20,
4023-
.has_nocsr_reset = true,
40244021

40254022
/* 20MHz PHY AUX Clock */
40264023
.aux_clock_rate = 20000000,
@@ -4053,7 +4050,6 @@ static const struct qmp_phy_cfg sm8650_qmp_gen4x2_pciephy_cfg = {
40534050

40544051
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
40554052
.phy_status = PHYSTATUS_4_20,
4056-
.has_nocsr_reset = true,
40574053

40584054
/* 20MHz PHY AUX Clock */
40594055
.aux_clock_rate = 20000000,
@@ -4173,7 +4169,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x2_pciephy_cfg = {
41734169

41744170
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
41754171
.phy_status = PHYSTATUS_4_20,
4176-
.has_nocsr_reset = true,
41774172
};
41784173

41794174
static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = {
@@ -4207,7 +4202,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = {
42074202

42084203
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
42094204
.phy_status = PHYSTATUS_4_20,
4210-
.has_nocsr_reset = true,
42114205
};
42124206

42134207
static const struct qmp_phy_cfg x1e80100_qmp_gen4x8_pciephy_cfg = {
@@ -4239,7 +4233,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x8_pciephy_cfg = {
42394233

42404234
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
42414235
.phy_status = PHYSTATUS_4_20,
4242-
.has_nocsr_reset = true,
42434236
};
42444237

42454238
static const struct qmp_phy_cfg qmp_v6_gen4x4_pciephy_cfg = {
@@ -4557,12 +4550,10 @@ static int qmp_pcie_reset_init(struct qmp_pcie *qmp)
45574550
if (ret)
45584551
return dev_err_probe(dev, ret, "failed to get resets\n");
45594552

4560-
if (cfg->has_nocsr_reset) {
4561-
qmp->nocsr_reset = devm_reset_control_get_exclusive(dev, "phy_nocsr");
4562-
if (IS_ERR(qmp->nocsr_reset))
4563-
return dev_err_probe(dev, PTR_ERR(qmp->nocsr_reset),
4564-
"failed to get no-csr reset\n");
4565-
}
4553+
qmp->nocsr_reset = devm_reset_control_get_optional_exclusive(dev, "phy_nocsr");
4554+
if (IS_ERR(qmp->nocsr_reset))
4555+
return dev_err_probe(dev, PTR_ERR(qmp->nocsr_reset),
4556+
"failed to get no-csr reset\n");
45664557

45674558
return 0;
45684559
}

0 commit comments

Comments
 (0)