Skip to content

Commit cca9543

Browse files
committed
Merge tag 'phy-fixes-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy fixes from Vinod Koul: - Big pile of Qualcomm DP/eDP config fixes and kaanapali PHY PLL lock failure fix - Apple typec switch/mux leak fix - Marvell incoorect register fix for mvebu utmi phy - Tegra per-pad calibration fix * tag 'phy-fixes-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: qcom: qmp-usbc: Fix out-of-bounds array access in dp swing config phy: apple: atc: Fix typec switch/mux leak on unbind phy: spacemit: Remove incorrect clk_disable() in spacemit_usb2phy_init() phy: eswin: Fix incorrect error check in probe() phy: qcom-qmp-ufs: Fix kaanapali PHY PLL lock failure after SM8650 G4 fix phy: exynos5-usbdrd: fix USB 2.0 HS PHY tuning values for Exynos7870 phy: tegra: xusb: Fix per-pad high-speed termination calibration phy: marvell: mvebu-a3700-utmi: fix incorrect USB2_PHY_CTRL register access phy: qcom: edp: Add PHY-specific LDO config for eDP low vdiff phy: qcom: edp: Fix AUX_CFG8 programming for DP mode phy: qcom: edp: Add SC7280/SC8180X swing/pre-emphasis tables phy: qcom: edp: Add eDP/DP mode switch support phy: qcom: edp: Unify generic DP/eDP swing and pre-emphasis tables
2 parents e216d85 + ea17fc4 commit cca9543

10 files changed

Lines changed: 240 additions & 65 deletions

File tree

drivers/phy/apple/atc.c

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,6 @@ struct apple_atcphy {
628628

629629
struct reset_controller_dev rcdev;
630630

631-
struct typec_switch *sw;
632-
struct typec_mux *mux;
633-
634631
struct mutex lock;
635632
};
636633

@@ -2066,15 +2063,25 @@ static int atcphy_sw_set(struct typec_switch_dev *sw, enum typec_orientation ori
20662063
return 0;
20672064
}
20682065

2066+
static void atcphy_typec_switch_unregister(void *data)
2067+
{
2068+
typec_switch_unregister(data);
2069+
}
2070+
20692071
static int atcphy_probe_switch(struct apple_atcphy *atcphy)
20702072
{
2073+
struct typec_switch_dev *sw;
20712074
struct typec_switch_desc sw_desc = {
20722075
.drvdata = atcphy,
20732076
.fwnode = atcphy->dev->fwnode,
20742077
.set = atcphy_sw_set,
20752078
};
20762079

2077-
return PTR_ERR_OR_ZERO(typec_switch_register(atcphy->dev, &sw_desc));
2080+
sw = typec_switch_register(atcphy->dev, &sw_desc);
2081+
if (IS_ERR(sw))
2082+
return PTR_ERR(sw);
2083+
2084+
return devm_add_action_or_reset(atcphy->dev, atcphy_typec_switch_unregister, sw);
20782085
}
20792086

20802087
static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state)
@@ -2146,15 +2153,25 @@ static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *sta
21462153
return atcphy_configure(atcphy, target_mode);
21472154
}
21482155

2156+
static void atcphy_typec_mux_unregister(void *data)
2157+
{
2158+
typec_mux_unregister(data);
2159+
}
2160+
21492161
static int atcphy_probe_mux(struct apple_atcphy *atcphy)
21502162
{
2163+
struct typec_mux_dev *mux;
21512164
struct typec_mux_desc mux_desc = {
21522165
.drvdata = atcphy,
21532166
.fwnode = atcphy->dev->fwnode,
21542167
.set = atcphy_mux_set,
21552168
};
21562169

2157-
return PTR_ERR_OR_ZERO(typec_mux_register(atcphy->dev, &mux_desc));
2170+
mux = typec_mux_register(atcphy->dev, &mux_desc);
2171+
if (IS_ERR(mux))
2172+
return PTR_ERR(mux);
2173+
2174+
return devm_add_action_or_reset(atcphy->dev, atcphy_typec_mux_unregister, mux);
21582175
}
21592176

21602177
static int atcphy_load_tunables(struct apple_atcphy *atcphy)

drivers/phy/eswin/phy-eic7700-sata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ static int eic7700_sata_phy_probe(struct platform_device *pdev)
216216
return -ENOENT;
217217

218218
regs = devm_ioremap(dev, res->start, resource_size(res));
219-
if (IS_ERR(regs))
220-
return PTR_ERR(regs);
219+
if (!regs)
220+
return -ENOMEM;
221221

222222
sata_phy->regmap = devm_regmap_init_mmio
223223
(dev, regs, &eic7700_sata_phy_regmap_config);

drivers/phy/marvell/phy-mvebu-a3700-utmi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ static int mvebu_a3700_utmi_phy_power_off(struct phy *phy)
168168
u32 reg;
169169

170170
/* Disable PHY pull-up and enable USB2 suspend */
171-
reg = readl(utmi->regs + USB2_PHY_CTRL(usb32));
172-
reg &= ~(RB_USB2PHY_PU | RB_USB2PHY_SUSPM(usb32));
173-
writel(reg, utmi->regs + USB2_PHY_CTRL(usb32));
171+
regmap_update_bits(utmi->usb_misc, USB2_PHY_CTRL(usb32),
172+
RB_USB2PHY_PU | RB_USB2PHY_SUSPM(usb32), 0);
174173

175174
/* Power down OTG module */
176175
if (usb32) {

0 commit comments

Comments
 (0)