Commit 551a8ac6 authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

usb: chipidea: brush up structure definitions

Get rid of trailing comments in the structure definitions in favor of
kernel-doc.
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8c1376c
...@@ -27,25 +27,38 @@ ...@@ -27,25 +27,38 @@
/****************************************************************************** /******************************************************************************
* STRUCTURES * STRUCTURES
*****************************************************************************/ *****************************************************************************/
/* Extension of usb_ep */ /**
* struct ci13xxx_ep - endpoint representation
* @ep: endpoint structure for gadget drivers
* @dir: endpoint direction (TX/RX)
* @num: endpoint number
* @type: endpoint type
* @name: string description of the endpoint
* @qh: queue head for this endpoint
* @wedge: is the endpoint wedged
* @udc: pointer to the controller
* @lock: pointer to controller's spinlock
* @device: pointer to gadget's struct device
* @td_pool: pointer to controller's TD pool
*/
struct ci13xxx_ep { struct ci13xxx_ep {
struct usb_ep ep; struct usb_ep ep;
u8 dir; u8 dir;
u8 num; u8 num;
u8 type; u8 type;
char name[16]; char name[16];
struct { struct {
struct list_head queue; struct list_head queue;
struct ci13xxx_qh *ptr; struct ci13xxx_qh *ptr;
dma_addr_t dma; dma_addr_t dma;
} qh; } qh;
int wedge; int wedge;
/* global resources */ /* global resources */
struct ci13xxx *udc; struct ci13xxx *udc;
spinlock_t *lock; spinlock_t *lock;
struct device *device; struct device *device;
struct dma_pool *td_pool; struct dma_pool *td_pool;
}; };
enum ci_role { enum ci_role {
...@@ -68,48 +81,85 @@ struct ci_role_driver { ...@@ -68,48 +81,85 @@ struct ci_role_driver {
const char *name; const char *name;
}; };
/**
* struct hw_bank - hardware register mapping representation
* @lpm: set if the device is LPM capable
* @abs: absolute address of the beginning of register window
* @cap: capability registers
* @op: operational registers
* @size: size of the register window
* @regmap: register lookup table
*/
struct hw_bank { struct hw_bank {
unsigned lpm; /* is LPM? */ unsigned lpm;
void __iomem *abs; /* bus map offset */ void __iomem *abs;
void __iomem *cap; /* bus map offset + CAP offset */ void __iomem *cap;
void __iomem *op; /* bus map offset + OP offset */ void __iomem *op;
size_t size; /* bank size */ size_t size;
void __iomem **regmap; void __iomem **regmap;
}; };
/* CI13XXX UDC descriptor & global resources */ /**
* struct ci13xxx - chipidea device representation
* @dev: pointer to parent device
* @lock: access synchronization
* @hw_bank: hardware register mapping
* @irq: IRQ number
* @roles: array of supported roles for this controller
* @role: current role
* @is_otg: if the device is otg-capable
* @work: work for role changing
* @wq: workqueue thread
* @qh_pool: allocation pool for queue heads
* @td_pool: allocation pool for transfer descriptors
* @gadget: device side representation for peripheral controller
* @driver: gadget driver
* @hw_ep_max: total number of endpoints supported by hardware
* @ci13xxx_ep: array of endpoints
* @ep0_dir: ep0 direction
* @ep0out: pointer to ep0 OUT endpoint
* @ep0in: pointer to ep0 IN endpoint
* @status: ep0 status request
* @setaddr: if we should set the address on status completion
* @address: usb address received from the host
* @remote_wakeup: host-enabled remote wakeup
* @suspended: suspended by host
* @test_mode: the selected test mode
* @udc_driver: platform specific information supplied by parent device
* @vbus_active: is VBUS active
* @transceiver: pointer to USB PHY, if any
*/
struct ci13xxx { struct ci13xxx {
spinlock_t lock; /* ctrl register bank access */ struct device *dev;
spinlock_t lock;
struct dma_pool *qh_pool; /* DMA pool for queue heads */ struct hw_bank hw_bank;
struct dma_pool *td_pool; /* DMA pool for transfer descs */ int irq;
struct usb_request *status; /* ep0 status request */ struct ci_role_driver *roles[CI_ROLE_END];
enum ci_role role;
struct device *dev; bool is_otg;
struct usb_gadget gadget; /* USB slave device */ struct work_struct work;
struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ struct workqueue_struct *wq;
u32 ep0_dir; /* ep0 direction */
struct ci13xxx_ep *ep0out, *ep0in; struct dma_pool *qh_pool;
unsigned hw_ep_max; /* number of hw endpoints */ struct dma_pool *td_pool;
bool setaddr; struct usb_gadget gadget;
u8 address; struct usb_gadget_driver *driver;
u8 remote_wakeup; /* Is remote wakeup feature unsigned hw_ep_max;
enabled by the host? */ struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX];
u8 suspended; /* suspended by the host */ u32 ep0_dir;
u8 test_mode; /* the selected test mode */ struct ci13xxx_ep *ep0out, *ep0in;
struct hw_bank hw_bank; struct usb_request *status;
int irq; bool setaddr;
struct usb_gadget_driver *driver; /* 3rd party gadget driver */ u8 address;
struct ci13xxx_udc_driver *udc_driver; /* device controller driver */ u8 remote_wakeup;
int vbus_active; /* is VBUS active */ u8 suspended;
struct usb_phy *transceiver; /* Transceiver struct */ u8 test_mode;
struct ci_role_driver *roles[CI_ROLE_END];
enum ci_role role; struct ci13xxx_udc_driver *udc_driver;
bool is_otg; int vbus_active;
struct work_struct work; struct usb_phy *transceiver;
struct workqueue_struct *wq;
}; };
static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
......
...@@ -59,15 +59,24 @@ struct ci13xxx_qh { ...@@ -59,15 +59,24 @@ struct ci13xxx_qh {
struct usb_ctrlrequest setup; struct usb_ctrlrequest setup;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Extension of usb_request */ /**
* struct ci13xxx_req - usb request representation
* @req: request structure for gadget drivers
* @map: is the request mapped
* @queue: link to QH list
* @ptr: transfer descriptor for this request
* @dma: dma address for the transfer descriptor
* @zptr: transfer descriptor for the zero packet
* @zdma: dma address of the zero packet's transfer descriptor
*/
struct ci13xxx_req { struct ci13xxx_req {
struct usb_request req; struct usb_request req;
unsigned map; unsigned map;
struct list_head queue; struct list_head queue;
struct ci13xxx_td *ptr; struct ci13xxx_td *ptr;
dma_addr_t dma; dma_addr_t dma;
struct ci13xxx_td *zptr; struct ci13xxx_td *zptr;
dma_addr_t zdma; dma_addr_t zdma;
}; };
#ifdef CONFIG_USB_CHIPIDEA_UDC #ifdef CONFIG_USB_CHIPIDEA_UDC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment