summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-09-30 10:58:49 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-04 10:25:55 -0700
commit26ceca9750260997ab82bb84dac122de1e441658 (patch)
treec76713b8ba06a9f24a7ca3124200eaad54d44d0b /drivers
parenta32994998c2ffa161159b79bb68e683e2746c330 (diff)
downloadlinux-3.10-26ceca9750260997ab82bb84dac122de1e441658.tar.gz
linux-3.10-26ceca9750260997ab82bb84dac122de1e441658.tar.bz2
linux-3.10-26ceca9750260997ab82bb84dac122de1e441658.zip
usb: dwc3: core: cache GHWPARAMS* registers
cache the contents of GHWPARAMS* registers in our device structure for easy access. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/core.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index cfb07454812..d35f90527c3 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -229,6 +229,21 @@ static void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
}
}
+static void __devinit dwc3_cache_hwparams(struct dwc3 *dwc)
+{
+ struct dwc3_hwparams *parms = &dwc->hwparams;
+
+ parms->hwparams0 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS0);
+ parms->hwparams1 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS1);
+ parms->hwparams2 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS2);
+ parms->hwparams3 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS3);
+ parms->hwparams4 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS4);
+ parms->hwparams5 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS5);
+ parms->hwparams6 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS6);
+ parms->hwparams7 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS7);
+ parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8);
+}
+
/**
* dwc3_core_init - Low-level initialization of DWC3 Core
* @dwc: Pointer to our controller context structure
@@ -283,6 +298,8 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc)
goto err1;
}
+ dwc3_cache_hwparams(dwc);
+
return 0;
err1: