diff mbox series

[v10,13/18] phy: sun4i-usb: Allow reset line to be shared

Message ID 20220211122643.1343315-14-andre.przywara@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: sunxi: Initial Allwinner H616 SoC support | expand

Commit Message

Andre Przywara Feb. 11, 2022, 12:26 p.m. UTC
The USB HCIs (and PHYs?) in Allwinner's newer generation SoCs (H616)
rely on the reset line of USB PHY 2 to be de-asserted, even when only
one of the other PHYs is actually in use.

To make those ports work, we include this reset line in the HCIs' resets
property, which requires this line to be shareable.

Change the call to allocate the reset line to mark it as shared, to
enable the other ports on those SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Samuel Holland Feb. 23, 2022, 3:44 a.m. UTC | #1
On 2/11/22 6:26 AM, Andre Przywara wrote:
> The USB HCIs (and PHYs?) in Allwinner's newer generation SoCs (H616)
> rely on the reset line of USB PHY 2 to be de-asserted, even when only
> one of the other PHYs is actually in use.

Thankfully, so far this appears to be a quirk of H616 only.

> To make those ports work, we include this reset line in the HCIs' resets
> property, which requires this line to be shareable.
> 
> Change the call to allocate the reset line to mark it as shared, to
> enable the other ports on those SoCs.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Samuel Holland <samuel@sholland.org>
Samuel Holland Feb. 23, 2022, 3:50 a.m. UTC | #2
Hi Andre,

On 2/22/22 9:44 PM, Samuel Holland wrote:
> On 2/11/22 6:26 AM, Andre Przywara wrote:
>> The USB HCIs (and PHYs?) in Allwinner's newer generation SoCs (H616)
>> rely on the reset line of USB PHY 2 to be de-asserted, even when only
>> one of the other PHYs is actually in use.
> 
> Thankfully, so far this appears to be a quirk of H616 only.
> 
>> To make those ports work, we include this reset line in the HCIs' resets
>> property, which requires this line to be shareable.

Looking at your .dtsi patch 16/18, you don't actually do this. Is this patch not
needed anymore?

Regards,
Samuel

>> Change the call to allocate the reset line to mark it as shared, to
>> enable the other ports on those SoCs.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> Acked-by: Samuel Holland <samuel@sholland.org>
>
diff mbox series

Patch

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 142f4cafdc78..126ef74d013c 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -788,7 +788,7 @@  static int sun4i_usb_phy_probe(struct platform_device *pdev)
 		}
 
 		snprintf(name, sizeof(name), "usb%d_reset", i);
-		phy->reset = devm_reset_control_get(dev, name);
+		phy->reset = devm_reset_control_get_shared(dev, name);
 		if (IS_ERR(phy->reset)) {
 			dev_err(dev, "failed to get reset %s\n", name);
 			return PTR_ERR(phy->reset);