Merge tag 'phy-fixes-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy fixes from Vinod Koul:
"A bunch of driver fixes:
- Freescale typec orientation switch fix, clearing register fix,
assertion of phy reset during power on
- Qualcomm pcs register clear before using
- stm one off fix
- TI runtimepm error handling, regmap leak fixes
- Rockchip gadget mode disconnection and disruption fixes
- Tegra register level fix
- Broadcom pointer cast warning fix"
* tag 'phy-fixes-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
phy: freescale: imx8m-pcie: assert phy reset during power on
phy: rockchip: inno-usb2: Fix a double free bug in rockchip_usb2phy_probe()
phy: broadcom: ns-usb3: Fix Wvoid-pointer-to-enum-cast warning (again)
phy: tegra: xusb: Explicitly configure HS_DISCON_LEVEL to 0x7
phy: rockchip: inno-usb2: fix communication disruption in gadget mode
phy: rockchip: inno-usb2: fix disconnection in gadget mode
phy: ti: gmii-sel: fix regmap leak on probe failure
phy: sparx5-serdes: make it selectable for ARCH_LAN969X
phy: ti: da8xx-usb: Handle devm_pm_runtime_enable() errors
phy: stm32-usphyc: Fix off by one in probe()
phy: qcom-qusb2: Fix NULL pointer dereference on early suspend
phy: fsl-imx8mq-usb: Clear the PCS_TX_SWING_FULL field before using it
dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: Update pcie phy bindings for qcs8300
phy: fsl-imx8mq-usb: fix typec orientation switch when built as module
This commit is contained in:
@@ -56,7 +56,7 @@ properties:
|
||||
|
||||
clocks:
|
||||
minItems: 5
|
||||
maxItems: 7
|
||||
maxItems: 6
|
||||
|
||||
clock-names:
|
||||
minItems: 5
|
||||
@@ -67,7 +67,6 @@ properties:
|
||||
- enum: [rchng, refgen]
|
||||
- const: pipe
|
||||
- const: pipediv2
|
||||
- const: phy_aux
|
||||
|
||||
power-domains:
|
||||
maxItems: 1
|
||||
@@ -180,6 +179,7 @@ allOf:
|
||||
contains:
|
||||
enum:
|
||||
- qcom,glymur-qmp-gen5x4-pcie-phy
|
||||
- qcom,qcs8300-qmp-gen4x2-pcie-phy
|
||||
- qcom,sa8775p-qmp-gen4x2-pcie-phy
|
||||
- qcom,sa8775p-qmp-gen4x4-pcie-phy
|
||||
- qcom,sc8280xp-qmp-gen3x1-pcie-phy
|
||||
@@ -197,19 +197,6 @@ allOf:
|
||||
clock-names:
|
||||
minItems: 6
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- qcom,qcs8300-qmp-gen4x2-pcie-phy
|
||||
then:
|
||||
properties:
|
||||
clocks:
|
||||
minItems: 7
|
||||
clock-names:
|
||||
minItems: 7
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
|
||||
@@ -203,7 +203,7 @@ static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev)
|
||||
usb3->dev = dev;
|
||||
usb3->mdiodev = mdiodev;
|
||||
|
||||
usb3->family = (enum bcm_ns_family)device_get_match_data(dev);
|
||||
usb3->family = (unsigned long)device_get_match_data(dev);
|
||||
|
||||
syscon_np = of_parse_phandle(dev->of_node, "usb3-dmp-syscon", 0);
|
||||
err = of_address_to_resource(syscon_np, 0, &res);
|
||||
|
||||
@@ -89,7 +89,8 @@ static int imx8_pcie_phy_power_on(struct phy *phy)
|
||||
writel(imx8_phy->tx_deemph_gen2,
|
||||
imx8_phy->base + PCIE_PHY_TRSV_REG6);
|
||||
break;
|
||||
case IMX8MP: /* Do nothing. */
|
||||
case IMX8MP:
|
||||
reset_control_assert(imx8_phy->reset);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,6 @@ struct imx8mq_usb_phy {
|
||||
static void tca_blk_orientation_set(struct tca_blk *tca,
|
||||
enum typec_orientation orientation);
|
||||
|
||||
#ifdef CONFIG_TYPEC
|
||||
|
||||
static int tca_blk_typec_switch_set(struct typec_switch_dev *sw,
|
||||
enum typec_orientation orientation)
|
||||
{
|
||||
@@ -175,18 +173,6 @@ static void tca_blk_put_typec_switch(struct typec_switch_dev *sw)
|
||||
typec_switch_unregister(sw);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static struct typec_switch_dev *tca_blk_get_typec_switch(struct platform_device *pdev,
|
||||
struct imx8mq_usb_phy *imx_phy)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void tca_blk_put_typec_switch(struct typec_switch_dev *sw) {}
|
||||
|
||||
#endif /* CONFIG_TYPEC */
|
||||
|
||||
static void tca_blk_orientation_set(struct tca_blk *tca,
|
||||
enum typec_orientation orientation)
|
||||
{
|
||||
@@ -504,6 +490,7 @@ static void imx8m_phy_tune(struct imx8mq_usb_phy *imx_phy)
|
||||
|
||||
if (imx_phy->pcs_tx_swing_full != PHY_TUNE_DEFAULT) {
|
||||
value = readl(imx_phy->base + PHY_CTRL5);
|
||||
value &= ~PHY_CTRL5_PCS_TX_SWING_FULL_MASK;
|
||||
value |= FIELD_PREP(PHY_CTRL5_PCS_TX_SWING_FULL_MASK,
|
||||
imx_phy->pcs_tx_swing_full);
|
||||
writel(value, imx_phy->base + PHY_CTRL5);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
config PHY_SPARX5_SERDES
|
||||
tristate "Microchip Sparx5 SerDes PHY driver"
|
||||
select GENERIC_PHY
|
||||
depends on ARCH_SPARX5 || COMPILE_TEST
|
||||
depends on ARCH_SPARX5 || ARCH_LAN969X || COMPILE_TEST
|
||||
depends on OF
|
||||
depends on HAS_IOMEM
|
||||
help
|
||||
|
||||
@@ -1093,29 +1093,29 @@ static int qusb2_phy_probe(struct platform_device *pdev)
|
||||
or->hsdisc_trim.override = true;
|
||||
}
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
pm_runtime_enable(dev);
|
||||
dev_set_drvdata(dev, qphy);
|
||||
|
||||
/*
|
||||
* Prevent runtime pm from being ON by default. Users can enable
|
||||
* it using power/control in sysfs.
|
||||
* Enable runtime PM support, but forbid it by default.
|
||||
* Users can allow it again via the power/control attribute in sysfs.
|
||||
*/
|
||||
pm_runtime_set_active(dev);
|
||||
pm_runtime_forbid(dev);
|
||||
ret = devm_pm_runtime_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
generic_phy = devm_phy_create(dev, NULL, &qusb2_phy_gen_ops);
|
||||
if (IS_ERR(generic_phy)) {
|
||||
ret = PTR_ERR(generic_phy);
|
||||
dev_err(dev, "failed to create phy, %d\n", ret);
|
||||
pm_runtime_disable(dev);
|
||||
return ret;
|
||||
}
|
||||
qphy->phy = generic_phy;
|
||||
|
||||
dev_set_drvdata(dev, qphy);
|
||||
phy_set_drvdata(generic_phy, qphy);
|
||||
|
||||
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
||||
if (IS_ERR(phy_provider))
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
return PTR_ERR_OR_ZERO(phy_provider);
|
||||
}
|
||||
|
||||
@@ -821,16 +821,19 @@ static void rockchip_chg_detect_work(struct work_struct *work)
|
||||
container_of(work, struct rockchip_usb2phy_port, chg_work.work);
|
||||
struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent);
|
||||
struct regmap *base = get_reg_base(rphy);
|
||||
bool is_dcd, tmout, vout;
|
||||
bool is_dcd, tmout, vout, vbus_attach;
|
||||
unsigned long delay;
|
||||
|
||||
vbus_attach = property_enabled(rphy->grf, &rport->port_cfg->utmi_bvalid);
|
||||
|
||||
dev_dbg(&rport->phy->dev, "chg detection work state = %d\n",
|
||||
rphy->chg_state);
|
||||
switch (rphy->chg_state) {
|
||||
case USB_CHG_STATE_UNDEFINED:
|
||||
if (!rport->suspended)
|
||||
if (!rport->suspended && !vbus_attach)
|
||||
rockchip_usb2phy_power_off(rport->phy);
|
||||
/* put the controller in non-driving mode */
|
||||
if (!vbus_attach)
|
||||
property_enable(base, &rphy->phy_cfg->chg_det.opmode, false);
|
||||
/* Start DCD processing stage 1 */
|
||||
rockchip_chg_enable_dcd(rphy, true);
|
||||
@@ -894,6 +897,7 @@ static void rockchip_chg_detect_work(struct work_struct *work)
|
||||
fallthrough;
|
||||
case USB_CHG_STATE_DETECTED:
|
||||
/* put the controller in normal mode */
|
||||
if (!vbus_attach)
|
||||
property_enable(base, &rphy->phy_cfg->chg_det.opmode, true);
|
||||
rockchip_usb2phy_otg_sm_work(&rport->otg_sm_work.work);
|
||||
dev_dbg(&rport->phy->dev, "charger = %s\n",
|
||||
@@ -1491,7 +1495,7 @@ next_child:
|
||||
rphy);
|
||||
if (ret) {
|
||||
dev_err_probe(rphy->dev, ret, "failed to request usb2phy irq handle\n");
|
||||
goto put_child;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -712,7 +712,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
ret = of_property_read_u32(child, "reg", &index);
|
||||
if (ret || index > usbphyc->nphys) {
|
||||
if (ret || index >= usbphyc->nphys) {
|
||||
dev_err(&phy->dev, "invalid reg property: %d\n", ret);
|
||||
if (!ret)
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#define XUSB_PADCTL_USB2_BIAS_PAD_CTL0 0x284
|
||||
#define BIAS_PAD_PD BIT(11)
|
||||
#define HS_SQUELCH_LEVEL(x) (((x) & 0x7) << 0)
|
||||
#define HS_DISCON_LEVEL(x) (((x) & 0x7) << 3)
|
||||
|
||||
#define XUSB_PADCTL_USB2_BIAS_PAD_CTL1 0x288
|
||||
#define USB2_TRK_START_TIMER(x) (((x) & 0x7f) << 12)
|
||||
@@ -623,6 +624,8 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
|
||||
value &= ~BIAS_PAD_PD;
|
||||
value &= ~HS_SQUELCH_LEVEL(~0);
|
||||
value |= HS_SQUELCH_LEVEL(priv->calib.hs_squelch);
|
||||
value &= ~HS_DISCON_LEVEL(~0);
|
||||
value |= HS_DISCON_LEVEL(0x7);
|
||||
padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL0);
|
||||
|
||||
udelay(1);
|
||||
|
||||
@@ -180,6 +180,7 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
|
||||
struct da8xx_usb_phy_platform_data *pdata = dev->platform_data;
|
||||
struct device_node *node = dev->of_node;
|
||||
struct da8xx_usb_phy *d_phy;
|
||||
int ret;
|
||||
|
||||
d_phy = devm_kzalloc(dev, sizeof(*d_phy), GFP_KERNEL);
|
||||
if (!d_phy)
|
||||
@@ -233,8 +234,6 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(d_phy->phy_provider);
|
||||
}
|
||||
} else {
|
||||
int ret;
|
||||
|
||||
ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy",
|
||||
"ohci-da8xx");
|
||||
if (ret)
|
||||
@@ -249,7 +248,9 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
|
||||
PHY_INIT_BITS, PHY_INIT_BITS);
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
devm_pm_runtime_enable(dev);
|
||||
ret = devm_pm_runtime_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
/*
|
||||
* Prevent runtime pm from being ON by default. Users can enable
|
||||
* it using power/control in sysfs.
|
||||
|
||||
@@ -512,7 +512,7 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
|
||||
return dev_err_probe(dev, PTR_ERR(base),
|
||||
"failed to get base memory resource\n");
|
||||
|
||||
priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
|
||||
priv->regmap = devm_regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
|
||||
if (IS_ERR(priv->regmap))
|
||||
return dev_err_probe(dev, PTR_ERR(priv->regmap),
|
||||
"Failed to get syscon\n");
|
||||
|
||||
Reference in New Issue
Block a user