Skip to content

Commit fe3cfe8

Browse files
committed
Merge tag 'phy-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy fixes from Vinod Koul: - mapphone-mdm6600 runtime pm & pinctrl handling fixes - Qualcomm qmp usb pcs register fixes, qmp pcie register size warning fix, m31 fixes for wrong pointer in PTR_ERR and dropping wrong vreg check, qmp combo fix for 8550 power config register - realtek usb fix for debugfs_create_dir() and kconfig dependency * tag 'phy-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: realtek: Realtek PHYs should depend on ARCH_REALTEK phy: qualcomm: Fix typos in comments phy: qcom-qmp-combo: initialize PCS_USB registers phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 phy: qcom: m31: Remove unwanted qphy->vreg is NULL check phy: realtek: usb: Drop unnecessary error check for debugfs_create_dir() phy: qcom: phy-qcom-m31: change m31_ipq5332_regs to static phy: qcom: phy-qcom-m31: fix wrong pointer pass to PTR_ERR() dt-bindings: phy: qcom,ipq8074-qmp-pcie: fix warning regarding reg size phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p phy: qcom-qmp-usb: initialize PCS_USB registers phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins phy: mapphone-mdm6600: Fix runtime PM for remove phy: mapphone-mdm6600: Fix runtime disable on probe
2 parents 70e65af + 089667a commit fe3cfe8

File tree

10 files changed

+58
-49
lines changed

10 files changed

+58
-49
lines changed

Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ examples:
7070
7171
phy@84000 {
7272
compatible = "qcom,ipq6018-qmp-pcie-phy";
73-
reg = <0x0 0x00084000 0x0 0x1000>;
73+
reg = <0x00084000 0x1000>;
7474
7575
clocks = <&gcc GCC_PCIE0_AUX_CLK>,
7676
<&gcc GCC_PCIE0_AHB_CLK>,

drivers/phy/motorola/phy-mapphone-mdm6600.c

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,10 @@ static int phy_mdm6600_power_on(struct phy *x)
122122
{
123123
struct phy_mdm6600 *ddata = phy_get_drvdata(x);
124124
struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
125-
int error;
126125

127126
if (!ddata->enabled)
128127
return -ENODEV;
129128

130-
error = pinctrl_pm_select_default_state(ddata->dev);
131-
if (error)
132-
dev_warn(ddata->dev, "%s: error with default_state: %i\n",
133-
__func__, error);
134-
135129
gpiod_set_value_cansleep(enable_gpio, 1);
136130

137131
/* Allow aggressive PM for USB, it's only needed for n_gsm port */
@@ -160,11 +154,6 @@ static int phy_mdm6600_power_off(struct phy *x)
160154

161155
gpiod_set_value_cansleep(enable_gpio, 0);
162156

163-
error = pinctrl_pm_select_sleep_state(ddata->dev);
164-
if (error)
165-
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
166-
__func__, error);
167-
168157
return 0;
169158
}
170159

@@ -456,6 +445,7 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
456445
{
457446
struct gpio_desc *reset_gpio =
458447
ddata->ctrl_gpios[PHY_MDM6600_RESET];
448+
int error;
459449

460450
ddata->enabled = false;
461451
phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_BP_SHUTDOWN_REQ);
@@ -471,6 +461,17 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
471461
} else {
472462
dev_err(ddata->dev, "Timed out powering down\n");
473463
}
464+
465+
/*
466+
* Keep reset gpio high with padconf internal pull-up resistor to
467+
* prevent modem from waking up during deeper SoC idle states. The
468+
* gpio bank lines can have glitches if not in the always-on wkup
469+
* domain.
470+
*/
471+
error = pinctrl_pm_select_sleep_state(ddata->dev);
472+
if (error)
473+
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
474+
__func__, error);
474475
}
475476

476477
static void phy_mdm6600_deferred_power_on(struct work_struct *work)
@@ -571,12 +572,6 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
571572
ddata->dev = &pdev->dev;
572573
platform_set_drvdata(pdev, ddata);
573574

574-
/* Active state selected in phy_mdm6600_power_on() */
575-
error = pinctrl_pm_select_sleep_state(ddata->dev);
576-
if (error)
577-
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
578-
__func__, error);
579-
580575
error = phy_mdm6600_init_lines(ddata);
581576
if (error)
582577
return error;
@@ -627,10 +622,12 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
627622
pm_runtime_put_autosuspend(ddata->dev);
628623

