imx21              14 drivers/usb/host/imx21-dbg.c static inline void create_debug_files(struct imx21 *imx21) { }
imx21              15 drivers/usb/host/imx21-dbg.c static inline void remove_debug_files(struct imx21 *imx21) { }
imx21              16 drivers/usb/host/imx21-dbg.c static inline void debug_urb_submitted(struct imx21 *imx21, struct urb *urb) {}
imx21              17 drivers/usb/host/imx21-dbg.c static inline void debug_urb_completed(struct imx21 *imx21, struct urb *urb,
imx21              19 drivers/usb/host/imx21-dbg.c static inline void debug_urb_unlinked(struct imx21 *imx21, struct urb *urb) {}
imx21              20 drivers/usb/host/imx21-dbg.c static inline void debug_urb_queued_for_etd(struct imx21 *imx21,
imx21              22 drivers/usb/host/imx21-dbg.c static inline void debug_urb_queued_for_dmem(struct imx21 *imx21,
imx21              24 drivers/usb/host/imx21-dbg.c static inline void debug_etd_allocated(struct imx21 *imx21) {}
imx21              25 drivers/usb/host/imx21-dbg.c static inline void debug_etd_freed(struct imx21 *imx21) {}
imx21              26 drivers/usb/host/imx21-dbg.c static inline void debug_dmem_allocated(struct imx21 *imx21, int size) {}
imx21              27 drivers/usb/host/imx21-dbg.c static inline void debug_dmem_freed(struct imx21 *imx21, int size) {}
imx21              28 drivers/usb/host/imx21-dbg.c static inline void debug_isoc_submitted(struct imx21 *imx21,
imx21              30 drivers/usb/host/imx21-dbg.c static inline void debug_isoc_completed(struct imx21 *imx21,
imx21              57 drivers/usb/host/imx21-dbg.c static inline struct debug_stats *stats_for_urb(struct imx21 *imx21,
imx21              61 drivers/usb/host/imx21-dbg.c 		&imx21->isoc_stats : &imx21->nonisoc_stats;
imx21              64 drivers/usb/host/imx21-dbg.c static void debug_urb_submitted(struct imx21 *imx21, struct urb *urb)
imx21              66 drivers/usb/host/imx21-dbg.c 	stats_for_urb(imx21, urb)->submitted++;
imx21              69 drivers/usb/host/imx21-dbg.c static void debug_urb_completed(struct imx21 *imx21, struct urb *urb, int st)
imx21              72 drivers/usb/host/imx21-dbg.c 		stats_for_urb(imx21, urb)->completed_failed++;
imx21              74 drivers/usb/host/imx21-dbg.c 		stats_for_urb(imx21, urb)->completed_ok++;
imx21              77 drivers/usb/host/imx21-dbg.c static void debug_urb_unlinked(struct imx21 *imx21, struct urb *urb)
imx21              79 drivers/usb/host/imx21-dbg.c 	stats_for_urb(imx21, urb)->unlinked++;
imx21              82 drivers/usb/host/imx21-dbg.c static void debug_urb_queued_for_etd(struct imx21 *imx21, struct urb *urb)
imx21              84 drivers/usb/host/imx21-dbg.c 	stats_for_urb(imx21, urb)->queue_etd++;
imx21              87 drivers/usb/host/imx21-dbg.c static void debug_urb_queued_for_dmem(struct imx21 *imx21, struct urb *urb)
imx21              89 drivers/usb/host/imx21-dbg.c 	stats_for_urb(imx21, urb)->queue_dmem++;
imx21              92 drivers/usb/host/imx21-dbg.c static inline void debug_etd_allocated(struct imx21 *imx21)
imx21              94 drivers/usb/host/imx21-dbg.c 	imx21->etd_usage.maximum = max(
imx21              95 drivers/usb/host/imx21-dbg.c 			++(imx21->etd_usage.value),
imx21              96 drivers/usb/host/imx21-dbg.c 			imx21->etd_usage.maximum);
imx21              99 drivers/usb/host/imx21-dbg.c static inline void debug_etd_freed(struct imx21 *imx21)
imx21             101 drivers/usb/host/imx21-dbg.c 	imx21->etd_usage.value--;
imx21             104 drivers/usb/host/imx21-dbg.c static inline void debug_dmem_allocated(struct imx21 *imx21, int size)
imx21             106 drivers/usb/host/imx21-dbg.c 	imx21->dmem_usage.value += size;
imx21             107 drivers/usb/host/imx21-dbg.c 	imx21->dmem_usage.maximum = max(
imx21             108 drivers/usb/host/imx21-dbg.c 			imx21->dmem_usage.value,
imx21             109 drivers/usb/host/imx21-dbg.c 			imx21->dmem_usage.maximum);
imx21             112 drivers/usb/host/imx21-dbg.c static inline void debug_dmem_freed(struct imx21 *imx21, int size)
imx21             114 drivers/usb/host/imx21-dbg.c 	imx21->dmem_usage.value -= size;
imx21             118 drivers/usb/host/imx21-dbg.c static void debug_isoc_submitted(struct imx21 *imx21,
imx21             121 drivers/usb/host/imx21-dbg.c 	struct debug_isoc_trace *trace = &imx21->isoc_trace[
imx21             122 drivers/usb/host/imx21-dbg.c 		imx21->isoc_trace_index++];
imx21             124 drivers/usb/host/imx21-dbg.c 	imx21->isoc_trace_index %= ARRAY_SIZE(imx21->isoc_trace);
imx21             131 drivers/usb/host/imx21-dbg.c static inline void debug_isoc_completed(struct imx21 *imx21,
imx21             138 drivers/usb/host/imx21-dbg.c 	trace = imx21->isoc_trace;
imx21             139 drivers/usb/host/imx21-dbg.c 	for (i = 0; i < ARRAY_SIZE(imx21->isoc_trace); i++, trace++) {
imx21             151 drivers/usb/host/imx21-dbg.c 		trace_failed = &imx21->isoc_trace_failed[
imx21             152 drivers/usb/host/imx21-dbg.c 					imx21->isoc_trace_index_failed++];
imx21             154 drivers/usb/host/imx21-dbg.c 		imx21->isoc_trace_index_failed %= ARRAY_SIZE(
imx21             155 drivers/usb/host/imx21-dbg.c 						imx21->isoc_trace_failed);
imx21             188 drivers/usb/host/imx21-dbg.c 	struct imx21 *imx21 = s->private;
imx21             203 drivers/usb/host/imx21-dbg.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             205 drivers/usb/host/imx21-dbg.c 	etd_enable_mask = readl(imx21->regs + USBH_ETDENSET);
imx21             206 drivers/usb/host/imx21-dbg.c 	for (i = 0, etd = imx21->etd; i < USB_NUM_ETD; i++, etd++) {
imx21             215 drivers/usb/host/imx21-dbg.c 	list_for_each_entry(dmem, &imx21->dmem_list, list) {
imx21             220 drivers/usb/host/imx21-dbg.c 	list_for_each_entry(ep_priv, &imx21->queue_for_etd, queue)
imx21             223 drivers/usb/host/imx21-dbg.c 	list_for_each_entry(etd, &imx21->queue_for_dmem, queue)
imx21             226 drivers/usb/host/imx21-dbg.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             237 drivers/usb/host/imx21-dbg.c 		readl(imx21->regs + USBH_FRMNUB) & 0xFFFF,
imx21             238 drivers/usb/host/imx21-dbg.c 		etds_allocated, USB_NUM_ETD, imx21->etd_usage.maximum,
imx21             241 drivers/usb/host/imx21-dbg.c 		dmem_bytes, DMEM_SIZE, imx21->dmem_usage.maximum,
imx21             252 drivers/usb/host/imx21-dbg.c 	struct imx21 *imx21 = s->private;
imx21             257 drivers/usb/host/imx21-dbg.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             259 drivers/usb/host/imx21-dbg.c 	list_for_each_entry(dmem, &imx21->dmem_list, list)
imx21             266 drivers/usb/host/imx21-dbg.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             274 drivers/usb/host/imx21-dbg.c 	struct imx21 *imx21 = s->private;
imx21             281 drivers/usb/host/imx21-dbg.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             283 drivers/usb/host/imx21-dbg.c 	for (i = 0, etd = imx21->etd; i < USB_NUM_ETD; i++, etd++) {
imx21             307 drivers/usb/host/imx21-dbg.c 			(readl(imx21->regs + USBH_ETDENSET) & (1 << i)) > 0,
imx21             312 drivers/usb/host/imx21-dbg.c 			dword = etd_readl(imx21, i, j);
imx21             335 drivers/usb/host/imx21-dbg.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             362 drivers/usb/host/imx21-dbg.c 	struct imx21 *imx21 = s->private;
imx21             365 drivers/usb/host/imx21-dbg.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             367 drivers/usb/host/imx21-dbg.c 	debug_statistics_show_one(s, "nonisoc", &imx21->nonisoc_stats);
imx21             368 drivers/usb/host/imx21-dbg.c 	debug_statistics_show_one(s, "isoc", &imx21->isoc_stats);
imx21             369 drivers/usb/host/imx21-dbg.c 	seq_printf(s, "unblock kludge triggers: %lu\n", imx21->debug_unblocks);
imx21             370 drivers/usb/host/imx21-dbg.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             397 drivers/usb/host/imx21-dbg.c 	struct imx21 *imx21 = s->private;
imx21             402 drivers/usb/host/imx21-dbg.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             404 drivers/usb/host/imx21-dbg.c 	trace = imx21->isoc_trace_failed;
imx21             405 drivers/usb/host/imx21-dbg.c 	for (i = 0; i < ARRAY_SIZE(imx21->isoc_trace_failed); i++, trace++)
imx21             408 drivers/usb/host/imx21-dbg.c 	trace = imx21->isoc_trace;
imx21             409 drivers/usb/host/imx21-dbg.c 	for (i = 0; i < ARRAY_SIZE(imx21->isoc_trace); i++, trace++)
imx21             412 drivers/usb/host/imx21-dbg.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             418 drivers/usb/host/imx21-dbg.c static void create_debug_files(struct imx21 *imx21)
imx21             422 drivers/usb/host/imx21-dbg.c 	root = debugfs_create_dir(dev_name(imx21->dev), NULL);
imx21             423 drivers/usb/host/imx21-dbg.c 	imx21->debug_root = root;
imx21             425 drivers/usb/host/imx21-dbg.c 	debugfs_create_file("status", S_IRUGO, root, imx21, &debug_status_fops);
imx21             426 drivers/usb/host/imx21-dbg.c 	debugfs_create_file("dmem", S_IRUGO, root, imx21, &debug_dmem_fops);
imx21             427 drivers/usb/host/imx21-dbg.c 	debugfs_create_file("etd", S_IRUGO, root, imx21, &debug_etd_fops);
imx21             428 drivers/usb/host/imx21-dbg.c 	debugfs_create_file("statistics", S_IRUGO, root, imx21,
imx21             430 drivers/usb/host/imx21-dbg.c 	debugfs_create_file("isoc", S_IRUGO, root, imx21, &debug_isoc_fops);
imx21             433 drivers/usb/host/imx21-dbg.c static void remove_debug_files(struct imx21 *imx21)
imx21             435 drivers/usb/host/imx21-dbg.c 	debugfs_remove_recursive(imx21->debug_root);
imx21              57 drivers/usb/host/imx21-hcd.c #define DEBUG_LOG_FRAME(imx21, etd, event) \
imx21              58 drivers/usb/host/imx21-hcd.c 	(etd)->event##_frame = readl((imx21)->regs + USBH_FRMNUB)
imx21              60 drivers/usb/host/imx21-hcd.c #define DEBUG_LOG_FRAME(imx21, etd, event) do { } while (0)
imx21              65 drivers/usb/host/imx21-hcd.c static inline struct imx21 *hcd_to_imx21(struct usb_hcd *hcd)
imx21              67 drivers/usb/host/imx21-hcd.c 	return (struct imx21 *)hcd->hcd_priv;
imx21              75 drivers/usb/host/imx21-hcd.c static inline void set_register_bits(struct imx21 *imx21, u32 offset, u32 mask)
imx21              77 drivers/usb/host/imx21-hcd.c 	void __iomem *reg = imx21->regs + offset;
imx21              81 drivers/usb/host/imx21-hcd.c static inline void clear_register_bits(struct imx21 *imx21,
imx21              84 drivers/usb/host/imx21-hcd.c 	void __iomem *reg = imx21->regs + offset;
imx21              88 drivers/usb/host/imx21-hcd.c static inline void clear_toggle_bit(struct imx21 *imx21, u32 offset, u32 mask)
imx21              90 drivers/usb/host/imx21-hcd.c 	void __iomem *reg = imx21->regs + offset;
imx21              96 drivers/usb/host/imx21-hcd.c static inline void set_toggle_bit(struct imx21 *imx21, u32 offset, u32 mask)
imx21              98 drivers/usb/host/imx21-hcd.c 	void __iomem *reg = imx21->regs + offset;
imx21             104 drivers/usb/host/imx21-hcd.c static void etd_writel(struct imx21 *imx21, int etd_num, int dword, u32 value)
imx21             106 drivers/usb/host/imx21-hcd.c 	writel(value, imx21->regs + USB_ETD_DWORD(etd_num, dword));
imx21             109 drivers/usb/host/imx21-hcd.c static u32 etd_readl(struct imx21 *imx21, int etd_num, int dword)
imx21             111 drivers/usb/host/imx21-hcd.c 	return readl(imx21->regs + USB_ETD_DWORD(etd_num, dword));
imx21             127 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21             129 drivers/usb/host/imx21-hcd.c 	return wrap_frame(readl(imx21->regs + USBH_FRMNUB));
imx21             140 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21, struct etd_priv *etd, int status);
imx21             141 drivers/usb/host/imx21-hcd.c static void schedule_nonisoc_etd(struct imx21 *imx21, struct urb *urb);
imx21             142 drivers/usb/host/imx21-hcd.c static void free_dmem(struct imx21 *imx21, struct etd_priv *etd);
imx21             148 drivers/usb/host/imx21-hcd.c static int alloc_etd(struct imx21 *imx21)
imx21             151 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = imx21->etd;
imx21             155 drivers/usb/host/imx21-hcd.c 			memset(etd, 0, sizeof(imx21->etd[0]));
imx21             157 drivers/usb/host/imx21-hcd.c 			debug_etd_allocated(imx21);
imx21             164 drivers/usb/host/imx21-hcd.c static void disactivate_etd(struct imx21 *imx21, int num)
imx21             167 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = &imx21->etd[num];
imx21             169 drivers/usb/host/imx21-hcd.c 	writel(etd_mask, imx21->regs + USBH_ETDENCLR);
imx21             170 drivers/usb/host/imx21-hcd.c 	clear_register_bits(imx21, USBH_ETDDONEEN, etd_mask);
imx21             171 drivers/usb/host/imx21-hcd.c 	writel(etd_mask, imx21->regs + USB_ETDDMACHANLCLR);
imx21             172 drivers/usb/host/imx21-hcd.c 	clear_toggle_bit(imx21, USBH_ETDDONESTAT, etd_mask);
imx21             176 drivers/usb/host/imx21-hcd.c 	DEBUG_LOG_FRAME(imx21, etd, disactivated);
imx21             179 drivers/usb/host/imx21-hcd.c static void reset_etd(struct imx21 *imx21, int num)
imx21             181 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = imx21->etd + num;
imx21             184 drivers/usb/host/imx21-hcd.c 	disactivate_etd(imx21, num);
imx21             187 drivers/usb/host/imx21-hcd.c 		etd_writel(imx21, num, i, 0);
imx21             194 drivers/usb/host/imx21-hcd.c static void free_etd(struct imx21 *imx21, int num)
imx21             200 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "BAD etd=%d!\n", num);
imx21             203 drivers/usb/host/imx21-hcd.c 	if (imx21->etd[num].alloc == 0) {
imx21             204 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "ETD %d already free!\n", num);
imx21             208 drivers/usb/host/imx21-hcd.c 	debug_etd_freed(imx21);
imx21             209 drivers/usb/host/imx21-hcd.c 	reset_etd(imx21, num);
imx21             210 drivers/usb/host/imx21-hcd.c 	memset(&imx21->etd[num], 0, sizeof(imx21->etd[0]));
imx21             214 drivers/usb/host/imx21-hcd.c static void setup_etd_dword0(struct imx21 *imx21,
imx21             217 drivers/usb/host/imx21-hcd.c 	etd_writel(imx21, etd_num, 0,
imx21             232 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21, int dmem_offset, void *src, int count)
imx21             234 drivers/usb/host/imx21-hcd.c 	void __iomem *dmem = imx21->regs + USBOTG_DMEM + dmem_offset;
imx21             254 drivers/usb/host/imx21-hcd.c static void activate_etd(struct imx21 *imx21, int etd_num, u8 dir)
imx21             257 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = &imx21->etd[etd_num];
imx21             264 drivers/usb/host/imx21-hcd.c 				copy_to_dmem(imx21,
imx21             285 drivers/usb/host/imx21-hcd.c 				dev_err(imx21->dev, "failed bounce alloc\n");
imx21             290 drivers/usb/host/imx21-hcd.c 				dma_map_single(imx21->dev,
imx21             294 drivers/usb/host/imx21-hcd.c 			if (dma_mapping_error(imx21->dev, etd->dma_handle)) {
imx21             295 drivers/usb/host/imx21-hcd.c 				dev_err(imx21->dev, "failed bounce map\n");
imx21             301 drivers/usb/host/imx21-hcd.c 	clear_toggle_bit(imx21, USBH_ETDDONESTAT, etd_mask);
imx21             302 drivers/usb/host/imx21-hcd.c 	set_register_bits(imx21, USBH_ETDDONEEN, etd_mask);
imx21             303 drivers/usb/host/imx21-hcd.c 	clear_toggle_bit(imx21, USBH_XFILLSTAT, etd_mask);
imx21             304 drivers/usb/host/imx21-hcd.c 	clear_toggle_bit(imx21, USBH_YFILLSTAT, etd_mask);
imx21             307 drivers/usb/host/imx21-hcd.c 		set_register_bits(imx21, USB_ETDDMACHANLCLR, etd_mask);
imx21             308 drivers/usb/host/imx21-hcd.c 		clear_toggle_bit(imx21, USBH_XBUFSTAT, etd_mask);
imx21             309 drivers/usb/host/imx21-hcd.c 		clear_toggle_bit(imx21, USBH_YBUFSTAT, etd_mask);
imx21             310 drivers/usb/host/imx21-hcd.c 		writel(etd->dma_handle, imx21->regs + USB_ETDSMSA(etd_num));
imx21             311 drivers/usb/host/imx21-hcd.c 		set_register_bits(imx21, USB_ETDDMAEN, etd_mask);
imx21             315 drivers/usb/host/imx21-hcd.c 			set_toggle_bit(imx21, USBH_XFILLSTAT, etd_mask);
imx21             316 drivers/usb/host/imx21-hcd.c 			set_toggle_bit(imx21, USBH_YFILLSTAT, etd_mask);
imx21             320 drivers/usb/host/imx21-hcd.c 	DEBUG_LOG_FRAME(imx21, etd, activated);
imx21             325 drivers/usb/host/imx21-hcd.c 		etd->activated_frame = readl(imx21->regs + USBH_FRMNUB);
imx21             331 drivers/usb/host/imx21-hcd.c 			etd->submitted_dwords[i] = etd_readl(imx21, etd_num, i);
imx21             336 drivers/usb/host/imx21-hcd.c 	writel(etd_mask, imx21->regs + USBH_ETDENSET);
imx21             343 drivers/usb/host/imx21-hcd.c 	free_dmem(imx21, etd);
imx21             344 drivers/usb/host/imx21-hcd.c 	nonisoc_urb_completed_for_etd(imx21, etd, -ENOMEM);
imx21             351 drivers/usb/host/imx21-hcd.c static int alloc_dmem(struct imx21 *imx21, unsigned int size,
imx21             361 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "size=%d > DMEM_SIZE(%d)\n",
imx21             366 drivers/usb/host/imx21-hcd.c 	list_for_each_entry(tmp, &imx21->dmem_list, list) {
imx21             384 drivers/usb/host/imx21-hcd.c 	debug_dmem_allocated(imx21, size);
imx21             392 drivers/usb/host/imx21-hcd.c static void activate_queued_etd(struct imx21 *imx21,
imx21             396 drivers/usb/host/imx21-hcd.c 	int etd_num = etd - &imx21->etd[0];
imx21             397 drivers/usb/host/imx21-hcd.c 	u32 maxpacket = etd_readl(imx21, etd_num, 1) >> DW1_YBUFSRTAD;
imx21             398 drivers/usb/host/imx21-hcd.c 	u8 dir = (etd_readl(imx21, etd_num, 2) >> DW2_DIRPID) & 0x03;
imx21             400 drivers/usb/host/imx21-hcd.c 	dev_dbg(imx21->dev, "activating queued ETD %d now DMEM available\n",
imx21             402 drivers/usb/host/imx21-hcd.c 	etd_writel(imx21, etd_num, 1,
imx21             407 drivers/usb/host/imx21-hcd.c 	activate_etd(imx21, etd_num, dir);
imx21             410 drivers/usb/host/imx21-hcd.c static void free_dmem(struct imx21 *imx21, struct etd_priv *etd)
imx21             422 drivers/usb/host/imx21-hcd.c 	list_for_each_entry(area, &imx21->dmem_list, list) {
imx21             424 drivers/usb/host/imx21-hcd.c 			debug_dmem_freed(imx21, area->size);
imx21             433 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev,
imx21             439 drivers/usb/host/imx21-hcd.c 	list_for_each_entry_safe(etd, tmp, &imx21->queue_for_dmem, queue) {
imx21             440 drivers/usb/host/imx21-hcd.c 		offset = alloc_dmem(imx21, etd->dmem_size, etd->ep);
imx21             443 drivers/usb/host/imx21-hcd.c 			activate_queued_etd(imx21, etd, (u32)offset);
imx21             448 drivers/usb/host/imx21-hcd.c static void free_epdmem(struct imx21 *imx21, struct usb_host_endpoint *ep)
imx21             452 drivers/usb/host/imx21-hcd.c 	list_for_each_entry_safe(area, tmp, &imx21->dmem_list, list) {
imx21             454 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev,
imx21             469 drivers/usb/host/imx21-hcd.c static void ep_idle(struct imx21 *imx21, struct ep_priv *ep_priv)
imx21             479 drivers/usb/host/imx21-hcd.c 		etd = &imx21->etd[etd_num];
imx21             482 drivers/usb/host/imx21-hcd.c 		free_dmem(imx21, etd); /* for isoc */
imx21             484 drivers/usb/host/imx21-hcd.c 		if (list_empty(&imx21->queue_for_etd)) {
imx21             485 drivers/usb/host/imx21-hcd.c 			free_etd(imx21, etd_num);
imx21             489 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev,
imx21             491 drivers/usb/host/imx21-hcd.c 		ep_priv = list_first_entry(&imx21->queue_for_etd,
imx21             494 drivers/usb/host/imx21-hcd.c 		reset_etd(imx21, etd_num);
imx21             499 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev, "No urb for queued ep!\n");
imx21             502 drivers/usb/host/imx21-hcd.c 		schedule_nonisoc_etd(imx21, list_first_entry(
imx21             508 drivers/usb/host/imx21-hcd.c __releases(imx21->lock)
imx21             509 drivers/usb/host/imx21-hcd.c __acquires(imx21->lock)
imx21             511 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21             515 drivers/usb/host/imx21-hcd.c 	debug_urb_completed(imx21, urb, status);
imx21             516 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev, "urb %p done %d\n", urb, status);
imx21             522 drivers/usb/host/imx21-hcd.c 	spin_unlock(&imx21->lock);
imx21             524 drivers/usb/host/imx21-hcd.c 	spin_lock(&imx21->lock);
imx21             526 drivers/usb/host/imx21-hcd.c 		ep_idle(imx21, ep_priv);
imx21             530 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21, struct etd_priv *etd, int status)
imx21             534 drivers/usb/host/imx21-hcd.c 	urb_done(imx21->hcd, etd->urb, status);
imx21             541 drivers/usb/host/imx21-hcd.c 		dev_vdbg(imx21->dev, "next URB %p\n", urb);
imx21             542 drivers/usb/host/imx21-hcd.c 		schedule_nonisoc_etd(imx21, urb);
imx21             554 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21             573 drivers/usb/host/imx21-hcd.c 		etd = &imx21->etd[etd_num];
imx21             583 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "isoc too late frame %d > %d\n",
imx21             602 drivers/usb/host/imx21-hcd.c 		debug_isoc_submitted(imx21, cur_frame, td);
imx21             605 drivers/usb/host/imx21-hcd.c 		setup_etd_dword0(imx21, etd_num, td->urb, dir, etd->dmem_size);
imx21             606 drivers/usb/host/imx21-hcd.c 		etd_writel(imx21, etd_num, 1, etd->dmem_offset);
imx21             607 drivers/usb/host/imx21-hcd.c 		etd_writel(imx21, etd_num, 2,
imx21             610 drivers/usb/host/imx21-hcd.c 		etd_writel(imx21, etd_num, 3,
imx21             614 drivers/usb/host/imx21-hcd.c 		activate_etd(imx21, etd_num, dir);
imx21             620 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21             622 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = imx21->etd + etd_num;
imx21             633 drivers/usb/host/imx21-hcd.c 	disactivate_etd(imx21, etd_num);
imx21             635 drivers/usb/host/imx21-hcd.c 	cc = (etd_readl(imx21, etd_num, 3) >> DW3_COMPCODE0) & 0xf;
imx21             636 drivers/usb/host/imx21-hcd.c 	bytes_xfrd = etd_readl(imx21, etd_num, 3) & 0x3ff;
imx21             647 drivers/usb/host/imx21-hcd.c 	debug_isoc_completed(imx21,
imx21             651 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev,
imx21             659 drivers/usb/host/imx21-hcd.c 		clear_toggle_bit(imx21, USBH_XFILLSTAT, etd_mask);
imx21             662 drivers/usb/host/imx21-hcd.c 				imx21->regs + USBOTG_DMEM + etd->dmem_offset,
imx21             681 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21, struct usb_host_endpoint *ep)
imx21             699 drivers/usb/host/imx21-hcd.c static int alloc_isoc_etds(struct imx21 *imx21, struct ep_priv *ep_priv)
imx21             707 drivers/usb/host/imx21-hcd.c 			etd_num = alloc_etd(imx21);
imx21             712 drivers/usb/host/imx21-hcd.c 			imx21->etd[etd_num].ep = ep_priv->ep;
imx21             718 drivers/usb/host/imx21-hcd.c 	dev_err(imx21->dev, "isoc: Couldn't allocate etd\n");
imx21             720 drivers/usb/host/imx21-hcd.c 		free_etd(imx21, ep_priv->etd[j]);
imx21             730 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21             751 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21             754 drivers/usb/host/imx21-hcd.c 		ep_priv = alloc_isoc_ep(imx21, ep);
imx21             763 drivers/usb/host/imx21-hcd.c 	ret = alloc_isoc_etds(imx21, ep_priv);
imx21             780 drivers/usb/host/imx21-hcd.c 		struct etd_priv *etd = &imx21->etd[ep_priv->etd[i]];
imx21             784 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev, "increasing isoc buffer %d->%d\n",
imx21             791 drivers/usb/host/imx21-hcd.c 			etd->dmem_offset = alloc_dmem(imx21, maxpacket, ep);
imx21             793 drivers/usb/host/imx21-hcd.c 				dev_dbg(imx21->dev, "failed alloc isoc dmem\n");
imx21             811 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21             844 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev, "setup %d packets for iso frame %d->%d\n",
imx21             847 drivers/usb/host/imx21-hcd.c 	debug_urb_submitted(imx21, urb);
imx21             850 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             859 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21             867 drivers/usb/host/imx21-hcd.c static void dequeue_isoc_urb(struct imx21 *imx21,
imx21             877 drivers/usb/host/imx21-hcd.c 			if (etd_num != -1 && imx21->etd[etd_num].urb == urb) {
imx21             878 drivers/usb/host/imx21-hcd.c 				struct etd_priv *etd = imx21->etd + etd_num;
imx21             880 drivers/usb/host/imx21-hcd.c 				reset_etd(imx21, etd_num);
imx21             881 drivers/usb/host/imx21-hcd.c 				free_dmem(imx21, etd);
imx21             888 drivers/usb/host/imx21-hcd.c 			dev_vdbg(imx21->dev, "removing td %p\n", td);
imx21             898 drivers/usb/host/imx21-hcd.c static void schedule_nonisoc_etd(struct imx21 *imx21, struct urb *urb)
imx21             916 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "No valid ETD\n");
imx21             919 drivers/usb/host/imx21-hcd.c 	if (readl(imx21->regs + USBH_ETDENSET) & (1 << etd_num))
imx21             920 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "submitting to active ETD %d\n", etd_num);
imx21             922 drivers/usb/host/imx21-hcd.c 	etd = &imx21->etd[etd_num];
imx21             931 drivers/usb/host/imx21-hcd.c 				usb_hcd_unmap_urb_setup_for_dma(imx21->hcd,
imx21             948 drivers/usb/host/imx21-hcd.c 			usb_hcd_unmap_urb_for_dma(imx21->hcd, urb);
imx21             976 drivers/usb/host/imx21-hcd.c 		relpolpos = (readl(imx21->regs + USBH_FRMNUB) + 1) & 0xff;
imx21             980 drivers/usb/host/imx21-hcd.c 	setup_etd_dword0(imx21, etd_num, urb, dir, maxpacket);
imx21             982 drivers/usb/host/imx21-hcd.c 	etd_writel(imx21, etd_num, 2,
imx21             998 drivers/usb/host/imx21-hcd.c 	etd_writel(imx21, etd_num, 3,
imx21            1006 drivers/usb/host/imx21-hcd.c 	etd->dmem_offset = alloc_dmem(imx21, etd->dmem_size, urb_priv->ep);
imx21            1009 drivers/usb/host/imx21-hcd.c 		etd_writel(imx21, etd_num, 1, (u32)maxpacket << 16);
imx21            1011 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "Queuing etd %d for DMEM\n", etd_num);
imx21            1012 drivers/usb/host/imx21-hcd.c 		debug_urb_queued_for_dmem(imx21, urb);
imx21            1013 drivers/usb/host/imx21-hcd.c 		list_add_tail(&etd->queue, &imx21->queue_for_dmem);
imx21            1017 drivers/usb/host/imx21-hcd.c 	etd_writel(imx21, etd_num, 1,
imx21            1024 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev, "Activating etd %d for %d bytes %s\n",
imx21            1026 drivers/usb/host/imx21-hcd.c 	activate_etd(imx21, etd_num, dir);
imx21            1032 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1033 drivers/usb/host/imx21-hcd.c 	struct etd_priv *etd = &imx21->etd[etd_num];
imx21            1042 drivers/usb/host/imx21-hcd.c 	disactivate_etd(imx21, etd_num);
imx21            1044 drivers/usb/host/imx21-hcd.c 	dir = (etd_readl(imx21, etd_num, 0) >> DW0_DIRECT) & 0x3;
imx21            1045 drivers/usb/host/imx21-hcd.c 	cc = (etd_readl(imx21, etd_num, 2) >> DW2_COMPCODE) & 0xf;
imx21            1046 drivers/usb/host/imx21-hcd.c 	bytes_xfrd = etd->len - (etd_readl(imx21, etd_num, 3) & 0x1fffff);
imx21            1051 drivers/usb/host/imx21-hcd.c 		      (etd_readl(imx21, etd_num, 0) >> DW0_TOGCRY) & 0x1);
imx21            1054 drivers/usb/host/imx21-hcd.c 		clear_toggle_bit(imx21, USBH_XFILLSTAT, etd_mask);
imx21            1055 drivers/usb/host/imx21-hcd.c 		clear_toggle_bit(imx21, USBH_YFILLSTAT, etd_mask);
imx21            1059 drivers/usb/host/imx21-hcd.c 			dma_unmap_single(imx21->dev,
imx21            1063 drivers/usb/host/imx21-hcd.c 				imx21->regs + USBOTG_DMEM + etd->dmem_offset,
imx21            1070 drivers/usb/host/imx21-hcd.c 	free_dmem(imx21, etd);
imx21            1078 drivers/usb/host/imx21-hcd.c 		dev_vdbg(imx21->dev, "cc is 0x%x\n", cc);
imx21            1099 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev,
imx21            1128 drivers/usb/host/imx21-hcd.c 		nonisoc_urb_completed_for_etd(imx21, etd, cc_to_error[cc]);
imx21            1130 drivers/usb/host/imx21-hcd.c 		dev_vdbg(imx21->dev, "next state=%d\n", urb_priv->state);
imx21            1131 drivers/usb/host/imx21-hcd.c 		schedule_nonisoc_etd(imx21, urb);
imx21            1154 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1162 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev,
imx21            1177 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1209 drivers/usb/host/imx21-hcd.c 	debug_urb_submitted(imx21, urb);
imx21            1212 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21            1215 drivers/usb/host/imx21-hcd.c 			debug_urb_queued_for_etd(imx21, urb);
imx21            1218 drivers/usb/host/imx21-hcd.c 		ep_priv->etd[0] = alloc_etd(imx21);
imx21            1220 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21            1222 drivers/usb/host/imx21-hcd.c 			debug_urb_queued_for_etd(imx21, urb);
imx21            1223 drivers/usb/host/imx21-hcd.c 			list_add_tail(&ep_priv->queue, &imx21->queue_for_etd);
imx21            1230 drivers/usb/host/imx21-hcd.c 	etd = &imx21->etd[ep_priv->etd[0]];
imx21            1232 drivers/usb/host/imx21-hcd.c 		DEBUG_LOG_FRAME(imx21, etd, last_req);
imx21            1233 drivers/usb/host/imx21-hcd.c 		schedule_nonisoc_etd(imx21, urb);
imx21            1237 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1242 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1250 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1257 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev, "dequeue urb=%p iso=%d status=%d\n",
imx21            1260 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1268 drivers/usb/host/imx21-hcd.c 	debug_urb_unlinked(imx21, urb);
imx21            1271 drivers/usb/host/imx21-hcd.c 		dequeue_isoc_urb(imx21, urb, ep_priv);
imx21            1276 drivers/usb/host/imx21-hcd.c 			struct etd_priv *etd = &imx21->etd[etd_num];
imx21            1278 drivers/usb/host/imx21-hcd.c 			disactivate_etd(imx21, etd_num);
imx21            1279 drivers/usb/host/imx21-hcd.c 			free_dmem(imx21, etd);
imx21            1288 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1292 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1300 drivers/usb/host/imx21-hcd.c static void process_etds(struct usb_hcd *hcd, struct imx21 *imx21, int sof)
imx21            1306 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1310 drivers/usb/host/imx21-hcd.c 		u32 enabled = readl(imx21->regs + USBH_ETDENSET) & etd_mask;
imx21            1311 drivers/usb/host/imx21-hcd.c 		u32 done = readl(imx21->regs + USBH_ETDDONESTAT) & etd_mask;
imx21            1312 drivers/usb/host/imx21-hcd.c 		struct etd_priv *etd = &imx21->etd[etd_num];
imx21            1316 drivers/usb/host/imx21-hcd.c 			DEBUG_LOG_FRAME(imx21, etd, last_int);
imx21            1343 drivers/usb/host/imx21-hcd.c 			cc = etd_readl(imx21, etd_num, 2) >> DW2_COMPCODE;
imx21            1350 drivers/usb/host/imx21-hcd.c 			dword0 = etd_readl(imx21, etd_num, 0);
imx21            1351 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21            1358 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21            1365 drivers/usb/host/imx21-hcd.c 				readl(imx21->regs + USBH_FRMNUB));
imx21            1366 drivers/usb/host/imx21-hcd.c 			imx21->debug_unblocks++;
imx21            1373 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev,
imx21            1377 drivers/usb/host/imx21-hcd.c 			disactivate_etd(imx21, etd_num);
imx21            1389 drivers/usb/host/imx21-hcd.c 		set_register_bits(imx21, USBH_SYSIEN, USBH_SYSIEN_SOFINT);
imx21            1391 drivers/usb/host/imx21-hcd.c 		clear_register_bits(imx21, USBH_SYSIEN, USBH_SYSIEN_SOFINT);
imx21            1394 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1399 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1400 drivers/usb/host/imx21-hcd.c 	u32 ints = readl(imx21->regs + USBH_SYSISR);
imx21            1403 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "Scheduling error\n");
imx21            1406 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "Scheduling overrun\n");
imx21            1409 drivers/usb/host/imx21-hcd.c 		process_etds(hcd, imx21, ints & USBH_SYSISR_SOFINT);
imx21            1411 drivers/usb/host/imx21-hcd.c 	writel(ints, imx21->regs + USBH_SYSISR);
imx21            1418 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1426 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1428 drivers/usb/host/imx21-hcd.c 	dev_vdbg(imx21->dev, "disable ep=%p, ep->hcpriv=%p\n", ep, ep_priv);
imx21            1431 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "ep's URB list is not empty\n");
imx21            1436 drivers/usb/host/imx21-hcd.c 				dev_dbg(imx21->dev, "free etd %d for disable\n",
imx21            1439 drivers/usb/host/imx21-hcd.c 			free_etd(imx21, ep_priv->etd[i]);
imx21            1446 drivers/usb/host/imx21-hcd.c 		if (imx21->etd[i].alloc && imx21->etd[i].ep == ep) {
imx21            1447 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev,
imx21            1449 drivers/usb/host/imx21-hcd.c 			free_etd(imx21, i);
imx21            1452 drivers/usb/host/imx21-hcd.c 	free_epdmem(imx21, ep);
imx21            1453 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1463 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1467 drivers/usb/host/imx21-hcd.c 	desc->bNbrPorts = readl(imx21->regs + USBH_ROOTHUBA)
imx21            1482 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1488 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1489 drivers/usb/host/imx21-hcd.c 	ports = readl(imx21->regs + USBH_ROOTHUBA)
imx21            1493 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "ports %d > 7\n", ports);
imx21            1496 drivers/usb/host/imx21-hcd.c 		if (readl(imx21->regs + USBH_PORTSTAT(i)) &
imx21            1507 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1510 drivers/usb/host/imx21-hcd.c 		dev_info(imx21->dev, "Hub status changed\n");
imx21            1518 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1524 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "ClearHubFeature\n");
imx21            1527 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    OVER_CURRENT\n");
imx21            1530 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    LOCAL_POWER\n");
imx21            1533 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    unknown\n");
imx21            1540 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "ClearPortFeature\n");
imx21            1543 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    ENABLE\n");
imx21            1547 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    SUSPEND\n");
imx21            1551 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    POWER\n");
imx21            1555 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    C_ENABLE\n");
imx21            1559 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    C_SUSPEND\n");
imx21            1563 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    C_CONNECTION\n");
imx21            1567 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    C_OVER_CURRENT\n");
imx21            1571 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    C_RESET\n");
imx21            1575 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    unknown\n");
imx21            1583 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "GetHubDescriptor\n");
imx21            1588 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "  GetHubStatus\n");
imx21            1593 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "GetPortStatus: port: %d, 0x%x\n",
imx21            1595 drivers/usb/host/imx21-hcd.c 		*(__le32 *) buf = readl(imx21->regs +
imx21            1600 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "SetHubFeature\n");
imx21            1603 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    OVER_CURRENT\n");
imx21            1607 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    LOCAL_POWER\n");
imx21            1610 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    unknown\n");
imx21            1618 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "SetPortFeature\n");
imx21            1621 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    SUSPEND\n");
imx21            1625 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    POWER\n");
imx21            1629 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    RESET\n");
imx21            1633 drivers/usb/host/imx21-hcd.c 			dev_dbg(imx21->dev, "    unknown\n");
imx21            1640 drivers/usb/host/imx21-hcd.c 		dev_dbg(imx21->dev, "  unknown\n");
imx21            1646 drivers/usb/host/imx21-hcd.c 		writel(status_write, imx21->regs + USBH_PORTSTAT(wIndex - 1));
imx21            1656 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1660 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1665 drivers/usb/host/imx21-hcd.c 		imx21->regs + USBOTG_RST_CTRL);
imx21            1669 drivers/usb/host/imx21-hcd.c 	while (readl(imx21->regs + USBOTG_RST_CTRL) != 0) {
imx21            1671 drivers/usb/host/imx21-hcd.c 			spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1672 drivers/usb/host/imx21-hcd.c 			dev_err(imx21->dev, "timeout waiting for reset\n");
imx21            1675 drivers/usb/host/imx21-hcd.c 		spin_unlock_irq(&imx21->lock);
imx21            1677 drivers/usb/host/imx21-hcd.c 		spin_lock_irq(&imx21->lock);
imx21            1679 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1685 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1691 drivers/usb/host/imx21-hcd.c 	hw_mode |= ((imx21->pdata->host_xcvr << USBOTG_HWMODE_HOSTXCVR_SHIFT) &
imx21            1693 drivers/usb/host/imx21-hcd.c 	hw_mode |= ((imx21->pdata->otg_xcvr << USBOTG_HWMODE_OTGXCVR_SHIFT) &
imx21            1696 drivers/usb/host/imx21-hcd.c 	if (imx21->pdata->host1_txenoe)
imx21            1699 drivers/usb/host/imx21-hcd.c 	if (!imx21->pdata->host1_xcverless)
imx21            1702 drivers/usb/host/imx21-hcd.c 	if (imx21->pdata->otg_ext_xcvr)
imx21            1706 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1709 drivers/usb/host/imx21-hcd.c 		imx21->regs + USBOTG_CLK_CTRL);
imx21            1710 drivers/usb/host/imx21-hcd.c 	writel(hw_mode, imx21->regs + USBOTG_HWMODE);
imx21            1711 drivers/usb/host/imx21-hcd.c 	writel(usb_control, imx21->regs + USBCTRL);
imx21            1713 drivers/usb/host/imx21-hcd.c 		imx21->regs + USB_MISCCONTROL);
imx21            1718 drivers/usb/host/imx21-hcd.c 			etd_writel(imx21, i, j, 0);
imx21            1722 drivers/usb/host/imx21-hcd.c 		imx21->regs + USBH_HOST_CTRL);
imx21            1725 drivers/usb/host/imx21-hcd.c 	if (imx21->pdata->enable_otg_host)
imx21            1727 drivers/usb/host/imx21-hcd.c 			imx21->regs + USBH_PORTSTAT(0));
imx21            1729 drivers/usb/host/imx21-hcd.c 	if (imx21->pdata->enable_host1)
imx21            1731 drivers/usb/host/imx21-hcd.c 			imx21->regs + USBH_PORTSTAT(1));
imx21            1733 drivers/usb/host/imx21-hcd.c 	if (imx21->pdata->enable_host2)
imx21            1735 drivers/usb/host/imx21-hcd.c 			imx21->regs + USBH_PORTSTAT(2));
imx21            1741 drivers/usb/host/imx21-hcd.c 	set_register_bits(imx21, USBH_SYSIEN,
imx21            1744 drivers/usb/host/imx21-hcd.c 	set_register_bits(imx21, USBOTG_CINT_STEN, USBOTG_HCINT);
imx21            1746 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1753 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1756 drivers/usb/host/imx21-hcd.c 	spin_lock_irqsave(&imx21->lock, flags);
imx21            1758 drivers/usb/host/imx21-hcd.c 	writel(0, imx21->regs + USBH_SYSIEN);
imx21            1759 drivers/usb/host/imx21-hcd.c 	clear_register_bits(imx21, USBOTG_CINT_STEN, USBOTG_HCINT);
imx21            1760 drivers/usb/host/imx21-hcd.c 	clear_register_bits(imx21, USBOTG_CLK_CTRL_HST | USBOTG_CLK_CTRL_MAIN,
imx21            1762 drivers/usb/host/imx21-hcd.c 	spin_unlock_irqrestore(&imx21->lock, flags);
imx21            1772 drivers/usb/host/imx21-hcd.c 	.hcd_priv_size = sizeof(struct imx21),
imx21            1807 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21 = hcd_to_imx21(hcd);
imx21            1810 drivers/usb/host/imx21-hcd.c 	remove_debug_files(imx21);
imx21            1814 drivers/usb/host/imx21-hcd.c 		clk_disable_unprepare(imx21->clk);
imx21            1815 drivers/usb/host/imx21-hcd.c 		clk_put(imx21->clk);
imx21            1816 drivers/usb/host/imx21-hcd.c 		iounmap(imx21->regs);
imx21            1828 drivers/usb/host/imx21-hcd.c 	struct imx21 *imx21;
imx21            1850 drivers/usb/host/imx21-hcd.c 	imx21 = hcd_to_imx21(hcd);
imx21            1851 drivers/usb/host/imx21-hcd.c 	imx21->hcd = hcd;
imx21            1852 drivers/usb/host/imx21-hcd.c 	imx21->dev = &pdev->dev;
imx21            1853 drivers/usb/host/imx21-hcd.c 	imx21->pdata = dev_get_platdata(&pdev->dev);
imx21            1854 drivers/usb/host/imx21-hcd.c 	if (!imx21->pdata)
imx21            1855 drivers/usb/host/imx21-hcd.c 		imx21->pdata = &default_pdata;
imx21            1857 drivers/usb/host/imx21-hcd.c 	spin_lock_init(&imx21->lock);
imx21            1858 drivers/usb/host/imx21-hcd.c 	INIT_LIST_HEAD(&imx21->dmem_list);
imx21            1859 drivers/usb/host/imx21-hcd.c 	INIT_LIST_HEAD(&imx21->queue_for_etd);
imx21            1860 drivers/usb/host/imx21-hcd.c 	INIT_LIST_HEAD(&imx21->queue_for_dmem);
imx21            1861 drivers/usb/host/imx21-hcd.c 	create_debug_files(imx21);
imx21            1869 drivers/usb/host/imx21-hcd.c 	imx21->regs = ioremap(res->start, resource_size(res));
imx21            1870 drivers/usb/host/imx21-hcd.c 	if (imx21->regs == NULL) {
imx21            1871 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "Cannot map registers\n");
imx21            1877 drivers/usb/host/imx21-hcd.c 	imx21->clk = clk_get(imx21->dev, NULL);
imx21            1878 drivers/usb/host/imx21-hcd.c 	if (IS_ERR(imx21->clk)) {
imx21            1879 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "no clock found\n");
imx21            1880 drivers/usb/host/imx21-hcd.c 		ret = PTR_ERR(imx21->clk);
imx21            1884 drivers/usb/host/imx21-hcd.c 	ret = clk_set_rate(imx21->clk, clk_round_rate(imx21->clk, 48000000));
imx21            1887 drivers/usb/host/imx21-hcd.c 	ret = clk_prepare_enable(imx21->clk);
imx21            1891 drivers/usb/host/imx21-hcd.c 	dev_info(imx21->dev, "Hardware HC revision: 0x%02X\n",
imx21            1892 drivers/usb/host/imx21-hcd.c 		(readl(imx21->regs + USBOTG_HWMODE) >> 16) & 0xFF);
imx21            1896 drivers/usb/host/imx21-hcd.c 		dev_err(imx21->dev, "usb_add_hcd() returned %d\n", ret);
imx21            1904 drivers/usb/host/imx21-hcd.c 	clk_disable_unprepare(imx21->clk);
imx21            1907 drivers/usb/host/imx21-hcd.c 	clk_put(imx21->clk);
imx21            1909 drivers/usb/host/imx21-hcd.c 	iounmap(imx21->regs);
imx21            1913 drivers/usb/host/imx21-hcd.c 	remove_debug_files(imx21);