diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2012-05-11 10:25:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-11 19:54:11 -0400 |
commit | 551a8ac64e4ea9e9e2b8656ee3bf94c8d0821d41 (patch) | |
tree | 0c12d5852d57cb85799573f00288ac053b507bd7 | |
parent | f8c1376c2202c9158ab908d730524a590bafdcb8 (diff) |
usb: chipidea: brush up structure definitions
Get rid of trailing comments in the structure definitions in favor of
kernel-doc.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/chipidea/ci.h | 156 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.h | 25 |
2 files changed, 120 insertions, 61 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 0f226b0d4761..0ab83411d800 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h | |||
@@ -27,25 +27,38 @@ | |||
27 | /****************************************************************************** | 27 | /****************************************************************************** |
28 | * STRUCTURES | 28 | * STRUCTURES |
29 | *****************************************************************************/ | 29 | *****************************************************************************/ |
30 | /* Extension of usb_ep */ | 30 | /** |
31 | * struct ci13xxx_ep - endpoint representation | ||
32 | * @ep: endpoint structure for gadget drivers | ||
33 | * @dir: endpoint direction (TX/RX) | ||
34 | * @num: endpoint number | ||
35 | * @type: endpoint type | ||
36 | * @name: string description of the endpoint | ||
37 | * @qh: queue head for this endpoint | ||
38 | * @wedge: is the endpoint wedged | ||
39 | * @udc: pointer to the controller | ||
40 | * @lock: pointer to controller's spinlock | ||
41 | * @device: pointer to gadget's struct device | ||
42 | * @td_pool: pointer to controller's TD pool | ||
43 | */ | ||
31 | struct ci13xxx_ep { | 44 | struct ci13xxx_ep { |
32 | struct usb_ep ep; | 45 | struct usb_ep ep; |
33 | u8 dir; | 46 | u8 dir; |
34 | u8 num; | 47 | u8 num; |
35 | u8 type; | 48 | u8 type; |
36 | char name[16]; | 49 | char name[16]; |
37 | struct { | 50 | struct { |
38 | struct list_head queue; | 51 | struct list_head queue; |
39 | struct ci13xxx_qh *ptr; | 52 | struct ci13xxx_qh *ptr; |
40 | dma_addr_t dma; | 53 | dma_addr_t dma; |
41 | } qh; | 54 | } qh; |
42 | int wedge; | 55 | int wedge; |
43 | 56 | ||
44 | /* global resources */ | 57 | /* global resources */ |
45 | struct ci13xxx *udc; | 58 | struct ci13xxx *udc; |
46 | spinlock_t *lock; | 59 | spinlock_t *lock; |
47 | struct device *device; | 60 | struct device *device; |
48 | struct dma_pool *td_pool; | 61 | struct dma_pool *td_pool; |
49 | }; | 62 | }; |
50 | 63 | ||
51 | enum ci_role { | 64 | enum ci_role { |
@@ -68,48 +81,85 @@ struct ci_role_driver { | |||
68 | const char *name; | 81 | const char *name; |
69 | }; | 82 | }; |
70 | 83 | ||
84 | /** | ||
85 | * struct hw_bank - hardware register mapping representation | ||
86 | * @lpm: set if the device is LPM capable | ||
87 | * @abs: absolute address of the beginning of register window | ||
88 | * @cap: capability registers | ||
89 | * @op: operational registers | ||
90 | * @size: size of the register window | ||
91 | * @regmap: register lookup table | ||
92 | */ | ||
71 | struct hw_bank { | 93 | struct hw_bank { |
72 | unsigned lpm; /* is LPM? */ | 94 | unsigned lpm; |
73 | void __iomem *abs; /* bus map offset */ | 95 | void __iomem *abs; |
74 | void __iomem *cap; /* bus map offset + CAP offset */ | 96 | void __iomem *cap; |
75 | void __iomem *op; /* bus map offset + OP offset */ | 97 | void __iomem *op; |
76 | size_t size; /* bank size */ | 98 | size_t size; |
77 | void __iomem **regmap; | 99 | void __iomem **regmap; |
78 | }; | 100 | }; |
79 | 101 | ||
80 | /* CI13XXX UDC descriptor & global resources */ | 102 | /** |
103 | * struct ci13xxx - chipidea device representation | ||
104 | * @dev: pointer to parent device | ||
105 | * @lock: access synchronization | ||
106 | * @hw_bank: hardware register mapping | ||
107 | * @irq: IRQ number | ||
108 | * @roles: array of supported roles for this controller | ||
109 | * @role: current role | ||
110 | * @is_otg: if the device is otg-capable | ||
111 | * @work: work for role changing | ||
112 | * @wq: workqueue thread | ||
113 | * @qh_pool: allocation pool for queue heads | ||
114 | * @td_pool: allocation pool for transfer descriptors | ||
115 | * @gadget: device side representation for peripheral controller | ||
116 | * @driver: gadget driver | ||
117 | * @hw_ep_max: total number of endpoints supported by hardware | ||
118 | * @ci13xxx_ep: array of endpoints | ||
119 | * @ep0_dir: ep0 direction | ||
120 | * @ep0out: pointer to ep0 OUT endpoint | ||
121 | * @ep0in: pointer to ep0 IN endpoint | ||
122 | * @status: ep0 status request | ||
123 | * @setaddr: if we should set the address on status completion | ||
124 | * @address: usb address received from the host | ||
125 | * @remote_wakeup: host-enabled remote wakeup | ||
126 | * @suspended: suspended by host | ||
127 | * @test_mode: the selected test mode | ||
128 | * @udc_driver: platform specific information supplied by parent device | ||
129 | * @vbus_active: is VBUS active | ||
130 | * @transceiver: pointer to USB PHY, if any | ||
131 | */ | ||
81 | struct ci13xxx { | 132 | struct ci13xxx { |
82 | spinlock_t lock; /* ctrl register bank access */ | 133 | struct device *dev; |
83 | 134 | spinlock_t lock; | |
84 | struct dma_pool *qh_pool; /* DMA pool for queue heads */ | 135 | struct hw_bank hw_bank; |
85 | struct dma_pool *td_pool; /* DMA pool for transfer descs */ | 136 | int irq; |
86 | struct usb_request *status; /* ep0 status request */ | 137 | struct ci_role_driver *roles[CI_ROLE_END]; |
87 | 138 | enum ci_role role; | |
88 | struct device *dev; | 139 | bool is_otg; |
89 | struct usb_gadget gadget; /* USB slave device */ | 140 | struct work_struct work; |
90 | struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; /* extended endpts */ | 141 | struct workqueue_struct *wq; |
91 | u32 ep0_dir; /* ep0 direction */ | 142 | |
92 | struct ci13xxx_ep *ep0out, *ep0in; | 143 | struct dma_pool *qh_pool; |
93 | unsigned hw_ep_max; /* number of hw endpoints */ | 144 | struct dma_pool *td_pool; |
94 | 145 | ||
95 | bool setaddr; | 146 | struct usb_gadget gadget; |
96 | u8 address; | 147 | struct usb_gadget_driver *driver; |
97 | u8 remote_wakeup; /* Is remote wakeup feature | 148 | unsigned hw_ep_max; |
98 | enabled by the host? */ | 149 | struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; |
99 | u8 suspended; /* suspended by the host */ | 150 | u32 ep0_dir; |
100 | u8 test_mode; /* the selected test mode */ | 151 | struct ci13xxx_ep *ep0out, *ep0in; |
101 | 152 | ||
102 | struct hw_bank hw_bank; | 153 | struct usb_request *status; |
103 | int irq; | 154 | bool setaddr; |
104 | struct usb_gadget_driver *driver; /* 3rd party gadget driver */ | 155 | u8 address; |
105 | struct ci13xxx_udc_driver *udc_driver; /* device controller driver */ | 156 | u8 remote_wakeup; |
106 | int vbus_active; /* is VBUS active */ | 157 | u8 suspended; |
107 | struct usb_phy *transceiver; /* Transceiver struct */ | 158 | u8 test_mode; |
108 | struct ci_role_driver *roles[CI_ROLE_END]; | 159 | |
109 | enum ci_role role; | 160 | struct ci13xxx_udc_driver *udc_driver; |
110 | bool is_otg; | 161 | int vbus_active; |
111 | struct work_struct work; | 162 | struct usb_phy *transceiver; |
112 | struct workqueue_struct *wq; | ||
113 | }; | 163 | }; |
114 | 164 | ||
115 | static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) | 165 | static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) |
diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h index 3a9e6694f327..e839a2b3b837 100644 --- a/drivers/usb/chipidea/udc.h +++ b/drivers/usb/chipidea/udc.h | |||
@@ -59,15 +59,24 @@ struct ci13xxx_qh { | |||
59 | struct usb_ctrlrequest setup; | 59 | struct usb_ctrlrequest setup; |
60 | } __attribute__ ((packed)); | 60 | } __attribute__ ((packed)); |
61 | 61 | ||
62 | /* Extension of usb_request */ | 62 | /** |
63 | * struct ci13xxx_req - usb request representation | ||
64 | * @req: request structure for gadget drivers | ||
65 | * @map: is the request mapped | ||
66 | * @queue: link to QH list | ||
67 | * @ptr: transfer descriptor for this request | ||
68 | * @dma: dma address for the transfer descriptor | ||
69 | * @zptr: transfer descriptor for the zero packet | ||
70 | * @zdma: dma address of the zero packet's transfer descriptor | ||
71 | */ | ||
63 | struct ci13xxx_req { | 72 | struct ci13xxx_req { |
64 | struct usb_request req; | 73 | struct usb_request req; |
65 | unsigned map; | 74 | unsigned map; |
66 | struct list_head queue; | 75 | struct list_head queue; |
67 | struct ci13xxx_td *ptr; | 76 | struct ci13xxx_td *ptr; |
68 | dma_addr_t dma; | 77 | dma_addr_t dma; |
69 | struct ci13xxx_td *zptr; | 78 | struct ci13xxx_td *zptr; |
70 | dma_addr_t zdma; | 79 | dma_addr_t zdma; |
71 | }; | 80 | }; |
72 | 81 | ||
73 | #ifdef CONFIG_USB_CHIPIDEA_UDC | 82 | #ifdef CONFIG_USB_CHIPIDEA_UDC |