Skip to content

Commit 9bcf876

Browse files
committed
Merge branch 'fixes' into next
Merge fixes into next as qmp phy patches on list depend on it
2 parents 56156a7 + 089667a commit 9bcf876

File tree

10 files changed

+57
-48
lines changed

10 files changed

+57
-48
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static const struct m31_phy_regs m31_ipq5018_regs[] = {
126126
},
127127
};
128128

129-
struct m31_phy_regs m31_ipq5332_regs[] = {
129+
static struct m31_phy_regs m31_ipq5332_regs[] = {
130130
{
131131
USB_PHY_CFG0,
132132
UTMI_PHY_OVERRIDE_EN,
@@ -216,8 +216,7 @@ static int m31usb_phy_init(struct phy *phy)
216216

217217
ret = clk_prepare_enable(qphy->clk);
218218
if (ret) {
219-
if (qphy->vreg)
220-
regulator_disable(qphy->vreg);
219+
regulator_disable(qphy->vreg);
221220
dev_err(&phy->dev, "failed to enable cfg ahb clock, %d\n", ret);
222221
return ret;
223222
}

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
@@ -1125,8 +1125,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {
11251125
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
11261126
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa),
11271127
QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c),
1128-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1129-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
11301128
QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a),
11311129
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88),
11321130
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1135,6 +1133,11 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {
11351133
QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
11361134
};
11371135

1136+
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = {
1137+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1138+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1139+
};
1140+
11381141
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11391142
QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4),
11401143
QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89),
@@ -1144,9 +1147,6 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11441147
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
11451148
QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa),
11461149
QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c),
1147-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1148-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1149-
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f),
11501150
QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a),
11511151
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88),
11521152
QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1155,6 +1155,12 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
11551155
QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
11561156
};
11571157

1158+
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = {
1159+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
1160+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
1161+
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f),
1162+
};
1163+
11581164
struct qmp_usb_offsets {
11591165
u16 serdes;
11601166
u16 pcs;
@@ -1378,6 +1384,8 @@ static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = {
13781384
.rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl),
13791385
.pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl,
13801386
.pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl),
1387+
.pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl,
1388+
.pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl),
13811389
.vreg_list = qmp_phy_vreg_l,
13821390
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
13831391
.regs = qmp_v5_usb3phy_regs_layout,
@@ -1396,6 +1404,8 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = {
13961404
.rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl),
13971405
.pcs_tbl = sc8280xp_usb3_uniphy_pcs_tbl,
13981406
.pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl),
1407+
.pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl,
1408+
.pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl),
13991409
.vreg_list = qmp_phy_vreg_l,
14001410
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
14011411
.regs = qmp_v5_usb3phy_regs_layout,
@@ -1672,6 +1682,7 @@ static int qmp_usb_power_on(struct phy *phy)
16721682
void __iomem *tx = qmp->tx;
16731683
void __iomem *rx = qmp->rx;
16741684
void __iomem *pcs = qmp->pcs;
1685+
void __iomem *pcs_usb = qmp->pcs_usb;
16751686
void __iomem *status;
16761687
unsigned int val;
16771688
int ret;
@@ -1695,6 +1706,9 @@ static int qmp_usb_power_on(struct phy *phy)
16951706

16961707
qmp_usb_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num);
16971708

1709+
if (pcs_usb)
1710+
qmp_usb_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num);
1711+
16981712
if (cfg->has_pwrdn_delay)
16991713
usleep_range(10, 20);
17001714

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)