xhci: Add helper to set an interrupters interrupt moderation interval
authorMathias Nyman <mathias.nyman@linux.intel.com>
Sat, 17 Feb 2024 00:09:28 +0000 (16:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 15:24:37 +0000 (16:24 +0100)
commitace21625878f78708b75b7a872ec7a0e2ed15ca4
treed00a2ca38e5272291e89bb5523bc583e02b691d2
parent4f022aad80dc8b175e309197720f4fca8004fb2e
xhci: Add helper to set an interrupters interrupt moderation interval

Add a helper to set the interrupt moderation interval for an interrupter.
Each interrupter can have its own moderation value.

Hardware has a 16bit register for the moderation value, each step is 250ns.

Helper function imod_interval argument is in nanoseconds.

Values from 0 to 16383750 (250 x 0xffff) are accepted.
0 means no interrupt throttling.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20240217001017.29969-3-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c