Re: [RFCv1 4/8] phy: amlogic: meson8b-usb2: Use phy set_mode callback function
From: Martin Blumenstingl
Date: Tue Jun 22 2021 - 16:28:13 EST
Hi Anand,
On Mon, Jun 21, 2021 at 9:20 AM Anand Moon <linux.amoon@xxxxxxxxx> wrote:
[...]
> In order to enable USB phy we probably need to do a little bit
> differently than the vendor kernel.
I agree with you here, the vendor kernel is skipping most of the
frameworks which we have available in mainline Linux
> OTG port on Odroid C1+ and Odroid C2 server two purposes
> 1 > It could act as USB host port.
> 2 > It could be used as USB power on the devices, just like Raspberry pi.
> What I meant is we need some driver code to protect the power to SbC.
yep, so we need something that controls mode switching
depending on the mode the VBUS regulator needs to be enabled (HOST) or
disabled (DEVICE/PERIPHERAL).
VBUS control however is not part of the PHY - in mainline Linux either
the dwc2 driver or a USB connector driver are taking care of it.
> So I saw your work on extcon, that's the reason I would like to void
> any changes PHY right now.
I believe that this specific PHY is unrelated to mode switching.
Either it automatically detects the mode and changes it's settings
internally or the PHY settings are the same for both modes.
Since VBUS control is not the responsibility of the PHY this is
certainly possible
My changes are not ready yet but I'll ping you once I have something to test
> I observe some failures like below.
> [ 6.013859] dwc2 c9000000.usb: DWC OTG HCD URB Dequeue
> [ 6.013897] dwc2 c9000000.usb: Called usb_hcd_giveback_urb()
> [ 6.013902] dwc2 c9000000.usb: urb->status = -115
-115 is -EINPROGRESS but I am not sure if/when that's a bad thing or
to be expected
Best regards,
Martin