usb: dwc3: enable hibernation if to be supported
authorHuang Rui <ray.huang@amd.com>
Tue, 28 Oct 2014 11:54:22 +0000 (19:54 +0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:03:35 +0000 (10:03 -0600)
It enables hibernation if the function is set in coreConsultant.

Suggested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/core.c

index fa396fc57a85ad24327bcad3864126b7b70cac39..2f7aecc620e7bd9d5ee822fbfc665affb2efae4c 100644 (file)
@@ -449,6 +449,12 @@ static int dwc3_core_init(struct dwc3 *dwc)
        case DWC3_GHWPARAMS1_EN_PWROPT_HIB:
                /* enable hibernation here */
                dwc->nr_scratch = DWC3_GHWPARAMS4_HIBER_SCRATCHBUFS(hwparams4);
+
+               /*
+                * REVISIT Enabling this bit so that host-mode hibernation
+                * will work. Device-mode hibernation is not yet implemented.
+                */
+               reg |= DWC3_GCTL_GBLHIBERNATIONEN;
                break;
        default:
                dev_dbg(dwc->dev, "No power optimization available\n");