[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCBhk+XvjGODBaNH7tzCfGktYdmk1wED8UC6cYmS3ucbig@mail.gmail.com>
Date: Fri, 27 Mar 2020 00:26:06 +0100
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Neil Armstrong <narmstrong@...libre.com>
Cc: kishon@...com, balbi@...nel.org, khilman@...libre.com,
linux-amlogic@...ts.infradead.org, linux-usb@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [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@...libre.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
Powered by blists - more mailing lists