lkml.org 
[lkml]   [2020]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 07/14] usb: dwc3: meson-g12a: refactor usb init
Hi Neil,

On Thu, Mar 26, 2020 at 2:45 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
[...]
> -static int dwc3_meson_g12a_usb2_init(struct dwc3_meson_g12a *priv)
> +static int dwc3_meson_g12a_usb2_init(struct dwc3_meson_g12a *priv,
> + enum phy_mode mode)
> {
> int i, ret;
>
> - if (priv->otg_mode == USB_DR_MODE_PERIPHERAL)
> - priv->otg_phy_mode = PHY_MODE_USB_DEVICE;
> - else
> - priv->otg_phy_mode = PHY_MODE_USB_HOST;
> -
> for (i = 0; i < priv->drvdata->num_phys; ++i) {
> if (!priv->phys[i])
> continue;
> @@ -284,9 +286,10 @@ static void dwc3_meson_g12a_usb3_init(struct dwc3_meson_g12a *priv)
> FIELD_PREP(USB_R1_P30_PCS_TX_SWING_FULL_MASK, 127));
> }
There is something strange with dwc3_meson_g12a_usb2_init.
enum phy_mode mode is added here but it's not used inside this function

I also think that we should not pass enum phy_mode to
dwc3_meson_g12a_usb_otg_apply_mode
I'm aware that the original function used enum phy_mode inside but
this doesn't seem right:
we're not configuring a PHY there
instead we're setting up the OTG switch so I think we should use enum
usb_role instead

[...]
not part of this patch but should be:
there's a still a direct call to dwc3_meson_g12a_usb_init() in
dwc3_meson_g12a_resume()
I think that needs to be changed to priv->drvdata->usb_init(priv); as well

\
 
 \ /
  Last update: 2020-03-27 00:27    [W:0.257 / U:2.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site