From: Felipe Balbi Date: Fri, 19 Sep 2014 20:51:11 +0000 (-0500) Subject: usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fa0ea13e9f1c2b4707879ca3dbe4cf29c741857a;p=openwrt%2Fstaging%2Fblogic.git usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register DWC3's GUID register is supposed to be used to write any sort of version we might want. It helps when getting bug reports for platforms you don't have HW to know which kernel version of the driver was running on the platform. Because we don't really track driver version, but we _do_ track the kernel version, let's write LINUX_VERSION_CODE to that register and use it for debugging. Reviewed-by: Paul Zimmerman Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b0f4d52b7f04..ddfe7718e4a3 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -19,6 +19,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -384,6 +385,12 @@ static int dwc3_core_init(struct dwc3 *dwc) } dwc->revision = reg; + /* + * Write Linux Version Code to our GUID register so it's easy to figure + * out which kernel version a bug was found. + */ + dwc3_writel(dwc->regs, DWC3_GUID, LINUX_VERSION_CODE); + /* Handle USB2.0-only core configuration */ if (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) == DWC3_GHWPARAMS3_SSPHY_IFC_DIS) {