Skip to content

Commit

Permalink
phy: qcom-qmp-usb: drop power-down delay config
Browse files Browse the repository at this point in the history
[ Upstream commit 38cd167 ]

The power-down delay was included in the first version of the QMP driver
as an optional delay after powering on the PHY (using
POWER_DOWN_CONTROL) and just before starting it. Later changes modified
this sequence by powering on before initialising the PHY, but the
optional delay stayed where it was (i.e. before starting the PHY).

The vendor driver does not use a delay before starting the PHY and this
is likely not needed on any platform unless there is a corresponding
delay in the vendor kernel init sequence tables (i.e. in devicetree).

Let's keep the delay for now, but drop the redundant delay period
configuration while increasing the unnecessarily low timer slack
somewhat.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221012081241.18273-15-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: 922adfd ("phy: qcom-qmp-usb: correct registers layout for IPQ8074 USB3 PHY")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jhovold authored and gregkh committed Dec 31, 2022
1 parent 7109893 commit 71c03e6
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions drivers/phy/qualcomm/phy-qcom-qmp-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
#define CLAMP_EN BIT(0) /* enables i/o clamp_n */

#define PHY_INIT_COMPLETE_TIMEOUT 10000
#define POWER_DOWN_DELAY_US_MIN 10
#define POWER_DOWN_DELAY_US_MAX 11

struct qmp_phy_init_tbl {
unsigned int offset;
Expand Down Expand Up @@ -1465,9 +1463,6 @@ struct qmp_phy_cfg {

/* true, if PHY needs delay after POWER_DOWN */
bool has_pwrdn_delay;
/* power_down delay in usec */
int pwrdn_delay_min;
int pwrdn_delay_max;

/* true, if PHY has a separate DP_COM control block */
bool has_phy_dp_com_ctrl;
Expand Down Expand Up @@ -1673,9 +1668,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,

.has_phy_dp_com_ctrl = true,
};

Expand Down Expand Up @@ -1703,9 +1695,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,

.has_phy_dp_com_ctrl = true,
};

Expand Down Expand Up @@ -1757,8 +1746,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg msm8998_usb3phy_cfg = {
Expand Down Expand Up @@ -1811,11 +1798,7 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
.pwrdn_ctrl = SW_PWRDN,
.phy_status = PHYSTATUS,


.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,

.has_phy_dp_com_ctrl = true,
};

Expand Down Expand Up @@ -1846,8 +1829,6 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
Expand Down Expand Up @@ -1877,9 +1858,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,

.has_phy_dp_com_ctrl = true,
};

Expand Down Expand Up @@ -1910,8 +1888,6 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = {
Expand Down Expand Up @@ -1941,8 +1917,6 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = {
Expand Down Expand Up @@ -1972,8 +1946,6 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg sm8350_usb3phy_cfg = {
Expand Down Expand Up @@ -2003,9 +1975,6 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,

.has_phy_dp_com_ctrl = true,
};

Expand Down Expand Up @@ -2036,8 +2005,6 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = {
.phy_status = PHYSTATUS,

.has_pwrdn_delay = true,
.pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN,
.pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX,
};

static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = {
Expand Down Expand Up @@ -2229,7 +2196,7 @@ static int qmp_usb_power_on(struct phy *phy)
qmp_usb_configure(pcs, cfg->regs, cfg->pcs_tbl, cfg->pcs_tbl_num);

if (cfg->has_pwrdn_delay)
usleep_range(cfg->pwrdn_delay_min, cfg->pwrdn_delay_max);
usleep_range(10, 20);

/* Pull PHY out of reset state */
qphy_clrbits(pcs, cfg->regs[QPHY_SW_RESET], SW_RESET);
Expand Down

0 comments on commit 71c03e6

Please sign in to comment.