Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: kishon@ti.com, balbi@kernel.org, khilman@baylibre.com,
	linux-amlogic@lists.infradead.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 07/14] usb: dwc3: meson-g12a: refactor usb init
Date: Fri, 27 Mar 2020 00:26:06 +0100
Message-ID: <CAFBinCBhk+XvjGODBaNH7tzCfGktYdmk1wED8UC6cYmS3ucbig@mail.gmail.com> (raw)
In-Reply-To: <20200326134507.4808-8-narmstrong@baylibre.com>

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

  reply index

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 13:44 [PATCH v2 00/14] usb: dwc3: meson: add OTG support for GXL/GXM Neil Armstrong
2020-03-26 13:44 ` [PATCH v2 01/14] dt-bindings: usb: amlogic,meson-g12a-usb-ctrl: add the Amlogic GXL and GXM Families USB Glue Bindings Neil Armstrong
2020-04-04 17:20   ` Rob Herring
2020-03-26 13:44 ` [PATCH v2 02/14] usb: dwc3: meson-g12a: specify phy names in soc data Neil Armstrong
2020-03-26 13:44 ` [PATCH v2 03/14] usb: dwc3: meson-g12a: handle the phy and glue registers separately Neil Armstrong
2020-03-26 13:44 ` [PATCH v2 04/14] usb: dwc3: meson-g12a: get the reset as shared Neil Armstrong
2020-03-26 13:44 ` [PATCH v2 05/14] usb: dwc3: meson-g12a: check return of dwc3_meson_g12a_usb_init Neil Armstrong
2020-03-26 22:57   ` Martin Blumenstingl
2020-03-26 13:44 ` [PATCH v2 06/14] usb: dwc3: meson-g12a: refactor usb2 phy init Neil Armstrong
2020-03-26 23:08   ` Martin Blumenstingl
2020-03-29 10:35     ` Felipe Balbi
2020-03-26 13:44 ` [PATCH v2 07/14] usb: dwc3: meson-g12a: refactor usb init Neil Armstrong
2020-03-26 23:26   ` Martin Blumenstingl [this message]
2020-03-31  8:44     ` Neil Armstrong
2020-03-26 13:45 ` [PATCH v2 08/14] usb: dwc3: meson-g12a: support the GXL/GXM DWC3 host phy disconnect Neil Armstrong
2020-03-26 13:45 ` [PATCH v2 09/14] usb: dwc3: meson-g12a: add support for GXL and GXM SoCs Neil Armstrong
2020-03-26 13:45 ` [PATCH v2 10/14] arm64: dts: amlogic: use the new USB control driver for GXL and GXM Neil Armstrong
2020-04-29 18:17   ` Kevin Hilman
2020-03-26 13:45 ` [PATCH v2 11/14] phy: amlogic: meson-gxl-usb3: remove code for non-existing PHY Neil Armstrong
2020-03-26 13:45 ` [PATCH v2 12/14] usb: dwc3: of-simple: remove Amlogic GXL and AXG compatibles Neil Armstrong
2020-03-26 13:45 ` [PATCH v2 13/14] doc: dt: bindings: usb: dwc3: remove amlogic compatible entries Neil Armstrong
2020-04-04 17:21   ` Rob Herring
2020-03-26 13:45 ` [PATCH v2 14/14] dt-bindings: usb: dwc3: remove old DWC3 wrapper Neil Armstrong
2020-04-04 17:21   ` Rob Herring
2020-03-29 10:36 ` [PATCH v2 00/14] usb: dwc3: meson: add OTG support for GXL/GXM Felipe Balbi
2020-03-31  8:40   ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFBinCBhk+XvjGODBaNH7tzCfGktYdmk1wED8UC6cYmS3ucbig@mail.gmail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=balbi@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=kishon@ti.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git