OSDN Git Service

usb: dwc2: Backup and restore PCGCCTL1 register
authorRazmik Karapetyan <razmik@synopsys.com>
Wed, 24 Jan 2018 13:40:56 +0000 (17:40 +0400)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 13 Mar 2018 08:47:47 +0000 (10:47 +0200)
Backup PCGCCTL1 register when entering hibernation mode and
restore it after exiting from hibernation, to keep active ACG
feature.

Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/core.c
drivers/usb/dwc2/core.h

index 204506f..3461509 100644 (file)
@@ -80,6 +80,7 @@ static int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg)
        gr->gnptxfsiz = dwc2_readl(hsotg->regs + GNPTXFSIZ);
        gr->hptxfsiz = dwc2_readl(hsotg->regs + HPTXFSIZ);
        gr->gdfifocfg = dwc2_readl(hsotg->regs + GDFIFOCFG);
+       gr->pcgcctl1 = dwc2_readl(hsotg->regs + PCGCCTL1);
        for (i = 0; i < MAX_EPS_CHANNELS; i++)
                gr->dtxfsiz[i] = dwc2_readl(hsotg->regs + DPTXFSIZN(i));
 
@@ -119,6 +120,7 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg)
        dwc2_writel(gr->gnptxfsiz, hsotg->regs + GNPTXFSIZ);
        dwc2_writel(gr->hptxfsiz, hsotg->regs + HPTXFSIZ);
        dwc2_writel(gr->gdfifocfg, hsotg->regs + GDFIFOCFG);
+       dwc2_writel(gr->pcgcctl1, hsotg->regs + PCGCCTL1);
        for (i = 0; i < MAX_EPS_CHANNELS; i++)
                dwc2_writel(gr->dtxfsiz[i], hsotg->regs + DPTXFSIZN(i));
 
index a7033b9..f6daa58 100644 (file)
@@ -628,6 +628,7 @@ struct dwc2_gregs_backup {
        u32 gi2cctl;
        u32 hptxfsiz;
        u32 pcgcctl;
+       u32 pcgcctl1;
        u32 gdfifocfg;
        u32 dtxfsiz[MAX_EPS_CHANNELS];
        u32 gpwrdn;