629624
cleanup:
630-
if (error < 0)
625+
if (error < 0) {
631626
phy_mdm6600_device_power_off(ddata);
632-
pm_runtime_disable(ddata->dev);
633-
pm_runtime_dont_use_autosuspend(ddata->dev);
627+
pm_runtime_disable(ddata->dev);
628+
pm_runtime_dont_use_autosuspend(ddata->dev);
629+
}
630+
634631
return error;
635632
}
636633

@@ -639,6 +636,7 @@ static void phy_mdm6600_remove(struct platform_device *pdev)
639636
struct phy_mdm6600 *ddata = platform_get_drvdata(pdev);
640637
struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];
641638

639+
pm_runtime_get_noresume(ddata->dev);
642640
pm_runtime_dont_use_autosuspend(ddata->dev);
643641
pm_runtime_put_sync(ddata->dev);
644642
pm_runtime_disable(ddata->dev);

drivers/phy/qualcomm/phy-qcom-apq8064-sata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int qcom_apq8064_sata_phy_init(struct phy *generic_phy)
152152
return ret;
153153
}
154154

155-
/* SATA phy calibrated succesfully, power up to functional mode */
155+
/* SATA phy calibrated successfully, power up to functional mode */
156156
writel_relaxed(0x3E, base + SATA_PHY_POW_DWN_CTRL1);
157157
writel_relaxed(0x01, base + SATA_PHY_RX_IMCAL0);
158158
writel_relaxed(0x01, base + SATA_PHY_TX_IMCAL0);

drivers/phy/qualcomm/phy-qcom-m31.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct m31_priv_data {
8282
unsigned int nregs;
8383
};
8484

85-
struct m31_phy_regs m31_ipq5332_regs[] = {
85+
static struct m31_phy_regs m31_ipq5332_regs[] = {
8686
{
8787
USB_PHY_CFG0,
8888
UTMI_PHY_OVERRIDE_EN,
@@ -172,8 +172,7 @@ static int m31usb_phy_init(struct phy *phy)
172172

173173
ret = clk_prepare_enable(qphy->clk);
174174
if (ret) {
175-
if (qphy->vreg)
176-
regulator_disable(qphy->vreg);
175+
regulator_disable(qphy->vreg);
177176
dev_err(&phy->dev, "failed to enable cfg ahb clock, %d\n", ret);
178177
return ret;
179178
}
@@ -256,7 +255,7 @@ static int m31usb_phy_probe(struct platform_device *pdev)
256255

257256
qphy->vreg = devm_regulator_get(dev, "vdda-phy");
258257
if (IS_ERR(qphy->vreg))
259-
return dev_err_probe(dev, PTR_ERR(qphy->phy),
258+
return dev_err_probe(dev, PTR_ERR(qphy->vreg),
260259
"failed to get vreg\n");
261260

262261
phy_set_drvdata(qphy->phy, qphy);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,10 @@ static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = {
859859
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
860860
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b),
861861
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10),
862-
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
863862
};
864863

865864
static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = {
865+
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
866866
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
867867
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
868868
QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40),
@@ -2555,6 +2555,7 @@ static int qmp_combo_usb_power_on(struct phy *phy)
25552555
void __iomem *tx2 = qmp->tx2;
25562556
void __iomem *rx2 = qmp->rx2;
25572557
void __iomem *pcs = qmp->pcs;
2558+
void __iomem *pcs_usb = qmp->pcs_usb;
25582559
void __iomem *status;
25592560
unsigned int val;
25602561
int ret;
@@ -2576,6 +2577,9 @@ static int qmp_combo_usb_power_on(struct phy *phy)
25762577

25772578
qmp_combo_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num);
25782579

2580+
if (pcs_usb)
2581+
qmp_combo_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num);
2582+
25792583
if (cfg->has_pwrdn_delay)
25802584
usleep_range(10, 20);
25812585

drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc
1313
#define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8
1414
#define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc
15-
#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x90
15+
#define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90
1616
#define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188
1717
#define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
1818
#define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
@@ -23,6 +23,7 @@
2323
#define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc
2424
#define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec
2525

26+
#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x00
2627
#define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18
2728
#define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c
2829
#define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {
11121112
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
11131113
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa),
11141114
QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c),
1115-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1116-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
11171115
QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a),
11181116
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88),
11191117
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1122,6 +1120,11 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {
11221120
QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
11231121
};
11241122

