lkml.org 
[lkml]   [2022]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 06/14] usb: core: hcd: Introduce USB HCD APIs for interrupter management
    On Fri, Dec 23, 2022 at 03:31:52PM -0800, Wesley Cheng wrote:
    > For USB HCDs that can support multiple USB interrupters, expose functions
    > that class drivers can utilize for setting up secondary interrupters.
    > Class drivers can pass this information to its respective clients, i.e.
    > a dedicated DSP.
    >
    > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
    > ---
    > drivers/usb/core/hcd.c | 86 +++++++++++++++++++++++++++++++++++++++++
    > include/linux/usb.h | 7 ++++
    > include/linux/usb/hcd.h | 16 +++++++-
    > 3 files changed, 108 insertions(+), 1 deletion(-)
    >
    > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
    > index 8300baedafd2..90ead90faf1d 100644
    > --- a/drivers/usb/core/hcd.c
    > +++ b/drivers/usb/core/hcd.c

    > +/**
    > + * usb_hcd_stop_endpoint - Halt USB EP transfers
    > + * @udev: usb device
    > + * @ep: usb ep to stop
    > + *
    > + * Stop pending transfers on a specific USB endpoint.
    > + **/
    > +int usb_hcd_stop_endpoint(struct usb_device *udev,
    > + struct usb_host_endpoint *ep)
    > +{
    > + struct usb_hcd *hcd = bus_to_hcd(udev->bus);
    > + int ret = 0;
    > +
    > + if (hcd->driver->stop_endpoint)
    > + ret = hcd->driver->stop_endpoint(hcd, udev, ep);
    > +
    > + return ret;
    > +}
    > +EXPORT_SYMBOL_GPL(usb_hcd_stop_endpoint);

    You know, there already is a function that does this. It's named
    usb_hcd_flush_endpoint(). No need to add another function that does the
    same thing.

    Alan Stern

    \
     
     \ /
      Last update: 2023-03-26 23:19    [W:4.054 / U:0.124 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site