mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-25 12:33:41 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
90 lines
2.4 KiB
C
90 lines
2.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* MUSB OTG driver host defines
|
|
*
|
|
* Copyright 2005 Mentor Graphics Corporation
|
|
* Copyright (C) 2005-2006 by Texas Instruments
|
|
* Copyright (C) 2006-2007 Nokia Corporation
|
|
*/
|
|
|
|
#ifndef _MUSB_HOST_H
|
|
#define _MUSB_HOST_H
|
|
#ifdef __UBOOT__
|
|
#include "usb-compat.h"
|
|
#endif
|
|
|
|
static inline struct usb_hcd *musb_to_hcd(struct musb *musb)
|
|
{
|
|
return container_of((void *) musb, struct usb_hcd, hcd_priv);
|
|
}
|
|
|
|
static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
|
|
{
|
|
return (struct musb *) (hcd->hcd_priv);
|
|
}
|
|
|
|
/* stored in "usb_host_endpoint.hcpriv" for scheduled endpoints */
|
|
struct musb_qh {
|
|
struct usb_host_endpoint *hep; /* usbcore info */
|
|
struct usb_device *dev;
|
|
struct musb_hw_ep *hw_ep; /* current binding */
|
|
|
|
struct list_head ring; /* of musb_qh */
|
|
/* struct musb_qh *next; */ /* for periodic tree */
|
|
u8 mux; /* qh multiplexed to hw_ep */
|
|
|
|
unsigned offset; /* in urb->transfer_buffer */
|
|
unsigned segsize; /* current xfer fragment */
|
|
|
|
u8 type_reg; /* {rx,tx} type register */
|
|
u8 intv_reg; /* {rx,tx} interval register */
|
|
u8 addr_reg; /* device address register */
|
|
u8 h_addr_reg; /* hub address register */
|
|
u8 h_port_reg; /* hub port register */
|
|
|
|
u8 is_ready; /* safe to modify hw_ep */
|
|
u8 type; /* XFERTYPE_* */
|
|
u8 epnum;
|
|
u8 hb_mult; /* high bandwidth pkts per uf */
|
|
u16 maxpacket;
|
|
u16 frame; /* for periodic schedule */
|
|
unsigned iso_idx; /* in urb->iso_frame_desc[] */
|
|
};
|
|
|
|
/* map from control or bulk queue head to the first qh on that ring */
|
|
static inline struct musb_qh *first_qh(struct list_head *q)
|
|
{
|
|
if (list_empty(q))
|
|
return NULL;
|
|
return list_entry(q->next, struct musb_qh, ring);
|
|
}
|
|
|
|
|
|
extern void musb_root_disconnect(struct musb *musb);
|
|
|
|
struct usb_hcd;
|
|
|
|
extern int musb_hub_status_data(struct usb_hcd *hcd, char *buf);
|
|
extern int musb_hub_control(struct usb_hcd *hcd,
|
|
u16 typeReq, u16 wValue, u16 wIndex,
|
|
char *buf, u16 wLength);
|
|
|
|
extern const struct hc_driver musb_hc_driver;
|
|
|
|
static inline struct urb *next_urb(struct musb_qh *qh)
|
|
{
|
|
struct list_head *queue;
|
|
|
|
if (!qh)
|
|
return NULL;
|
|
queue = &qh->hep->urb_list;
|
|
if (list_empty(queue))
|
|
return NULL;
|
|
return list_entry(queue->next, struct urb, urb_list);
|
|
}
|
|
|
|
#ifdef __UBOOT__
|
|
int musb_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
|
|
int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
|
|
#endif
|
|
#endif /* _MUSB_HOST_H */
|