1123+
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = {
1124+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1125+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1126+
};
1127+
11251128
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11261129
QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4),
11271130
QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89),
@@ -1131,9 +1134,6 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11311134
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
11321135
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa),
11331136
QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c),
1134-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1135-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1136-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f),
11371137
QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a),
11381138
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88),
11391139
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1142,6 +1142,12 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11421142
QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
11431143
};
11441144

1145+
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = {
1146+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1147+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1148+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f),
1149+
};
1150+
11451151
struct qmp_usb_offsets {
11461152
u16 serdes;
11471153
u16 pcs;
@@ -1383,6 +1389,8 @@ static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = {
13831389
.rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl),
13841390
.pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl,
13851391
.pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl),
1392+
.pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl,
1393+
.pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl),
13861394
.clk_list = qmp_v4_phy_clk_l,
13871395
.num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l),
13881396
.reset_list = qcm2290_usb3phy_reset_l,
@@ -1405,6 +1413,8 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = {
14051413
.rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl),
14061414
.pcs_tbl = sc8280xp_usb3_uniphy_pcs_tbl,
14071415
.pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl),
1416+
.pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl,
1417+
.pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl),
14081418
.clk_list = qmp_v4_phy_clk_l,
14091419
.num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l),
14101420
.reset_list = qcm2290_usb3phy_reset_l,
@@ -1703,6 +1713,7 @@ static int qmp_usb_power_on(struct phy *phy)
17031713
void __iomem *tx = qmp->tx;
17041714
void __iomem *rx = qmp->rx;
17051715
void __iomem *pcs = qmp->pcs;
1716+
void __iomem *pcs_usb = qmp->pcs_usb;
17061717
void __iomem *status;
17071718
unsigned int val;
17081719
int ret;
@@ -1726,6 +1737,9 @@ static int qmp_usb_power_on(struct phy *phy)
17261737

17271738
qmp_usb_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num);
17281739

1740+
if (pcs_usb)
1741+
qmp_usb_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num);
1742+
17291743
if (cfg->has_pwrdn_delay)
17301744
usleep_range(10, 20);
17311745

drivers/phy/realtek/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# Phy drivers for Realtek platforms
44
#
5+
6+
if ARCH_REALTEK || COMPILE_TEST
7+
58
config PHY_RTK_RTD_USB2PHY
69
tristate "Realtek RTD USB2 PHY Transceiver Driver"
710
depends on USB_SUPPORT
@@ -25,3 +28,5 @@ config PHY_RTK_RTD_USB3PHY
2528
The DHC (digital home center) RTD series SoCs used the Synopsys
2629
DWC3 USB IP. This driver will do the PHY initialization
2730
of the parameters.
31+
32+
endif # ARCH_REALTEK || COMPILE_TEST

drivers/phy/realtek/phy-rtk-usb2.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -853,17 +853,11 @@ static inline void create_debug_files(struct rtk_phy *rtk_phy)
853853

854854
rtk_phy->debug_dir = debugfs_create_dir(dev_name(rtk_phy->dev),
855855
phy_debug_root);
856-
if (!rtk_phy->debug_dir)
857-
return;
858856

859-
if (!debugfs_create_file("parameter", 0444, rtk_phy->debug_dir, rtk_phy,
860-
&rtk_usb2_parameter_fops))
861-
goto file_error;
857+
debugfs_create_file("parameter", 0444, rtk_phy->debug_dir, rtk_phy,
858+
&rtk_usb2_parameter_fops);
862859

863860
return;
864-
865-
file_error:
866-
debugfs_remove_recursive(rtk_phy->debug_dir);
867861
}
868862

869863
static inline void remove_debug_files(struct rtk_phy *rtk_phy)

drivers/phy/realtek/phy-rtk-usb3.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,17 +416,11 @@ static inline void create_debug_files(struct rtk_phy *rtk_phy)
416416
return;
417417

418418
rtk_phy->debug_dir = debugfs_create_dir(dev_name(rtk_phy->dev), phy_debug_root);
419-
if (!rtk_phy->debug_dir)
420-
return;
421419

422-
if (!debugfs_create_file("parameter", 0444, rtk_phy->debug_dir, rtk_phy,
423-
&rtk_usb3_parameter_fops))
424-
goto file_error;
420+
debugfs_create_file("parameter", 0444, rtk_phy->debug_dir, rtk_phy,
421+
&rtk_usb3_parameter_fops);
425422

426423
return;
427-
428-
file_error:
429-
debugfs_remove_recursive(rtk_phy->debug_dir);
430424
}
431425

432426
static inline void remove_debug_files(struct rtk_phy *rtk_phy)

0 commit comments

Comments
 (0)