summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/hcd.h
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2016-01-28 18:19:58 -0800
committerFelipe Balbi <balbi@kernel.org>2016-03-04 15:14:41 +0200
commit74fc4a7558f859e89b849cc87afed38f517ded9a (patch)
treeaf2db4a91021e7b499bd66cf811b4f410adaccba /drivers/usb/dwc2/hcd.h
parentc9c8ac0150df2b75b25683cd3df3cb56877e4e52 (diff)
downloadlinux-74fc4a7558f859e89b849cc87afed38f517ded9a.tar.gz
linux-74fc4a7558f859e89b849cc87afed38f517ded9a.tar.bz2
linux-74fc4a7558f859e89b849cc87afed38f517ded9a.zip
usb: dwc2: host: Add scheduler tracing
In preparation for future changes to the scheduler let's add some tracing that makes it easy for us to see what's happening. By default this tracing will be off. By changing "core.h" you can easily trace to ftrace, the console, or nowhere. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/dwc2/hcd.h')
-rw-r--r--drivers/usb/dwc2/hcd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h
index 1b46e2e617cc..809bc4ff9116 100644
--- a/drivers/usb/dwc2/hcd.h
+++ b/drivers/usb/dwc2/hcd.h
@@ -563,6 +563,11 @@ static inline u16 dwc2_frame_num_inc(u16 frame, u16 inc)
return (frame + inc) & HFNUM_MAX_FRNUM;
}
+static inline u16 dwc2_frame_num_dec(u16 frame, u16 dec)
+{
+ return (frame + HFNUM_MAX_FRNUM + 1 - dec) & HFNUM_MAX_FRNUM;
+}
+
static inline u16 dwc2_full_frame_num(u16 frame)
{
return (frame & HFNUM_MAX_FRNUM) >> 3;