aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Debski <k.debski@samsung.com>2014-09-09 04:44:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-25 08:36:20 -0400
commit1b59fc7e3cda3f626204cadda8bb9b7d15f4f55b (patch)
tree5c136e5742a1b467f166bfda458f6b2e68a1bce3
parent346e2e4a8b47089f4319f114ec9ac3a95b5f0ac8 (diff)
usb: dwc2/gadget: move phy bus legth initialization
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc2/gadget.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 650a43ba79e5..94f7a3ffebd5 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3423,6 +3423,9 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
3423 if (!hsotg) 3423 if (!hsotg)
3424 return -ENOMEM; 3424 return -ENOMEM;
3425 3425
3426 /* Set default UTMI width */
3427 hsotg->phyif = GUSBCFG_PHYIF16;
3428
3426 /* 3429 /*
3427 * Attempt to find a generic PHY, then look for an old style 3430 * Attempt to find a generic PHY, then look for an old style
3428 * USB PHY, finally fall back to pdata 3431 * USB PHY, finally fall back to pdata
@@ -3441,8 +3444,15 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
3441 hsotg->plat = plat; 3444 hsotg->plat = plat;
3442 } else 3445 } else
3443 hsotg->uphy = uphy; 3446 hsotg->uphy = uphy;
3444 } else 3447 } else {
3445 hsotg->phy = phy; 3448 hsotg->phy = phy;
3449 /*
3450 * If using the generic PHY framework, check if the PHY bus
3451 * width is 8-bit and set the phyif appropriately.
3452 */
3453 if (phy_get_bus_width(phy) == 8)
3454 hsotg->phyif = GUSBCFG_PHYIF8;
3455 }
3446 3456
3447 hsotg->dev = dev; 3457 hsotg->dev = dev;
3448 3458
@@ -3502,16 +3512,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
3502 goto err_supplies; 3512 goto err_supplies;
3503 } 3513 }
3504 3514
3505 /* Set default UTMI width */
3506 hsotg->phyif = GUSBCFG_PHYIF16;
3507
3508 /*
3509 * If using the generic PHY framework, check if the PHY bus
3510 * width is 8-bit and set the phyif appropriately.
3511 */
3512 if (hsotg->phy && (phy_get_bus_width(phy) == 8))
3513 hsotg->phyif = GUSBCFG_PHYIF8;
3514
3515 /* usb phy enable */ 3515 /* usb phy enable */
3516 s3c_hsotg_phy_enable(hsotg); 3516 s3c_hsotg_phy_enable(hsotg);
3517 3517