aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2016-10-20 00:19:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-24 08:35:46 -0400
commitb76032396d7958f006bccf5fb2535beb5526837c (patch)
treea445204f4d0a5bdf22f02741b373a56a700e11ea /drivers
parented6d6f8f42d7302f6f9b6245f34927ec20d26c12 (diff)
usb: renesas_usbhs: add wait after initialization for R-Car Gen3
Since the controller on R-Car Gen3 doesn't have any status registers to detect initialization (LPSTS.SUSPM = 1) and the initialization needs up to 45 usec, this patch adds wait after the initialization. Otherwise, writing other registers (e.g. INTENB0) will fail. Fixes: de18757e272d ("usb: renesas_usbhs: add R-Car Gen3 power control") Cc: <stable@vger.kernel.org> # v4.6+ Cc: <balbi@kernel.org> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/renesas_usbhs/rcar3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/rcar3.c b/drivers/usb/renesas_usbhs/rcar3.c
index 1d70add926f0..d544b331c9f2 100644
--- a/drivers/usb/renesas_usbhs/rcar3.c
+++ b/drivers/usb/renesas_usbhs/rcar3.c
@@ -9,6 +9,7 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/delay.h>
12#include <linux/io.h> 13#include <linux/io.h>
13#include "common.h" 14#include "common.h"
14#include "rcar3.h" 15#include "rcar3.h"
@@ -35,10 +36,13 @@ static int usbhs_rcar3_power_ctrl(struct platform_device *pdev,
35 36
36 usbhs_write32(priv, UGCTRL2, UGCTRL2_RESERVED_3 | UGCTRL2_USB0SEL_OTG); 37 usbhs_write32(priv, UGCTRL2, UGCTRL2_RESERVED_3 | UGCTRL2_USB0SEL_OTG);
37 38
38 if (enable) 39 if (enable) {
39 usbhs_bset(priv, LPSTS, LPSTS_SUSPM, LPSTS_SUSPM); 40 usbhs_bset(priv, LPSTS, LPSTS_SUSPM, LPSTS_SUSPM);
40 else 41 /* The controller on R-Car Gen3 needs to wait up to 45 usec */
42 udelay(45);
43 } else {
41 usbhs_bset(priv, LPSTS, LPSTS_SUSPM, 0); 44 usbhs_bset(priv, LPSTS, LPSTS_SUSPM, 0);
45 }
42 46
43 return 0; 47 return 0;
44} 48}