All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: Minas Harutyunyan <hminas@synopsys.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Markus Reichl <m.reichl@fivetechno.de>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, Jules Maselbas <jmaselbas@kalray.eu>
Subject: [PATCH] usb: dwc2: Use generic PHY width in params setup
Date: Tue,  7 May 2019 12:08:52 +0200	[thread overview]
Message-ID: <20190507100852.11263-2-jmaselbas@kalray.eu> (raw)
In-Reply-To: <20190507100852.11263-1-jmaselbas@kalray.eu>

Setting params.phy_utmi_width in dwc2_lowlevel_hw_init() is pointless since
it's value will be overwritten by dwc2_init_params().

This change make sure to take in account the generic PHY width information
during parmas initialization, done in dwc2_set_param_phy_utmi_width().

By doing so, the phy_utmi_width params can still be overridden by
devicetree specific params and will also be checked against hardware
capabilities.

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
 drivers/usb/dwc2/params.c   | 9 +++++++++
 drivers/usb/dwc2/platform.c | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 6900eea57526..5949262ff669 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -253,6 +253,15 @@ static void dwc2_set_param_phy_utmi_width(struct dwc2_hsotg *hsotg)
 	val = (hsotg->hw_params.utmi_phy_data_width ==
 	       GHWCFG4_UTMI_PHY_DATA_WIDTH_8) ? 8 : 16;
 
+	if (hsotg->phy) {
+		/*
+		 * If using the generic PHY framework, check if the PHY bus
+		 * width is 8-bit and set the phyif appropriately.
+		 */
+		if (phy_get_bus_width(hsotg->phy) == 8)
+			val = 8;
+	}
+
 	hsotg->params.phy_utmi_width = val;
 }
 
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index d10a7f8daec3..e98d7812da2d 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -271,15 +271,6 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
 
 	hsotg->plat = dev_get_platdata(hsotg->dev);
 
-	if (hsotg->phy) {
-		/*
-		 * If using the generic PHY framework, check if the PHY bus
-		 * width is 8-bit and set the phyif appropriately.
-		 */
-		if (phy_get_bus_width(hsotg->phy) == 8)
-			hsotg->params.phy_utmi_width = 8;
-	}
-
 	/* Clock */
 	hsotg->clk = devm_clk_get_optional(hsotg->dev, "otg");
 	if (IS_ERR(hsotg->clk)) {
-- 
2.21.0.196.g041f5ea


  reply	other threads:[~2019-05-07 10:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 20:49 [BUG BISECT] USB on Exynos4412 fails after usb: dwc2: gadget: Replace phyif with phy_utmi_width Krzysztof Kozlowski
     [not found] ` <CGME20190506130052eucas1p25afd4e15648e9efc6fd011e46081fbea@eucas1p2.samsung.com>
2019-05-06 13:00   ` [PATCH] usb: dwc2: Force 8bit UTMI width for Samsung Exynos SoCs Marek Szyprowski
2019-05-06 13:40     ` Jules Maselbas
2019-05-07  6:22     ` Minas Harutyunyan
2019-05-07  6:22       ` Minas Harutyunyan
2019-05-07  8:12     ` Markus Reichl
2019-05-07  9:17       ` Marek Szyprowski
2019-05-07 12:03         ` Marek Szyprowski
2019-05-07 12:38           ` Markus Reichl
2019-06-05  8:57     ` Krzysztof Kozlowski
2019-06-05  8:57       ` Krzysztof Kozlowski
2019-05-07  6:21 ` [BUG BISECT] USB on Exynos4412 fails after usb: dwc2: gadget: Replace phyif with phy_utmi_width Minas Harutyunyan
2019-05-07  6:21   ` Minas Harutyunyan
2019-05-07  6:43   ` Marek Szyprowski
2019-05-07  6:43     ` Marek Szyprowski
2019-05-07 10:08 ` [PATCH] usb: dwc2: Use generic PHY width in params setup Jules Maselbas
2019-05-07 10:08   ` Jules Maselbas [this message]
2019-05-07 10:54     ` Marek Szyprowski
2019-05-09  9:15     ` [PATCH v2] " Jules Maselbas
2019-05-31 12:22       ` Jules Maselbas
2019-05-31 12:44       ` Minas Harutyunyan
2019-06-06 10:13         ` Marek Szyprowski
2019-06-18  7:26           ` Felipe Balbi

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=20190507100852.11263-2-jmaselbas@kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hminas@synopsys.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.reichl@fivetechno.de \
    --cc=m.szyprowski@samsung.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.