linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Baldyga <r.baldyga@samsung.com>
To: balbi@ti.com
Cc: paulz@synopsys.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	m.szyprowski@samsung.com, andrzej.p@samsung.com,
	Kamil Debski <k.debski@samsung.com>,
	Robert Baldyga <r.baldyga@samsung.com>
Subject: [PATCH v2 03/12] usb: dwc2/gadget: move phy bus legth initialization
Date: Wed, 16 Jul 2014 12:22:21 +0200	[thread overview]
Message-ID: <1405506150-16185-4-git-send-email-r.baldyga@samsung.com> (raw)
In-Reply-To: <1405506150-16185-1-git-send-email-r.baldyga@samsung.com>

From: Kamil Debski <k.debski@samsung.com>

This patch moves the part of code that initializes the PHY bus width.
This results in simpler code and removes the need to check whether
the Generic PHY Framework is used.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
 drivers/usb/dwc2/gadget.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 70eab95..fc27b4c 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3395,6 +3395,9 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	/* Set default UTMI width */
+	hsotg->phyif = GUSBCFG_PHYIF16;
+
 	/*
 	 * Attempt to find a generic PHY, then look for an old style
 	 * USB PHY, finally fall back to pdata
@@ -3413,8 +3416,15 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
 			hsotg->plat = plat;
 		} else
 			hsotg->uphy = uphy;
-	} else
+	} else {
 		hsotg->phy = 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(phy) == 8)
+			hsotg->phyif = GUSBCFG_PHYIF8;
+	}
 
 	hsotg->dev = dev;
 
@@ -3481,16 +3491,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
 		goto err_supplies;
 	}
 
-	/* Set default UTMI width */
-	hsotg->phyif = GUSBCFG_PHYIF16;
-
-	/*
-	 * If using the generic PHY framework, check if the PHY bus
-	 * width is 8-bit and set the phyif appropriately.
-	 */
-	if (hsotg->phy && (phy_get_bus_width(phy) == 8))
-		hsotg->phyif = GUSBCFG_PHYIF8;
-
 	/* usb phy enable */
 	s3c_hsotg_phy_enable(hsotg);
 
-- 
1.9.1


  parent reply	other threads:[~2014-07-16 10:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 10:22 [PATCH v2 00/12] usb: dwc2/gadget: fix series Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 01/12] usb: dwc2/gadget: fix phy disable sequence Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 02/12] usb: dwc2/gadget: fix phy initialization sequence Robert Baldyga
2014-07-16 10:22 ` Robert Baldyga [this message]
2014-07-16 10:22 ` [PATCH v2 04/12] usb: dwc2/gadget: Fix comment text Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 05/12] usb: dwc2/gadget: hide some not really needed debug messages Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 06/12] usb: dwc2/gadget: ensure that all fifos have correct memory buffers Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 07/12] usb: dwc2/gadget: break infinite loop in endpoint disable code Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 08/12] usb: dwc2/gadget: do not call disconnect method in pullup Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 09/12] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 10/12] usb: dwc2/gadget: assign TX FIFO dynamically Robert Baldyga
2014-07-16 19:58   ` Paul Zimmerman
2014-07-16 20:22     ` Paul Zimmerman
2014-07-18 11:07     ` Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 11/12] usb: dwc2/gadget: disable clock when it's not needed Robert Baldyga
2014-07-16 10:22 ` [PATCH v2 12/12] usb: dwc2/gadget: avoid disabling ep0 Robert Baldyga
2014-07-17  0:27 ` [PATCH v2 00/12] usb: dwc2/gadget: fix series Paul Zimmerman

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=1405506150-16185-4-git-send-email-r.baldyga@samsung.com \
    --to=r.baldyga@samsung.com \
    --cc=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.debski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=paulz@synopsys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).