Lines Matching +full:x +full:- +full:size

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Cadence USBHS-DEV Driver.
14 static inline const char *cdns2_decode_usb_irq(char *str, size_t size, in cdns2_decode_usb_irq() argument
19 ret = scnprintf(str, size, "usbirq: 0x%02x - ", usb_irq); in cdns2_decode_usb_irq()
22 ret += scnprintf(str + ret, size - ret, "SOF "); in cdns2_decode_usb_irq()
24 ret += scnprintf(str + ret, size - ret, "SUTOK "); in cdns2_decode_usb_irq()
26 ret += scnprintf(str + ret, size - ret, "SETUP "); in cdns2_decode_usb_irq()
28 ret += scnprintf(str + ret, size - ret, "Suspend "); in cdns2_decode_usb_irq()
30 ret += scnprintf(str + ret, size - ret, "Reset "); in cdns2_decode_usb_irq()
32 ret += scnprintf(str + ret, size - ret, "HS "); in cdns2_decode_usb_irq()
34 ret += scnprintf(str + ret, size - ret, "LPM "); in cdns2_decode_usb_irq()
36 ret += scnprintf(str + ret, size - ret, ", EXT: 0x%02x - ", ext_irq); in cdns2_decode_usb_irq()
39 ret += scnprintf(str + ret, size - ret, "Wakeup "); in cdns2_decode_usb_irq()
41 ret += scnprintf(str + ret, size - ret, "VBUS_FALL "); in cdns2_decode_usb_irq()
43 ret += scnprintf(str + ret, size - ret, "VBUS_RISE "); in cdns2_decode_usb_irq()
45 if (ret == size - 1) in cdns2_decode_usb_irq()
51 static inline const char *cdns2_decode_dma_irq(char *str, size_t size, in cdns2_decode_dma_irq() argument
57 ret = scnprintf(str, size, "ISTS: %08x, %s: %08x ", in cdns2_decode_dma_irq()
61 ret += scnprintf(str + ret, size - ret, "IOC "); in cdns2_decode_dma_irq()
63 ret += scnprintf(str + ret, size - ret, "ISP "); in cdns2_decode_dma_irq()
65 ret += scnprintf(str + ret, size - ret, "DESCMIS "); in cdns2_decode_dma_irq()
67 ret += scnprintf(str + ret, size - ret, "TRBERR "); in cdns2_decode_dma_irq()
69 ret += scnprintf(str + ret, size - ret, "OUTSMM "); in cdns2_decode_dma_irq()
71 ret += scnprintf(str + ret, size - ret, "ISOERR "); in cdns2_decode_dma_irq()
73 ret += scnprintf(str + ret, size - ret, "DBUSY "); in cdns2_decode_dma_irq()
75 ret += scnprintf(str + ret, size - ret, "CCS "); in cdns2_decode_dma_irq()
77 if (ret == size - 1) in cdns2_decode_dma_irq()
83 static inline const char *cdns2_decode_epx_irq(char *str, size_t size, in cdns2_decode_epx_irq() argument
87 return cdns2_decode_dma_irq(str, size, ep_ists, ep_sts, ep_name); in cdns2_decode_epx_irq()
90 static inline const char *cdns2_decode_ep0_irq(char *str, size_t size, in cdns2_decode_ep0_irq() argument
94 return cdns2_decode_dma_irq(str, size, ep_ists, ep_sts, in cdns2_decode_ep0_irq()
100 char *str, size_t size) in cdns2_raw_ring() argument
102 struct cdns2_ring *ring = &pep->ring; in cdns2_raw_ring()
108 ret = scnprintf(str, size, "\n\t\tTR for %s:", pep->name); in cdns2_raw_ring()
110 trb = &trbs[ring->dequeue]; in cdns2_raw_ring()
112 ret += scnprintf(str + ret, size - ret, in cdns2_raw_ring()
113 "\n\t\tRing deq index: %d, trb: V=%p, P=0x%pad\n", in cdns2_raw_ring()
114 ring->dequeue, trb, &dma); in cdns2_raw_ring()
116 trb = &trbs[ring->enqueue]; in cdns2_raw_ring()
118 ret += scnprintf(str + ret, size - ret, in cdns2_raw_ring()
119 "\t\tRing enq index: %d, trb: V=%p, P=0x%pad\n", in cdns2_raw_ring()
120 ring->enqueue, trb, &dma); in cdns2_raw_ring()
122 ret += scnprintf(str + ret, size - ret, in cdns2_raw_ring()
124 ring->free_trbs, ring->ccs, ring->pcs); in cdns2_raw_ring()
127 ret += scnprintf(str + ret, size - ret, in cdns2_raw_ring()
132 dma = ring->dma; in cdns2_raw_ring()
135 ret += scnprintf(str + ret, size - ret, in cdns2_raw_ring()
136 "\t\t@%pad %08x %08x %08x\n", &dma, in cdns2_raw_ring()
137 le32_to_cpu(trb->buffer), in cdns2_raw_ring()
138 le32_to_cpu(trb->length), in cdns2_raw_ring()
139 le32_to_cpu(trb->control)); in cdns2_raw_ring()
143 if (ret == size - 1) in cdns2_raw_ring()
161 static inline const char *cdns2_decode_trb(char *str, size_t size, u32 flags, in cdns2_decode_trb() argument
169 ret = scnprintf(str, size, in cdns2_decode_trb()
170 "LINK %08x type '%s' flags %c:%c:%c%c:%c", in cdns2_decode_trb()
179 ret = scnprintf(str, size, in cdns2_decode_trb()
180 "type: '%s', Buffer: %08x, length: %ld, burst len: %ld, " in cdns2_decode_trb()
192 ret = scnprintf(str, size, "type '%s' -> raw %08x %08x %08x", in cdns2_decode_trb()
197 if (ret == size - 1) in cdns2_decode_trb()