Skip to content

Commit bbb28a1

Browse files
andredvinodkoul
authored andcommitted
phy: exynos5-usbdrd: support isolating HS and SS ports independently
Some versions of this IP have been integrated using separate PMU power control registers for the HS and SS parts. One example is the Google Tensor gs101 SoC. Such SoCs can now set pmu_offset_usbdrd0_phy_ss in their exynos5_usbdrd_phy_drvdata for the SS phy to the appropriate value. The existing 'usbdrdphy' alias can not be used in this case because that is meant for determining the correct PMU offset if multiple distinct PHYs exist in the system (as opposed to one PHY with multiple isolators). Signed-off-by: André Draszik <[email protected]> Tested-by: Will McVicker <[email protected]> Reviewed-by: Peter Griffin <[email protected]> Tested-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e340c04 commit bbb28a1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

drivers/phy/samsung/phy-exynos5-usbdrd.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ struct exynos5_usbdrd_phy_drvdata {
186186
const struct exynos5_usbdrd_phy_config *phy_cfg;
187187
const struct phy_ops *phy_ops;
188188
u32 pmu_offset_usbdrd0_phy;
189+
u32 pmu_offset_usbdrd0_phy_ss;
189190
u32 pmu_offset_usbdrd1_phy;
190191
bool has_common_clk_gate;
191192
};
@@ -1065,16 +1066,6 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
10651066
if (channel < 0)
10661067
dev_dbg(dev, "Not a multi-controller usbdrd phy\n");
10671068

1068-
switch (channel) {
1069-
case 1:
1070-
pmu_offset = phy_drd->drv_data->pmu_offset_usbdrd1_phy;
1071-
break;
1072-
case 0:
1073-
default:
1074-
pmu_offset = phy_drd->drv_data->pmu_offset_usbdrd0_phy;
1075-
break;
1076-
}
1077-
10781069
/* Get Vbus regulators */
10791070
phy_drd->vbus = devm_regulator_get(dev, "vbus");
10801071
if (IS_ERR(phy_drd->vbus)) {
@@ -1109,6 +1100,18 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
11091100
phy_drd->phys[i].phy = phy;
11101101
phy_drd->phys[i].index = i;
11111102
phy_drd->phys[i].reg_pmu = reg_pmu;
1103+
switch (channel) {
1104+
case 1:
1105+
pmu_offset = drv_data->pmu_offset_usbdrd1_phy;
1106+
break;
1107+
case 0:
1108+
default:
1109+
pmu_offset = drv_data->pmu_offset_usbdrd0_phy;
1110+
if (i == EXYNOS5_DRDPHY_PIPE3 && drv_data
1111+
->pmu_offset_usbdrd0_phy_ss)
1112+
pmu_offset = drv_data->pmu_offset_usbdrd0_phy_ss;
1113+
break;
1114+
}
11121115
phy_drd->phys[i].pmu_offset = pmu_offset;
11131116
phy_drd->phys[i].phy_cfg = &drv_data->phy_cfg[i];
11141117
phy_set_drvdata(phy, &phy_drd->phys[i]);

0 commit comments

Comments
 (0)