Symbol: fotg210
drivers/usb/fotg210/fotg210-core.c
102
void fotg210_vbus(struct fotg210 *fotg, bool enable)
drivers/usb/fotg210/fotg210-core.c
131
struct fotg210 *fotg;
drivers/usb/fotg210/fotg210-core.c
43
static int fotg210_gemini_init(struct fotg210 *fotg, struct resource *res,
drivers/usb/fotg210/fotg210-hcd.c
1002
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
104
static void dbg_hcc_params(struct fotg210_hcd *fotg210, char *label)
drivers/usb/fotg210/fotg210-hcd.c
1045
static void fotg210_enable_event(struct fotg210_hcd *fotg210, unsigned event,
drivers/usb/fotg210/fotg210-hcd.c
1048
ktime_t *timeout = &fotg210->hr_timeouts[event];
drivers/usb/fotg210/fotg210-hcd.c
1052
fotg210->enabled_hrtimer_events |= (1 << event);
drivers/usb/fotg210/fotg210-hcd.c
1055
if (event < fotg210->next_hrtimer_event) {
drivers/usb/fotg210/fotg210-hcd.c
1056
fotg210->next_hrtimer_event = event;
drivers/usb/fotg210/fotg210-hcd.c
1057
hrtimer_start_range_ns(&fotg210->hrtimer, *timeout,
drivers/usb/fotg210/fotg210-hcd.c
106
u32 params = fotg210_readl(fotg210, &fotg210->caps->hcc_params);
drivers/usb/fotg210/fotg210-hcd.c
1064
static void fotg210_poll_ASS(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1069
if (fotg210->rh_state != FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
1072
want = (fotg210->command & CMD_ASE) ? STS_ASS : 0;
drivers/usb/fotg210/fotg210-hcd.c
1073
actual = fotg210_readl(fotg210, &fotg210->regs->status) & STS_ASS;
drivers/usb/fotg210/fotg210-hcd.c
1078
if (fotg210->ASS_poll_count++ < 20) {
drivers/usb/fotg210/fotg210-hcd.c
1079
fotg210_enable_event(fotg210, FOTG210_HRTIMER_POLL_ASS,
drivers/usb/fotg210/fotg210-hcd.c
108
fotg210_dbg(fotg210, "%s hcc_params %04x uframes %s%s\n", label,
drivers/usb/fotg210/fotg210-hcd.c
1083
fotg210_dbg(fotg210, "Waited too long for the async schedule status (%x/%x), giving up\n",
drivers/usb/fotg210/fotg210-hcd.c
1086
fotg210->ASS_poll_count = 0;
drivers/usb/fotg210/fotg210-hcd.c
1090
if (fotg210->async_count > 0)
drivers/usb/fotg210/fotg210-hcd.c
1091
fotg210_set_command_bit(fotg210, CMD_ASE);
drivers/usb/fotg210/fotg210-hcd.c
1094
if (fotg210->async_count == 0) {
drivers/usb/fotg210/fotg210-hcd.c
1097
fotg210_enable_event(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1105
static void fotg210_disable_ASE(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1107
fotg210_clear_command_bit(fotg210, CMD_ASE);
drivers/usb/fotg210/fotg210-hcd.c
1112
static void fotg210_poll_PSS(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1117
if (fotg210->rh_state != FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
1120
want = (fotg210->command & CMD_PSE) ? STS_PSS : 0;
drivers/usb/fotg210/fotg210-hcd.c
1121
actual = fotg210_readl(fotg210, &fotg210->regs->status) & STS_PSS;
drivers/usb/fotg210/fotg210-hcd.c
1126
if (fotg210->PSS_poll_count++ < 20) {
drivers/usb/fotg210/fotg210-hcd.c
1127
fotg210_enable_event(fotg210, FOTG210_HRTIMER_POLL_PSS,
drivers/usb/fotg210/fotg210-hcd.c
1131
fotg210_dbg(fotg210, "Waited too long for the periodic schedule status (%x/%x), giving up\n",
drivers/usb/fotg210/fotg210-hcd.c
1134
fotg210->PSS_poll_count = 0;
drivers/usb/fotg210/fotg210-hcd.c
1138
if (fotg210->periodic_count > 0)
drivers/usb/fotg210/fotg210-hcd.c
1139
fotg210_set_command_bit(fotg210, CMD_PSE);
drivers/usb/fotg210/fotg210-hcd.c
1142
if (fotg210->periodic_count == 0) {
drivers/usb/fotg210/fotg210-hcd.c
1145
fotg210_enable_event(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
115
dbg_qtd(const char *label, struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd)
drivers/usb/fotg210/fotg210-hcd.c
1153
static void fotg210_disable_PSE(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1155
fotg210_clear_command_bit(fotg210, CMD_PSE);
drivers/usb/fotg210/fotg210-hcd.c
1160
static void fotg210_handle_controller_death(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1162
if (!(fotg210_readl(fotg210, &fotg210->regs->status) & STS_HALT)) {
drivers/usb/fotg210/fotg210-hcd.c
1165
if (fotg210->died_poll_count++ < 5) {
drivers/usb/fotg210/fotg210-hcd.c
1167
fotg210_enable_event(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
117
fotg210_dbg(fotg210, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
drivers/usb/fotg210/fotg210-hcd.c
1171
fotg210_warn(fotg210, "Waited too long for the controller to stop, giving up\n");
drivers/usb/fotg210/fotg210-hcd.c
1175
fotg210->rh_state = FOTG210_RH_HALTED;
drivers/usb/fotg210/fotg210-hcd.c
1176
fotg210_writel(fotg210, 0, &fotg210->regs->intr_enable);
drivers/usb/fotg210/fotg210-hcd.c
1177
fotg210_work(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1178
end_unlink_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
118
hc32_to_cpup(fotg210, &qtd->hw_next),
drivers/usb/fotg210/fotg210-hcd.c
1185
static void fotg210_handle_intr_unlinks(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1187
bool stopped = (fotg210->rh_state < FOTG210_RH_RUNNING);
drivers/usb/fotg210/fotg210-hcd.c
119
hc32_to_cpup(fotg210, &qtd->hw_alt_next),
drivers/usb/fotg210/fotg210-hcd.c
1196
fotg210->intr_unlinking = true;
drivers/usb/fotg210/fotg210-hcd.c
1197
while (fotg210->intr_unlink) {
drivers/usb/fotg210/fotg210-hcd.c
1198
struct fotg210_qh *qh = fotg210->intr_unlink;
drivers/usb/fotg210/fotg210-hcd.c
120
hc32_to_cpup(fotg210, &qtd->hw_token),
drivers/usb/fotg210/fotg210-hcd.c
1200
if (!stopped && qh->unlink_cycle == fotg210->intr_unlink_cycle)
drivers/usb/fotg210/fotg210-hcd.c
1202
fotg210->intr_unlink = qh->unlink_next;
drivers/usb/fotg210/fotg210-hcd.c
1204
end_unlink_intr(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
1208
if (fotg210->intr_unlink) {
drivers/usb/fotg210/fotg210-hcd.c
1209
fotg210_enable_event(fotg210, FOTG210_HRTIMER_UNLINK_INTR,
drivers/usb/fotg210/fotg210-hcd.c
121
hc32_to_cpup(fotg210, &qtd->hw_buf[0]));
drivers/usb/fotg210/fotg210-hcd.c
1211
++fotg210->intr_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
1213
fotg210->intr_unlinking = false;
drivers/usb/fotg210/fotg210-hcd.c
1218
static void start_free_itds(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1220
if (!(fotg210->enabled_hrtimer_events &
drivers/usb/fotg210/fotg210-hcd.c
1222
fotg210->last_itd_to_free = list_entry(
drivers/usb/fotg210/fotg210-hcd.c
1223
fotg210->cached_itd_list.prev,
drivers/usb/fotg210/fotg210-hcd.c
1225
fotg210_enable_event(fotg210, FOTG210_HRTIMER_FREE_ITDS, true);
drivers/usb/fotg210/fotg210-hcd.c
123
fotg210_dbg(fotg210, " p1=%08x p2=%08x p3=%08x p4=%08x\n",
drivers/usb/fotg210/fotg210-hcd.c
1230
static void end_free_itds(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1234
if (fotg210->rh_state < FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
1235
fotg210->last_itd_to_free = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1237
list_for_each_entry_safe(itd, n, &fotg210->cached_itd_list, itd_list) {
drivers/usb/fotg210/fotg210-hcd.c
1239
dma_pool_free(fotg210->itd_pool, itd, itd->itd_dma);
drivers/usb/fotg210/fotg210-hcd.c
124
hc32_to_cpup(fotg210, &qtd->hw_buf[1]),
drivers/usb/fotg210/fotg210-hcd.c
1240
if (itd == fotg210->last_itd_to_free)
drivers/usb/fotg210/fotg210-hcd.c
1244
if (!list_empty(&fotg210->cached_itd_list))
drivers/usb/fotg210/fotg210-hcd.c
1245
start_free_itds(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
125
hc32_to_cpup(fotg210, &qtd->hw_buf[2]),
drivers/usb/fotg210/fotg210-hcd.c
1250
static void fotg210_iaa_watchdog(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1252
if (fotg210->rh_state != FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
126
hc32_to_cpup(fotg210, &qtd->hw_buf[3]),
drivers/usb/fotg210/fotg210-hcd.c
1261
if (fotg210->async_iaa) {
drivers/usb/fotg210/fotg210-hcd.c
127
hc32_to_cpup(fotg210, &qtd->hw_buf[4]));
drivers/usb/fotg210/fotg210-hcd.c
1270
cmd = fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
1279
status = fotg210_readl(fotg210, &fotg210->regs->status);
drivers/usb/fotg210/fotg210-hcd.c
1281
INCR(fotg210->stats.lost_iaa);
drivers/usb/fotg210/fotg210-hcd.c
1282
fotg210_writel(fotg210, STS_IAA,
drivers/usb/fotg210/fotg210-hcd.c
1283
&fotg210->regs->status);
drivers/usb/fotg210/fotg210-hcd.c
1286
fotg210_dbg(fotg210, "IAA watchdog: status %x cmd %x\n",
drivers/usb/fotg210/fotg210-hcd.c
1288
end_unlink_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1294
static void turn_on_io_watchdog(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1297
if (fotg210->rh_state != FOTG210_RH_RUNNING ||
drivers/usb/fotg210/fotg210-hcd.c
1298
(fotg210->enabled_hrtimer_events &
drivers/usb/fotg210/fotg210-hcd.c
1306
if (fotg210->isoc_count > 0 || (fotg210->need_io_watchdog &&
drivers/usb/fotg210/fotg210-hcd.c
1307
fotg210->async_count + fotg210->intr_count > 0))
drivers/usb/fotg210/fotg210-hcd.c
1308
fotg210_enable_event(fotg210, FOTG210_HRTIMER_IO_WATCHDOG,
drivers/usb/fotg210/fotg210-hcd.c
131
dbg_qh(const char *label, struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
1332
struct fotg210_hcd *fotg210 =
drivers/usb/fotg210/fotg210-hcd.c
1339
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1341
events = fotg210->enabled_hrtimer_events;
drivers/usb/fotg210/fotg210-hcd.c
1342
fotg210->enabled_hrtimer_events = 0;
drivers/usb/fotg210/fotg210-hcd.c
1343
fotg210->next_hrtimer_event = FOTG210_HRTIMER_NO_EVENT;
drivers/usb/fotg210/fotg210-hcd.c
135
fotg210_dbg(fotg210, "%s qh %p n%08x info %x %x qtd %x\n", label, qh,
drivers/usb/fotg210/fotg210-hcd.c
1351
if (ktime_compare(now, fotg210->hr_timeouts[e]) >= 0)
drivers/usb/fotg210/fotg210-hcd.c
1352
event_handlers[e](fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1354
fotg210_enable_event(fotg210, e, false);
drivers/usb/fotg210/fotg210-hcd.c
1357
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1364
static int check_reset_complete(struct fotg210_hcd *fotg210, int index,
drivers/usb/fotg210/fotg210-hcd.c
1373
fotg210_dbg(fotg210, "Failed to enable port %d on root hub TT\n",
drivers/usb/fotg210/fotg210-hcd.c
1376
fotg210_dbg(fotg210, "port %d reset complete, port enabled\n",
drivers/usb/fotg210/fotg210-hcd.c
1387
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
139
dbg_qtd("overlay", fotg210, (struct fotg210_qtd *) &hw->hw_qtd_next);
drivers/usb/fotg210/fotg210-hcd.c
1399
status = fotg210->resuming_ports;
drivers/usb/fotg210/fotg210-hcd.c
1407
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1409
temp = fotg210_readl(fotg210, &fotg210->regs->port_status);
drivers/usb/fotg210/fotg210-hcd.c
1418
if ((temp & mask) != 0 || test_bit(0, &fotg210->port_c_suspend) ||
drivers/usb/fotg210/fotg210-hcd.c
1419
(fotg210->reset_done[0] &&
drivers/usb/fotg210/fotg210-hcd.c
1420
time_after_eq(jiffies, fotg210->reset_done[0]))) {
drivers/usb/fotg210/fotg210-hcd.c
1425
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1429
static void fotg210_hub_descriptor(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
143
dbg_itd(const char *label, struct fotg210_hcd *fotg210, struct fotg210_itd *itd)
drivers/usb/fotg210/fotg210-hcd.c
1432
int ports = HCS_N_PORTS(fotg210->hcs_params);
drivers/usb/fotg210/fotg210-hcd.c
145
fotg210_dbg(fotg210, "%s[%d] itd %p, next %08x, urb %p\n", label,
drivers/usb/fotg210/fotg210-hcd.c
1455
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
1456
int ports = HCS_N_PORTS(fotg210->hcs_params);
drivers/usb/fotg210/fotg210-hcd.c
1457
u32 __iomem *status_reg = &fotg210->regs->port_status;
drivers/usb/fotg210/fotg210-hcd.c
146
itd->frame, itd, hc32_to_cpu(fotg210, itd->hw_next),
drivers/usb/fotg210/fotg210-hcd.c
1470
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1486
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
149
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1498
fotg210_writel(fotg210, temp & ~PORT_PE, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1501
fotg210_writel(fotg210, temp | PORT_PEC, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
151
hc32_to_cpu(fotg210, itd->hw_transaction[0]),
drivers/usb/fotg210/fotg210-hcd.c
1512
fotg210_writel(fotg210, temp | PORT_RESUME, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1513
fotg210->reset_done[wIndex] = jiffies
drivers/usb/fotg210/fotg210-hcd.c
1517
clear_bit(wIndex, &fotg210->port_c_suspend);
drivers/usb/fotg210/fotg210-hcd.c
152
hc32_to_cpu(fotg210, itd->hw_transaction[1]),
drivers/usb/fotg210/fotg210-hcd.c
1520
fotg210_writel(fotg210, temp | PORT_CSC, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1523
fotg210_writel(fotg210, temp | OTGISR_OVC,
drivers/usb/fotg210/fotg210-hcd.c
1524
&fotg210->regs->otgisr);
drivers/usb/fotg210/fotg210-hcd.c
153
hc32_to_cpu(fotg210, itd->hw_transaction[2]),
drivers/usb/fotg210/fotg210-hcd.c
1532
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
1535
fotg210_hub_descriptor(fotg210, (struct usb_hub_descriptor *)
drivers/usb/fotg210/fotg210-hcd.c
154
hc32_to_cpu(fotg210, itd->hw_transaction[3]),
drivers/usb/fotg210/fotg210-hcd.c
1548
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
155
hc32_to_cpu(fotg210, itd->hw_transaction[4]),
drivers/usb/fotg210/fotg210-hcd.c
1556
temp1 = fotg210_readl(fotg210, &fotg210->regs->otgisr);
drivers/usb/fotg210/fotg210-hcd.c
156
hc32_to_cpu(fotg210, itd->hw_transaction[5]),
drivers/usb/fotg210/fotg210-hcd.c
1564
if (!fotg210->reset_done[wIndex]) {
drivers/usb/fotg210/fotg210-hcd.c
1566
fotg210->reset_done[wIndex] = jiffies
drivers/usb/fotg210/fotg210-hcd.c
1569
mod_timer(&fotg210_to_hcd(fotg210)->rh_timer,
drivers/usb/fotg210/fotg210-hcd.c
157
hc32_to_cpu(fotg210, itd->hw_transaction[6]),
drivers/usb/fotg210/fotg210-hcd.c
1570
fotg210->reset_done[wIndex]);
drivers/usb/fotg210/fotg210-hcd.c
1575
fotg210->reset_done[wIndex])) {
drivers/usb/fotg210/fotg210-hcd.c
1576
clear_bit(wIndex, &fotg210->suspended_ports);
drivers/usb/fotg210/fotg210-hcd.c
1577
set_bit(wIndex, &fotg210->port_c_suspend);
drivers/usb/fotg210/fotg210-hcd.c
1578
fotg210->reset_done[wIndex] = 0;
drivers/usb/fotg210/fotg210-hcd.c
158
hc32_to_cpu(fotg210, itd->hw_transaction[7]));
drivers/usb/fotg210/fotg210-hcd.c
1581
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1582
fotg210_writel(fotg210, temp &
drivers/usb/fotg210/fotg210-hcd.c
1585
clear_bit(wIndex, &fotg210->resuming_ports);
drivers/usb/fotg210/fotg210-hcd.c
1586
retval = handshake(fotg210, status_reg,
drivers/usb/fotg210/fotg210-hcd.c
1589
fotg210_err(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
160
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1600
fotg210->reset_done[wIndex])) {
drivers/usb/fotg210/fotg210-hcd.c
1602
fotg210->reset_done[wIndex] = 0;
drivers/usb/fotg210/fotg210-hcd.c
1603
clear_bit(wIndex, &fotg210->resuming_ports);
drivers/usb/fotg210/fotg210-hcd.c
1606
fotg210_writel(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1612
retval = handshake(fotg210, status_reg,
drivers/usb/fotg210/fotg210-hcd.c
1615
fotg210_err(fotg210, "port %d reset error %d\n",
drivers/usb/fotg210/fotg210-hcd.c
162
hc32_to_cpu(fotg210, itd->hw_bufp[0]),
drivers/usb/fotg210/fotg210-hcd.c
1621
temp = check_reset_complete(fotg210, wIndex, status_reg,
drivers/usb/fotg210/fotg210-hcd.c
1622
fotg210_readl(fotg210, status_reg));
drivers/usb/fotg210/fotg210-hcd.c
1625
fotg210->command |= CMD_RUN;
drivers/usb/fotg210/fotg210-hcd.c
1626
fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
163
hc32_to_cpu(fotg210, itd->hw_bufp[1]),
drivers/usb/fotg210/fotg210-hcd.c
1630
fotg210->reset_done[wIndex] = 0;
drivers/usb/fotg210/fotg210-hcd.c
1631
clear_bit(wIndex, &fotg210->resuming_ports);
drivers/usb/fotg210/fotg210-hcd.c
1636
test_bit(wIndex, &fotg210->companion_ports)) {
drivers/usb/fotg210/fotg210-hcd.c
1638
fotg210_writel(fotg210, temp, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1639
fotg210_dbg(fotg210, "port %d --> companion\n",
drivers/usb/fotg210/fotg210-hcd.c
164
hc32_to_cpu(fotg210, itd->hw_bufp[2]),
drivers/usb/fotg210/fotg210-hcd.c
1641
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
165
hc32_to_cpu(fotg210, itd->hw_bufp[3]),
drivers/usb/fotg210/fotg210-hcd.c
1652
status |= fotg210_port_speed(fotg210, temp);
drivers/usb/fotg210/fotg210-hcd.c
166
hc32_to_cpu(fotg210, itd->hw_bufp[4]),
drivers/usb/fotg210/fotg210-hcd.c
1660
} else if (test_bit(wIndex, &fotg210->suspended_ports)) {
drivers/usb/fotg210/fotg210-hcd.c
1661
clear_bit(wIndex, &fotg210->suspended_ports);
drivers/usb/fotg210/fotg210-hcd.c
1662
clear_bit(wIndex, &fotg210->resuming_ports);
drivers/usb/fotg210/fotg210-hcd.c
1663
fotg210->reset_done[wIndex] = 0;
drivers/usb/fotg210/fotg210-hcd.c
1665
set_bit(wIndex, &fotg210->port_c_suspend);
drivers/usb/fotg210/fotg210-hcd.c
1668
temp1 = fotg210_readl(fotg210, &fotg210->regs->otgisr);
drivers/usb/fotg210/fotg210-hcd.c
167
hc32_to_cpu(fotg210, itd->hw_bufp[5]),
drivers/usb/fotg210/fotg210-hcd.c
1673
if (test_bit(wIndex, &fotg210->port_c_suspend))
drivers/usb/fotg210/fotg210-hcd.c
1677
dbg_port(fotg210, "GetStatus", wIndex + 1, temp);
drivers/usb/fotg210/fotg210-hcd.c
168
hc32_to_cpu(fotg210, itd->hw_bufp[6]));
drivers/usb/fotg210/fotg210-hcd.c
1697
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
170
fotg210_dbg(fotg210, " index: %d %d %d %d %d %d %d %d\n",
drivers/usb/fotg210/fotg210-hcd.c
1709
fotg210_writel(fotg210, temp | PORT_SUSPEND,
drivers/usb/fotg210/fotg210-hcd.c
1711
set_bit(wIndex, &fotg210->suspended_ports);
drivers/usb/fotg210/fotg210-hcd.c
1720
fotg210_dbg(fotg210, "port %d reset\n", wIndex + 1);
drivers/usb/fotg210/fotg210-hcd.c
1728
fotg210->reset_done[wIndex] = jiffies
drivers/usb/fotg210/fotg210-hcd.c
1730
fotg210_writel(fotg210, temp, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1742
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1743
fotg210_quiesce(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1744
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1747
temp = fotg210_readl(fotg210, status_reg) &
drivers/usb/fotg210/fotg210-hcd.c
1750
fotg210_writel(fotg210, temp | PORT_SUSPEND,
drivers/usb/fotg210/fotg210-hcd.c
1753
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1754
fotg210_halt(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1755
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1757
temp = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1759
fotg210_writel(fotg210, temp, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
1765
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
1773
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
1800
static inline void fotg210_qtd_init(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1805
qtd->hw_token = cpu_to_hc32(fotg210, QTD_STS_HALT);
drivers/usb/fotg210/fotg210-hcd.c
1806
qtd->hw_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1807
qtd->hw_alt_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1811
static struct fotg210_qtd *fotg210_qtd_alloc(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1817
qtd = dma_pool_alloc(fotg210->qtd_pool, flags, &dma);
drivers/usb/fotg210/fotg210-hcd.c
1819
fotg210_qtd_init(fotg210, qtd, dma);
drivers/usb/fotg210/fotg210-hcd.c
1824
static inline void fotg210_qtd_free(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1827
dma_pool_free(fotg210->qtd_pool, qtd, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
1831
static void qh_destroy(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
1835
fotg210_dbg(fotg210, "unused qh not empty!\n");
drivers/usb/fotg210/fotg210-hcd.c
1839
fotg210_qtd_free(fotg210, qh->dummy);
drivers/usb/fotg210/fotg210-hcd.c
1840
dma_pool_free(fotg210->qh_pool, qh->hw, qh->qh_dma);
drivers/usb/fotg210/fotg210-hcd.c
1844
static struct fotg210_qh *fotg210_qh_alloc(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
1854
dma_pool_zalloc(fotg210->qh_pool, flags, &dma);
drivers/usb/fotg210/fotg210-hcd.c
1861
qh->dummy = fotg210_qtd_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
1863
fotg210_dbg(fotg210, "no dummy td\n");
drivers/usb/fotg210/fotg210-hcd.c
1869
dma_pool_free(fotg210->qh_pool, qh->hw, qh->qh_dma);
drivers/usb/fotg210/fotg210-hcd.c
1880
static void fotg210_mem_cleanup(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
1882
if (fotg210->async)
drivers/usb/fotg210/fotg210-hcd.c
1883
qh_destroy(fotg210, fotg210->async);
drivers/usb/fotg210/fotg210-hcd.c
1884
fotg210->async = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1886
if (fotg210->dummy)
drivers/usb/fotg210/fotg210-hcd.c
1887
qh_destroy(fotg210, fotg210->dummy);
drivers/usb/fotg210/fotg210-hcd.c
1888
fotg210->dummy = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1891
dma_pool_destroy(fotg210->qtd_pool);
drivers/usb/fotg210/fotg210-hcd.c
1892
fotg210->qtd_pool = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1894
dma_pool_destroy(fotg210->qh_pool);
drivers/usb/fotg210/fotg210-hcd.c
1895
fotg210->qh_pool = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1897
dma_pool_destroy(fotg210->itd_pool);
drivers/usb/fotg210/fotg210-hcd.c
1898
fotg210->itd_pool = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1900
if (fotg210->periodic)
drivers/usb/fotg210/fotg210-hcd.c
1901
dma_free_coherent(fotg210_to_hcd(fotg210)->self.controller,
drivers/usb/fotg210/fotg210-hcd.c
1902
fotg210->periodic_size * sizeof(u32),
drivers/usb/fotg210/fotg210-hcd.c
1903
fotg210->periodic, fotg210->periodic_dma);
drivers/usb/fotg210/fotg210-hcd.c
1904
fotg210->periodic = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1907
kfree(fotg210->pshadow);
drivers/usb/fotg210/fotg210-hcd.c
1908
fotg210->pshadow = NULL;
drivers/usb/fotg210/fotg210-hcd.c
1912
static int fotg210_mem_init(struct fotg210_hcd *fotg210, gfp_t flags)
drivers/usb/fotg210/fotg210-hcd.c
1917
fotg210->qtd_pool = dma_pool_create("fotg210_qtd",
drivers/usb/fotg210/fotg210-hcd.c
1918
fotg210_to_hcd(fotg210)->self.controller,
drivers/usb/fotg210/fotg210-hcd.c
1922
if (!fotg210->qtd_pool)
drivers/usb/fotg210/fotg210-hcd.c
1926
fotg210->qh_pool = dma_pool_create("fotg210_qh",
drivers/usb/fotg210/fotg210-hcd.c
1927
fotg210_to_hcd(fotg210)->self.controller,
drivers/usb/fotg210/fotg210-hcd.c
1931
if (!fotg210->qh_pool)
drivers/usb/fotg210/fotg210-hcd.c
1934
fotg210->async = fotg210_qh_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
1935
if (!fotg210->async)
drivers/usb/fotg210/fotg210-hcd.c
1939
fotg210->itd_pool = dma_pool_create("fotg210_itd",
drivers/usb/fotg210/fotg210-hcd.c
1940
fotg210_to_hcd(fotg210)->self.controller,
drivers/usb/fotg210/fotg210-hcd.c
1944
if (!fotg210->itd_pool)
drivers/usb/fotg210/fotg210-hcd.c
1948
fotg210->periodic =
drivers/usb/fotg210/fotg210-hcd.c
1949
dma_alloc_coherent(fotg210_to_hcd(fotg210)->self.controller,
drivers/usb/fotg210/fotg210-hcd.c
1950
fotg210->periodic_size * sizeof(__le32),
drivers/usb/fotg210/fotg210-hcd.c
1951
&fotg210->periodic_dma, 0);
drivers/usb/fotg210/fotg210-hcd.c
1952
if (fotg210->periodic == NULL)
drivers/usb/fotg210/fotg210-hcd.c
1955
for (i = 0; i < fotg210->periodic_size; i++)
drivers/usb/fotg210/fotg210-hcd.c
1956
fotg210->periodic[i] = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1959
fotg210->pshadow = kcalloc(fotg210->periodic_size, sizeof(void *),
drivers/usb/fotg210/fotg210-hcd.c
1961
if (fotg210->pshadow != NULL)
drivers/usb/fotg210/fotg210-hcd.c
1965
fotg210_dbg(fotg210, "couldn't init memory\n");
drivers/usb/fotg210/fotg210-hcd.c
1966
fotg210_mem_cleanup(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
1987
static int qtd_fill(struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd,
drivers/usb/fotg210/fotg210-hcd.c
1994
qtd->hw_buf[0] = cpu_to_hc32(fotg210, (u32)addr);
drivers/usb/fotg210/fotg210-hcd.c
1995
qtd->hw_buf_hi[0] = cpu_to_hc32(fotg210, (u32)(addr >> 32));
drivers/usb/fotg210/fotg210-hcd.c
2006
qtd->hw_buf[i] = cpu_to_hc32(fotg210, (u32)addr);
drivers/usb/fotg210/fotg210-hcd.c
2007
qtd->hw_buf_hi[i] = cpu_to_hc32(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2020
qtd->hw_token = cpu_to_hc32(fotg210, (count << 16) | token);
drivers/usb/fotg210/fotg210-hcd.c
2026
static inline void qh_update(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2034
hw->hw_qtd_next = QTD_NEXT(fotg210, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
2035
hw->hw_alt_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2042
if (!(hw->hw_info1 & cpu_to_hc32(fotg210, QH_TOGGLE_CTL))) {
drivers/usb/fotg210/fotg210-hcd.c
2046
epnum = (hc32_to_cpup(fotg210, &hw->hw_info1) >> 8) & 0x0f;
drivers/usb/fotg210/fotg210-hcd.c
2048
hw->hw_token &= ~cpu_to_hc32(fotg210, QTD_TOGGLE);
drivers/usb/fotg210/fotg210-hcd.c
2053
hw->hw_token &= cpu_to_hc32(fotg210, QTD_TOGGLE | QTD_STS_PING);
drivers/usb/fotg210/fotg210-hcd.c
2060
static void qh_refresh(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
2076
if (cpu_to_hc32(fotg210, qtd->qtd_dma) == qh->hw->hw_current) {
drivers/usb/fotg210/fotg210-hcd.c
2083
qh_update(fotg210, qh, qtd);
drivers/usb/fotg210/fotg210-hcd.c
2086
static void qh_link_async(struct fotg210_hcd *fotg210, struct fotg210_qh *qh);
drivers/usb/fotg210/fotg210-hcd.c
2091
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
2095
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
2098
&& fotg210->rh_state == FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
2099
qh_link_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
2100
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
2103
static void fotg210_clear_tt_buffer(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2122
fotg210_to_hcd(fotg210)->self.root_hub) {
drivers/usb/fotg210/fotg210-hcd.c
2129
static int qtd_copy_status(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
2168
fotg210_dbg(fotg210, "devpath %s ep%d%s 3strikes\n",
drivers/usb/fotg210/fotg210-hcd.c
2177
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2188
static void fotg210_urb_done(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
2190
__releases(fotg210->lock)
drivers/usb/fotg210/fotg210-hcd.c
2191
__acquires(fotg210->lock)
drivers/usb/fotg210/fotg210-hcd.c
2197
if ((qh->hw->hw_info2 & cpu_to_hc32(fotg210, QH_SMASK)) != 0) {
drivers/usb/fotg210/fotg210-hcd.c
2200
fotg210_to_hcd(fotg210)->self.bandwidth_int_reqs--;
drivers/usb/fotg210/fotg210-hcd.c
2205
INCR(fotg210->stats.unlink);
drivers/usb/fotg210/fotg210-hcd.c
2210
INCR(fotg210->stats.complete);
drivers/usb/fotg210/fotg210-hcd.c
2214
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2224
usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
2225
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
2226
usb_hcd_giveback_urb(fotg210_to_hcd(fotg210), urb, status);
drivers/usb/fotg210/fotg210-hcd.c
2227
spin_lock(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
2230
static int qh_schedule(struct fotg210_hcd *fotg210, struct fotg210_qh *qh);
drivers/usb/fotg210/fotg210-hcd.c
2236
static unsigned qh_completions(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2283
fotg210_urb_done(fotg210, last->urb,
drivers/usb/fotg210/fotg210-hcd.c
2288
fotg210_qtd_free(fotg210, last);
drivers/usb/fotg210/fotg210-hcd.c
2298
token = hc32_to_cpu(fotg210, qtd->hw_token);
drivers/usb/fotg210/fotg210-hcd.c
2306
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2325
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2339
qtd->hw_token = cpu_to_hc32(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2342
hw->hw_token = cpu_to_hc32(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2359
FOTG210_LIST_END(fotg210))) {
drivers/usb/fotg210/fotg210-hcd.c
2365
&& fotg210->rh_state >= FOTG210_RH_RUNNING)) {
drivers/usb/fotg210/fotg210-hcd.c
2373
if (fotg210->rh_state < FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
2384
cpu_to_hc32(fotg210, qtd->qtd_dma)
drivers/usb/fotg210/fotg210-hcd.c
2386
token = hc32_to_cpu(fotg210, hw->hw_token);
drivers/usb/fotg210/fotg210-hcd.c
2392
fotg210_clear_tt_buffer(fotg210, qh, urb,
drivers/usb/fotg210/fotg210-hcd.c
2405
last_status = qtd_copy_status(fotg210, urb,
drivers/usb/fotg210/fotg210-hcd.c
2409
FOTG210_LIST_END(fotg210)))
drivers/usb/fotg210/fotg210-hcd.c
2427
fotg210_clear_tt_buffer(fotg210, qh,
drivers/usb/fotg210/fotg210-hcd.c
2451
fotg210_urb_done(fotg210, last->urb, last_status);
drivers/usb/fotg210/fotg210-hcd.c
2453
fotg210_qtd_free(fotg210, last);
drivers/usb/fotg210/fotg210-hcd.c
2478
if (stopped != 0 || hw->hw_qtd_next == FOTG210_LIST_END(fotg210)) {
drivers/usb/fotg210/fotg210-hcd.c
2481
qh_refresh(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
2509
static void qtd_list_free(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
2516
fotg210_qtd_free(fotg210, qtd);
drivers/usb/fotg210/fotg210-hcd.c
2522
static struct list_head *qh_urb_transaction(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2536
qtd = fotg210_qtd_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
2550
qtd_fill(fotg210, qtd, urb->setup_dma,
drivers/usb/fotg210/fotg210-hcd.c
2557
qtd = fotg210_qtd_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
2561
qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
2601
this_qtd_len = qtd_fill(fotg210, qtd, buf, this_sg_len, token,
drivers/usb/fotg210/fotg210-hcd.c
2613
qtd->hw_alt_next = fotg210->async->hw->hw_alt_next;
drivers/usb/fotg210/fotg210-hcd.c
262
#define dbg_status(fotg210, label, status) { \
drivers/usb/fotg210/fotg210-hcd.c
2628
qtd = fotg210_qtd_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
2632
qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
2643
qtd->hw_alt_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
265
fotg210_dbg(fotg210, "%s\n", _buf); \
drivers/usb/fotg210/fotg210-hcd.c
2664
qtd = fotg210_qtd_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
2668
qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
2672
qtd_fill(fotg210, qtd, 0, 0, token, 0);
drivers/usb/fotg210/fotg210-hcd.c
2678
qtd->hw_token |= cpu_to_hc32(fotg210, QTD_IOC);
drivers/usb/fotg210/fotg210-hcd.c
268
#define dbg_cmd(fotg210, label, command) { \
drivers/usb/fotg210/fotg210-hcd.c
2682
qtd_list_free(fotg210, urb, head);
drivers/usb/fotg210/fotg210-hcd.c
2701
static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
2704
struct fotg210_qh *qh = fotg210_qh_alloc(fotg210, flags);
drivers/usb/fotg210/fotg210-hcd.c
271
fotg210_dbg(fotg210, "%s\n", _buf); \
drivers/usb/fotg210/fotg210-hcd.c
2732
fotg210_dbg(fotg210, "bogus qh maxpacket %d\n", maxp);
drivers/usb/fotg210/fotg210-hcd.c
274
#define dbg_port(fotg210, label, port, status) { \
drivers/usb/fotg210/fotg210-hcd.c
276
fotg210_dbg(fotg210, "%s\n", \
drivers/usb/fotg210/fotg210-hcd.c
2760
} else if (qh->period > fotg210->periodic_size) {
drivers/usb/fotg210/fotg210-hcd.c
2761
qh->period = fotg210->periodic_size;
drivers/usb/fotg210/fotg210-hcd.c
2785
if (qh->period > fotg210->periodic_size) {
drivers/usb/fotg210/fotg210-hcd.c
2786
qh->period = fotg210->periodic_size;
drivers/usb/fotg210/fotg210-hcd.c
2816
if (fotg210_has_fsl_portno_bug(fotg210))
drivers/usb/fotg210/fotg210-hcd.c
2824
if (tt && tt->hub != fotg210_to_hcd(fotg210)->self.root_hub)
drivers/usb/fotg210/fotg210-hcd.c
2854
fotg210_dbg(fotg210, "bogus dev %p speed %d\n", urb->dev,
drivers/usb/fotg210/fotg210-hcd.c
2857
qh_destroy(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
2866
hw->hw_info1 = cpu_to_hc32(fotg210, info1);
drivers/usb/fotg210/fotg210-hcd.c
2867
hw->hw_info2 = cpu_to_hc32(fotg210, info2);
drivers/usb/fotg210/fotg210-hcd.c
2870
qh_refresh(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
2874
static void enable_async(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
2876
if (fotg210->async_count++)
drivers/usb/fotg210/fotg210-hcd.c
2880
fotg210->enabled_hrtimer_events &= ~BIT(FOTG210_HRTIMER_DISABLE_ASYNC);
drivers/usb/fotg210/fotg210-hcd.c
2883
fotg210_poll_ASS(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2884
turn_on_io_watchdog(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2887
static void disable_async(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
2889
if (--fotg210->async_count)
drivers/usb/fotg210/fotg210-hcd.c
2893
WARN_ON(fotg210->async->qh_next.qh || fotg210->async_unlink);
drivers/usb/fotg210/fotg210-hcd.c
2896
fotg210_poll_ASS(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2901
static void qh_link_async(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
2903
__hc32 dma = QH_NEXT(fotg210, qh->qh_dma);
drivers/usb/fotg210/fotg210-hcd.c
2913
qh_refresh(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
2916
head = fotg210->async;
drivers/usb/fotg210/fotg210-hcd.c
2928
enable_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2936
static struct fotg210_qh *qh_append_tds(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
2941
__hc32 qh_addr_mask = cpu_to_hc32(fotg210, 0x7f);
drivers/usb/fotg210/fotg210-hcd.c
2946
qh = qh_make(fotg210, urb, GFP_ATOMIC);
drivers/usb/fotg210/fotg210-hcd.c
2979
qtd->hw_token = HALT_BIT(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
2991
fotg210_qtd_init(fotg210, qtd, qtd->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
2998
qtd->hw_next = QTD_NEXT(fotg210, dma);
drivers/usb/fotg210/fotg210-hcd.c
3010
static int submit_async(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
3025
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3035
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
3036
if (unlikely(!HCD_HW_ACCESSIBLE(fotg210_to_hcd(fotg210)))) {
drivers/usb/fotg210/fotg210-hcd.c
3040
rc = usb_hcd_link_urb_to_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
3044
qh = qh_append_tds(fotg210, urb, qtd_list, epnum, &urb->ep->hcpriv);
drivers/usb/fotg210/fotg210-hcd.c
3046
usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
3055
qh_link_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3057
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
3059
qtd_list_free(fotg210, urb, qtd_list);
drivers/usb/fotg210/fotg210-hcd.c
3063
static void single_unlink_async(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3070
if (fotg210->async_unlink)
drivers/usb/fotg210/fotg210-hcd.c
3071
fotg210->async_unlink_last->unlink_next = qh;
drivers/usb/fotg210/fotg210-hcd.c
3073
fotg210->async_unlink = qh;
drivers/usb/fotg210/fotg210-hcd.c
3074
fotg210->async_unlink_last = qh;
drivers/usb/fotg210/fotg210-hcd.c
3077
prev = fotg210->async;
drivers/usb/fotg210/fotg210-hcd.c
3083
if (fotg210->qh_scan_next == qh)
drivers/usb/fotg210/fotg210-hcd.c
3084
fotg210->qh_scan_next = qh->qh_next.qh;
drivers/usb/fotg210/fotg210-hcd.c
3087
static void start_iaa_cycle(struct fotg210_hcd *fotg210, bool nested)
drivers/usb/fotg210/fotg210-hcd.c
3093
if (fotg210->async_iaa || fotg210->async_unlinking)
drivers/usb/fotg210/fotg210-hcd.c
3097
fotg210->async_iaa = fotg210->async_unlink;
drivers/usb/fotg210/fotg210-hcd.c
3098
fotg210->async_unlink = NULL;
drivers/usb/fotg210/fotg210-hcd.c
3101
if (unlikely(fotg210->rh_state < FOTG210_RH_RUNNING)) {
drivers/usb/fotg210/fotg210-hcd.c
3103
end_unlink_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3106
} else if (likely(fotg210->rh_state == FOTG210_RH_RUNNING)) {
drivers/usb/fotg210/fotg210-hcd.c
3110
fotg210_writel(fotg210, fotg210->command | CMD_IAAD,
drivers/usb/fotg210/fotg210-hcd.c
3111
&fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
3112
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
3113
fotg210_enable_event(fotg210, FOTG210_HRTIMER_IAA_WATCHDOG,
drivers/usb/fotg210/fotg210-hcd.c
3120
static void end_unlink_async(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
3126
fotg210->async_unlinking = true;
drivers/usb/fotg210/fotg210-hcd.c
3127
while (fotg210->async_iaa) {
drivers/usb/fotg210/fotg210-hcd.c
3128
qh = fotg210->async_iaa;
drivers/usb/fotg210/fotg210-hcd.c
3129
fotg210->async_iaa = qh->unlink_next;
drivers/usb/fotg210/fotg210-hcd.c
3135
qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3137
fotg210->rh_state == FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
3138
qh_link_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3139
disable_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3141
fotg210->async_unlinking = false;
drivers/usb/fotg210/fotg210-hcd.c
3144
if (fotg210->async_unlink) {
drivers/usb/fotg210/fotg210-hcd.c
3145
start_iaa_cycle(fotg210, true);
drivers/usb/fotg210/fotg210-hcd.c
3146
if (unlikely(fotg210->rh_state < FOTG210_RH_RUNNING))
drivers/usb/fotg210/fotg210-hcd.c
3151
static void unlink_empty_async(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
3154
bool stopped = (fotg210->rh_state < FOTG210_RH_RUNNING);
drivers/usb/fotg210/fotg210-hcd.c
3158
next = fotg210->async->qh_next.qh;
drivers/usb/fotg210/fotg210-hcd.c
3166
fotg210->async_unlink_cycle)
drivers/usb/fotg210/fotg210-hcd.c
3169
single_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3174
if (fotg210->async_unlink)
drivers/usb/fotg210/fotg210-hcd.c
3175
start_iaa_cycle(fotg210, false);
drivers/usb/fotg210/fotg210-hcd.c
3179
fotg210_enable_event(fotg210, FOTG210_HRTIMER_ASYNC_UNLINKS,
drivers/usb/fotg210/fotg210-hcd.c
3181
++fotg210->async_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
3188
static void start_unlink_async(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3202
single_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3203
start_iaa_cycle(fotg210, false);
drivers/usb/fotg210/fotg210-hcd.c
3206
static void scan_async(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
3211
fotg210->qh_scan_next = fotg210->async->qh_next.qh;
drivers/usb/fotg210/fotg210-hcd.c
3212
while (fotg210->qh_scan_next) {
drivers/usb/fotg210/fotg210-hcd.c
3213
qh = fotg210->qh_scan_next;
drivers/usb/fotg210/fotg210-hcd.c
3214
fotg210->qh_scan_next = qh->qh_next.qh;
drivers/usb/fotg210/fotg210-hcd.c
3227
temp = qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3229
start_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3232
qh->unlink_cycle = fotg210->async_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
3245
if (check_unlinks_later && fotg210->rh_state == FOTG210_RH_RUNNING &&
drivers/usb/fotg210/fotg210-hcd.c
3246
!(fotg210->enabled_hrtimer_events &
drivers/usb/fotg210/fotg210-hcd.c
3248
fotg210_enable_event(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3250
++fotg210->async_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
3270
static union fotg210_shadow *periodic_next_shadow(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3273
switch (hc32_to_cpu(fotg210, tag)) {
drivers/usb/fotg210/fotg210-hcd.c
3283
static __hc32 *shadow_next_periodic(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3286
switch (hc32_to_cpu(fotg210, tag)) {
drivers/usb/fotg210/fotg210-hcd.c
3297
static void periodic_unlink(struct fotg210_hcd *fotg210, unsigned frame,
drivers/usb/fotg210/fotg210-hcd.c
3300
union fotg210_shadow *prev_p = &fotg210->pshadow[frame];
drivers/usb/fotg210/fotg210-hcd.c
3301
__hc32 *hw_p = &fotg210->periodic[frame];
drivers/usb/fotg210/fotg210-hcd.c
3306
prev_p = periodic_next_shadow(fotg210, prev_p,
drivers/usb/fotg210/fotg210-hcd.c
3307
Q_NEXT_TYPE(fotg210, *hw_p));
drivers/usb/fotg210/fotg210-hcd.c
3308
hw_p = shadow_next_periodic(fotg210, &here,
drivers/usb/fotg210/fotg210-hcd.c
3309
Q_NEXT_TYPE(fotg210, *hw_p));
drivers/usb/fotg210/fotg210-hcd.c
3319
*prev_p = *periodic_next_shadow(fotg210, &here,
drivers/usb/fotg210/fotg210-hcd.c
3320
Q_NEXT_TYPE(fotg210, *hw_p));
drivers/usb/fotg210/fotg210-hcd.c
3322
*hw_p = *shadow_next_periodic(fotg210, &here,
drivers/usb/fotg210/fotg210-hcd.c
3323
Q_NEXT_TYPE(fotg210, *hw_p));
drivers/usb/fotg210/fotg210-hcd.c
3327
static unsigned short periodic_usecs(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3330
__hc32 *hw_p = &fotg210->periodic[frame];
drivers/usb/fotg210/fotg210-hcd.c
3331
union fotg210_shadow *q = &fotg210->pshadow[frame];
drivers/usb/fotg210/fotg210-hcd.c
3336
switch (hc32_to_cpu(fotg210, Q_NEXT_TYPE(fotg210, *hw_p))) {
drivers/usb/fotg210/fotg210-hcd.c
3340
if (hw->hw_info2 & cpu_to_hc32(fotg210, 1 << uframe))
drivers/usb/fotg210/fotg210-hcd.c
3343
if (hw->hw_info2 & cpu_to_hc32(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3354
if (q->fstn->hw_prev != FOTG210_LIST_END(fotg210))
drivers/usb/fotg210/fotg210-hcd.c
3355
fotg210_dbg(fotg210, "ignoring FSTN cost ...\n");
drivers/usb/fotg210/fotg210-hcd.c
3368
if (usecs > fotg210->uframe_periodic_max)
drivers/usb/fotg210/fotg210-hcd.c
3369
fotg210_err(fotg210, "uframe %d sched overrun: %d usecs\n",
drivers/usb/fotg210/fotg210-hcd.c
339
static inline char token_mark(struct fotg210_hcd *fotg210, __hc32 token)
drivers/usb/fotg210/fotg210-hcd.c
3390
static int tt_no_collision(struct fotg210_hcd *fotg210, unsigned period,
drivers/usb/fotg210/fotg210-hcd.c
3400
for (; frame < fotg210->periodic_size; frame += period) {
drivers/usb/fotg210/fotg210-hcd.c
3405
here = fotg210->pshadow[frame];
drivers/usb/fotg210/fotg210-hcd.c
3406
type = Q_NEXT_TYPE(fotg210, fotg210->periodic[frame]);
drivers/usb/fotg210/fotg210-hcd.c
3408
switch (hc32_to_cpu(fotg210, type)) {
drivers/usb/fotg210/fotg210-hcd.c
341
__u32 v = hc32_to_cpu(fotg210, token);
drivers/usb/fotg210/fotg210-hcd.c
3410
type = Q_NEXT_TYPE(fotg210, here.itd->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
3418
mask = hc32_to_cpu(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3425
type = Q_NEXT_TYPE(fotg210, hw->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
3430
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3444
static void enable_periodic(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
3446
if (fotg210->periodic_count++)
drivers/usb/fotg210/fotg210-hcd.c
3450
fotg210->enabled_hrtimer_events &=
drivers/usb/fotg210/fotg210-hcd.c
3454
fotg210_poll_PSS(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3455
turn_on_io_watchdog(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3458
static void disable_periodic(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
3460
if (--fotg210->periodic_count)
drivers/usb/fotg210/fotg210-hcd.c
3464
fotg210_poll_PSS(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3473
static void qh_link_periodic(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
3480
hc32_to_cpup(fotg210, &qh->hw->hw_info2) &
drivers/usb/fotg210/fotg210-hcd.c
3488
for (i = qh->start; i < fotg210->periodic_size; i += period) {
drivers/usb/fotg210/fotg210-hcd.c
3489
union fotg210_shadow *prev = &fotg210->pshadow[i];
drivers/usb/fotg210/fotg210-hcd.c
3490
__hc32 *hw_p = &fotg210->periodic[i];
drivers/usb/fotg210/fotg210-hcd.c
3496
type = Q_NEXT_TYPE(fotg210, *hw_p);
drivers/usb/fotg210/fotg210-hcd.c
3497
if (type == cpu_to_hc32(fotg210, Q_TYPE_QH))
drivers/usb/fotg210/fotg210-hcd.c
3499
prev = periodic_next_shadow(fotg210, prev, type);
drivers/usb/fotg210/fotg210-hcd.c
3500
hw_p = shadow_next_periodic(fotg210, &here, type);
drivers/usb/fotg210/fotg210-hcd.c
3521
*hw_p = QH_NEXT(fotg210, qh->qh_dma);
drivers/usb/fotg210/fotg210-hcd.c
3528
fotg210_to_hcd(fotg210)->self.bandwidth_allocated += qh->period
drivers/usb/fotg210/fotg210-hcd.c
353
static void qh_lines(struct fotg210_hcd *fotg210, struct fotg210_qh *qh,
drivers/usb/fotg210/fotg210-hcd.c
3532
list_add(&qh->intr_node, &fotg210->intr_qh_list);
drivers/usb/fotg210/fotg210-hcd.c
3535
++fotg210->intr_count;
drivers/usb/fotg210/fotg210-hcd.c
3536
enable_periodic(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3539
static void qh_unlink_periodic(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3565
for (i = qh->start; i < fotg210->periodic_size; i += period)
drivers/usb/fotg210/fotg210-hcd.c
3566
periodic_unlink(fotg210, i, qh);
drivers/usb/fotg210/fotg210-hcd.c
3569
fotg210_to_hcd(fotg210)->self.bandwidth_allocated -= qh->period
drivers/usb/fotg210/fotg210-hcd.c
3575
qh->period, hc32_to_cpup(fotg210, &qh->hw->hw_info2) &
drivers/usb/fotg210/fotg210-hcd.c
3583
if (fotg210->qh_scan_next == qh)
drivers/usb/fotg210/fotg210-hcd.c
3584
fotg210->qh_scan_next = list_entry(qh->intr_node.next,
drivers/usb/fotg210/fotg210-hcd.c
3589
static void start_unlink_intr(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3602
qh_unlink_periodic(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3612
qh->unlink_cycle = fotg210->intr_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
3615
if (fotg210->intr_unlink)
drivers/usb/fotg210/fotg210-hcd.c
3616
fotg210->intr_unlink_last->unlink_next = qh;
drivers/usb/fotg210/fotg210-hcd.c
3618
fotg210->intr_unlink = qh;
drivers/usb/fotg210/fotg210-hcd.c
3619
fotg210->intr_unlink_last = qh;
drivers/usb/fotg210/fotg210-hcd.c
3621
if (fotg210->intr_unlinking)
drivers/usb/fotg210/fotg210-hcd.c
3623
else if (fotg210->rh_state < FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
3624
fotg210_handle_intr_unlinks(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3625
else if (fotg210->intr_unlink == qh) {
drivers/usb/fotg210/fotg210-hcd.c
3626
fotg210_enable_event(fotg210, FOTG210_HRTIMER_UNLINK_INTR,
drivers/usb/fotg210/fotg210-hcd.c
3628
++fotg210->intr_unlink_cycle;
drivers/usb/fotg210/fotg210-hcd.c
363
__le32 list_end = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3632
static void end_unlink_intr(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
3638
hw->hw_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3640
qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3644
fotg210->rh_state == FOTG210_RH_RUNNING) {
drivers/usb/fotg210/fotg210-hcd.c
3645
rc = qh_schedule(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3654
fotg210_err(fotg210, "can't reschedule qh %p, err %d\n",
drivers/usb/fotg210/fotg210-hcd.c
3659
--fotg210->intr_count;
drivers/usb/fotg210/fotg210-hcd.c
3660
disable_periodic(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3663
static int check_period(struct fotg210_hcd *fotg210, unsigned frame,
drivers/usb/fotg210/fotg210-hcd.c
3675
usecs = fotg210->uframe_periodic_max - usecs;
drivers/usb/fotg210/fotg210-hcd.c
3683
claimed = periodic_usecs(fotg210, frame,
drivers/usb/fotg210/fotg210-hcd.c
3688
} while ((frame += 1) < fotg210->periodic_size);
drivers/usb/fotg210/fotg210-hcd.c
369
mark = token_mark(fotg210, hw->hw_token);
drivers/usb/fotg210/fotg210-hcd.c
3693
claimed = periodic_usecs(fotg210, frame, uframe);
drivers/usb/fotg210/fotg210-hcd.c
3696
} while ((frame += period) < fotg210->periodic_size);
drivers/usb/fotg210/fotg210-hcd.c
3703
static int check_intr_schedule(struct fotg210_hcd *fotg210, unsigned frame,
drivers/usb/fotg210/fotg210-hcd.c
371
if ((hw->hw_alt_next & QTD_MASK(fotg210)) ==
drivers/usb/fotg210/fotg210-hcd.c
3712
if (!check_period(fotg210, frame, uframe, qh->period, qh->usecs))
drivers/usb/fotg210/fotg210-hcd.c
372
fotg210->async->hw->hw_alt_next)
drivers/usb/fotg210/fotg210-hcd.c
3728
*c_maskp = cpu_to_hc32(fotg210, mask << 8);
drivers/usb/fotg210/fotg210-hcd.c
3731
if (tt_no_collision(fotg210, qh->period, qh->dev, frame, mask)) {
drivers/usb/fotg210/fotg210-hcd.c
3732
if (!check_period(fotg210, frame, uframe + qh->gap_uf + 1,
drivers/usb/fotg210/fotg210-hcd.c
3735
if (!check_period(fotg210, frame, uframe + qh->gap_uf,
drivers/usb/fotg210/fotg210-hcd.c
3747
static int qh_schedule(struct fotg210_hcd *fotg210, struct fotg210_qh *qh)
drivers/usb/fotg210/fotg210-hcd.c
3755
qh_refresh(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3756
hw->hw_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
3761
uframe = ffs(hc32_to_cpup(fotg210, &hw->hw_info2) & QH_SMASK);
drivers/usb/fotg210/fotg210-hcd.c
3762
status = check_intr_schedule(fotg210, frame, --uframe,
drivers/usb/fotg210/fotg210-hcd.c
3779
frame = ++fotg210->random_frame % qh->period;
drivers/usb/fotg210/fotg210-hcd.c
378
scratch = hc32_to_cpup(fotg210, &hw->hw_info1);
drivers/usb/fotg210/fotg210-hcd.c
3781
status = check_intr_schedule(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
379
hw_curr = (mark == '*') ? hc32_to_cpup(fotg210, &hw->hw_current) : 0;
drivers/usb/fotg210/fotg210-hcd.c
3792
status = check_intr_schedule(fotg210, 0, 0, qh,
drivers/usb/fotg210/fotg210-hcd.c
3800
hw->hw_info2 &= cpu_to_hc32(fotg210, ~(QH_CMASK | QH_SMASK));
drivers/usb/fotg210/fotg210-hcd.c
3802
? cpu_to_hc32(fotg210, 1 << uframe)
drivers/usb/fotg210/fotg210-hcd.c
3803
: cpu_to_hc32(fotg210, QH_SMASK);
drivers/usb/fotg210/fotg210-hcd.c
3806
fotg210_dbg(fotg210, "reused qh %p schedule\n", qh);
drivers/usb/fotg210/fotg210-hcd.c
3809
qh_link_periodic(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3814
static int intr_submit(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
3826
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
3828
if (unlikely(!HCD_HW_ACCESSIBLE(fotg210_to_hcd(fotg210)))) {
drivers/usb/fotg210/fotg210-hcd.c
3832
status = usb_hcd_link_urb_to_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
3838
qh = qh_append_tds(fotg210, urb, &empty, epnum, &urb->ep->hcpriv);
drivers/usb/fotg210/fotg210-hcd.c
3844
status = qh_schedule(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
385
scratch, hc32_to_cpup(fotg210, &hw->hw_info2),
drivers/usb/fotg210/fotg210-hcd.c
3850
qh = qh_append_tds(fotg210, urb, qtd_list, epnum, &urb->ep->hcpriv);
drivers/usb/fotg210/fotg210-hcd.c
3854
fotg210_to_hcd(fotg210)->self.bandwidth_int_reqs++;
drivers/usb/fotg210/fotg210-hcd.c
3858
usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
386
hc32_to_cpup(fotg210, &hw->hw_token), mark,
drivers/usb/fotg210/fotg210-hcd.c
3860
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
3862
qtd_list_free(fotg210, urb, qtd_list);
drivers/usb/fotg210/fotg210-hcd.c
3867
static void scan_intr(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
387
(cpu_to_hc32(fotg210, QTD_TOGGLE) & hw->hw_token)
drivers/usb/fotg210/fotg210-hcd.c
3871
list_for_each_entry_safe(qh, fotg210->qh_scan_next,
drivers/usb/fotg210/fotg210-hcd.c
3872
&fotg210->intr_qh_list, intr_node) {
drivers/usb/fotg210/fotg210-hcd.c
3885
temp = qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
3889
start_unlink_intr(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
389
(hc32_to_cpup(fotg210, &hw->hw_alt_next) >> 1) & 0x0f);
drivers/usb/fotg210/fotg210-hcd.c
3911
static void iso_stream_init(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3939
stream->buf0 = cpu_to_hc32(fotg210, (epnum << 8) | dev->devnum);
drivers/usb/fotg210/fotg210-hcd.c
3940
stream->buf1 = cpu_to_hc32(fotg210, buf1);
drivers/usb/fotg210/fotg210-hcd.c
3941
stream->buf2 = cpu_to_hc32(fotg210, multi);
drivers/usb/fotg210/fotg210-hcd.c
395
scratch = hc32_to_cpup(fotg210, &td->hw_token);
drivers/usb/fotg210/fotg210-hcd.c
3965
static struct fotg210_iso_stream *iso_stream_find(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
3979
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
3987
iso_stream_init(fotg210, stream, urb->dev, urb->pipe,
drivers/usb/fotg210/fotg210-hcd.c
399
else if (hw->hw_qtd_next == cpu_to_hc32(fotg210, td->qtd_dma))
drivers/usb/fotg210/fotg210-hcd.c
3993
fotg210_dbg(fotg210, "dev %s ep%d%s, not iso??\n",
drivers/usb/fotg210/fotg210-hcd.c
3999
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4017
static inline void itd_sched_init(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
402
if (td->hw_alt_next == fotg210->async->hw->hw_alt_next)
drivers/usb/fotg210/fotg210-hcd.c
4045
uframe->transaction = cpu_to_hc32(fotg210, trans);
drivers/usb/fotg210/fotg210-hcd.c
4066
struct fotg210_hcd *fotg210, struct urb *urb, gfp_t mem_flags)
drivers/usb/fotg210/fotg210-hcd.c
4079
itd_sched_init(fotg210, sched, stream, urb);
drivers/usb/fotg210/fotg210-hcd.c
4087
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4097
if (itd->frame == fotg210->now_frame)
drivers/usb/fotg210/fotg210-hcd.c
4103
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4104
itd = dma_pool_alloc(fotg210->itd_pool, mem_flags,
drivers/usb/fotg210/fotg210-hcd.c
4106
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4109
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4118
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4126
static inline int itd_slot_ok(struct fotg210_hcd *fotg210, u32 mod, u32 uframe,
drivers/usb/fotg210/fotg210-hcd.c
4132
if (periodic_usecs(fotg210, uframe >> 3, uframe & 0x7)
drivers/usb/fotg210/fotg210-hcd.c
4133
> (fotg210->uframe_periodic_max - usecs))
drivers/usb/fotg210/fotg210-hcd.c
4154
static int iso_stream_schedule(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
4159
unsigned mod = fotg210->periodic_size << 3;
drivers/usb/fotg210/fotg210-hcd.c
4166
fotg210_dbg(fotg210, "iso request %p too long\n", urb);
drivers/usb/fotg210/fotg210-hcd.c
4171
now = fotg210_read_frame_index(fotg210) & (mod - 1);
drivers/usb/fotg210/fotg210-hcd.c
4186
if (!stream->highspeed && fotg210->fs_i_thresh)
drivers/usb/fotg210/fotg210-hcd.c
4187
next = now + fotg210->i_thresh;
drivers/usb/fotg210/fotg210-hcd.c
4202
fotg210_dbg(fotg210, "request %p would overflow (%d+%d >= %d)\n",
drivers/usb/fotg210/fotg210-hcd.c
4233
if (itd_slot_ok(fotg210, mod, start,
drivers/usb/fotg210/fotg210-hcd.c
4240
fotg210_dbg(fotg210, "iso resched full %p (now %d max %d)\n",
drivers/usb/fotg210/fotg210-hcd.c
4250
fotg210_dbg(fotg210, "request %p would overflow (%d+%d >= %d)\n",
drivers/usb/fotg210/fotg210-hcd.c
4265
if (fotg210->isoc_count == 0)
drivers/usb/fotg210/fotg210-hcd.c
4266
fotg210->next_frame = now >> 3;
drivers/usb/fotg210/fotg210-hcd.c
4273
static inline void itd_init(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4279
itd->hw_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4290
static inline void itd_patch(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4301
itd->hw_transaction[uframe] |= cpu_to_hc32(fotg210, pg << 12);
drivers/usb/fotg210/fotg210-hcd.c
4302
itd->hw_bufp[pg] |= cpu_to_hc32(fotg210, uf->bufp & ~(u32)0);
drivers/usb/fotg210/fotg210-hcd.c
4303
itd->hw_bufp_hi[pg] |= cpu_to_hc32(fotg210, (u32)(uf->bufp >> 32));
drivers/usb/fotg210/fotg210-hcd.c
4310
itd->hw_bufp[pg] |= cpu_to_hc32(fotg210, bufp & ~(u32)0);
drivers/usb/fotg210/fotg210-hcd.c
4311
itd->hw_bufp_hi[pg] |= cpu_to_hc32(fotg210, (u32)(bufp >> 32));
drivers/usb/fotg210/fotg210-hcd.c
4315
static inline void itd_link(struct fotg210_hcd *fotg210, unsigned frame,
drivers/usb/fotg210/fotg210-hcd.c
4318
union fotg210_shadow *prev = &fotg210->pshadow[frame];
drivers/usb/fotg210/fotg210-hcd.c
4319
__hc32 *hw_p = &fotg210->periodic[frame];
drivers/usb/fotg210/fotg210-hcd.c
4325
type = Q_NEXT_TYPE(fotg210, *hw_p);
drivers/usb/fotg210/fotg210-hcd.c
4326
if (type == cpu_to_hc32(fotg210, Q_TYPE_QH))
drivers/usb/fotg210/fotg210-hcd.c
4328
prev = periodic_next_shadow(fotg210, prev, type);
drivers/usb/fotg210/fotg210-hcd.c
4329
hw_p = shadow_next_periodic(fotg210, &here, type);
drivers/usb/fotg210/fotg210-hcd.c
4338
*hw_p = cpu_to_hc32(fotg210, itd->itd_dma | Q_TYPE_ITD);
drivers/usb/fotg210/fotg210-hcd.c
4342
static void itd_link_urb(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
4353
fotg210_to_hcd(fotg210)->self.bandwidth_allocated
drivers/usb/fotg210/fotg210-hcd.c
4355
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4375
itd_init(fotg210, stream, itd);
drivers/usb/fotg210/fotg210-hcd.c
4381
itd_patch(fotg210, itd, iso_sched, packet, uframe);
drivers/usb/fotg210/fotg210-hcd.c
4390
itd_link(fotg210, frame & (fotg210->periodic_size - 1),
drivers/usb/fotg210/fotg210-hcd.c
4401
++fotg210->isoc_count;
drivers/usb/fotg210/fotg210-hcd.c
4402
enable_periodic(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4418
static bool itd_complete(struct fotg210_hcd *fotg210, struct fotg210_itd *itd)
drivers/usb/fotg210/fotg210-hcd.c
443
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
4436
t = hc32_to_cpup(fotg210, &itd->hw_transaction[uframe]);
drivers/usb/fotg210/fotg210-hcd.c
4477
fotg210_urb_done(fotg210, urb, 0);
drivers/usb/fotg210/fotg210-hcd.c
4481
--fotg210->isoc_count;
drivers/usb/fotg210/fotg210-hcd.c
4482
disable_periodic(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4485
fotg210_to_hcd(fotg210)->self.bandwidth_allocated
drivers/usb/fotg210/fotg210-hcd.c
4487
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
450
fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
4502
&fotg210->cached_itd_list);
drivers/usb/fotg210/fotg210-hcd.c
4503
start_free_itds(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4509
static int itd_submit(struct fotg210_hcd *fotg210, struct urb *urb,
drivers/usb/fotg210/fotg210-hcd.c
4517
stream = iso_stream_find(fotg210, urb);
drivers/usb/fotg210/fotg210-hcd.c
4519
fotg210_dbg(fotg210, "can't get iso stream\n");
drivers/usb/fotg210/fotg210-hcd.c
4523
fotg210_port_speed(fotg210, 0) ==
drivers/usb/fotg210/fotg210-hcd.c
4525
fotg210_dbg(fotg210, "can't change iso interval %d --> %d\n",
drivers/usb/fotg210/fotg210-hcd.c
4531
fotg210_dbg(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4542
status = itd_urb_transaction(stream, fotg210, urb, mem_flags);
drivers/usb/fotg210/fotg210-hcd.c
4544
fotg210_dbg(fotg210, "can't init itds\n");
drivers/usb/fotg210/fotg210-hcd.c
4549
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4550
if (unlikely(!HCD_HW_ACCESSIBLE(fotg210_to_hcd(fotg210)))) {
drivers/usb/fotg210/fotg210-hcd.c
4554
status = usb_hcd_link_urb_to_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
4557
status = iso_stream_schedule(fotg210, urb, stream);
drivers/usb/fotg210/fotg210-hcd.c
4559
itd_link_urb(fotg210, urb, fotg210->periodic_size << 3, stream);
drivers/usb/fotg210/fotg210-hcd.c
4561
usb_hcd_unlink_urb_from_ep(fotg210_to_hcd(fotg210), urb);
drivers/usb/fotg210/fotg210-hcd.c
4567
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4572
static inline int scan_frame_queue(struct fotg210_hcd *fotg210, unsigned frame,
drivers/usb/fotg210/fotg210-hcd.c
4581
q_p = &fotg210->pshadow[frame];
drivers/usb/fotg210/fotg210-hcd.c
4582
hw_p = &fotg210->periodic[frame];
drivers/usb/fotg210/fotg210-hcd.c
4584
type = Q_NEXT_TYPE(fotg210, *hw_p);
drivers/usb/fotg210/fotg210-hcd.c
4588
switch (hc32_to_cpu(fotg210, type)) {
drivers/usb/fotg210/fotg210-hcd.c
4599
ITD_ACTIVE(fotg210))
drivers/usb/fotg210/fotg210-hcd.c
460
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4605
type = Q_NEXT_TYPE(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
461
for (qh = fotg210->async->qh_next.qh; size > 0 && qh;
drivers/usb/fotg210/fotg210-hcd.c
4619
type = Q_NEXT_TYPE(fotg210, q.itd->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
4621
modified = itd_complete(fotg210, q.itd);
drivers/usb/fotg210/fotg210-hcd.c
4625
fotg210_dbg(fotg210, "corrupt type %d frame %d shadow %p\n",
drivers/usb/fotg210/fotg210-hcd.c
463
qh_lines(fotg210, qh, &next, &size);
drivers/usb/fotg210/fotg210-hcd.c
4636
if (unlikely(modified && fotg210->isoc_count > 0))
drivers/usb/fotg210/fotg210-hcd.c
464
if (fotg210->async_unlink && size > 0) {
drivers/usb/fotg210/fotg210-hcd.c
4642
static void scan_isoc(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
4645
unsigned fmask = fotg210->periodic_size - 1;
drivers/usb/fotg210/fotg210-hcd.c
4653
if (fotg210->rh_state >= FOTG210_RH_RUNNING) {
drivers/usb/fotg210/fotg210-hcd.c
4654
uf = fotg210_read_frame_index(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4658
now_frame = (fotg210->next_frame - 1) & fmask;
drivers/usb/fotg210/fotg210-hcd.c
4661
fotg210->now_frame = now_frame;
drivers/usb/fotg210/fotg210-hcd.c
4663
frame = fotg210->next_frame;
drivers/usb/fotg210/fotg210-hcd.c
4667
ret = scan_frame_queue(fotg210, frame,
drivers/usb/fotg210/fotg210-hcd.c
4675
fotg210->next_frame = now_frame;
drivers/usb/fotg210/fotg210-hcd.c
4683
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
4685
fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev)));
drivers/usb/fotg210/fotg210-hcd.c
4686
return sysfs_emit(buf, "%d\n", fotg210->uframe_periodic_max);
drivers/usb/fotg210/fotg210-hcd.c
469
for (qh = fotg210->async_unlink; size > 0 && qh;
drivers/usb/fotg210/fotg210-hcd.c
4692
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
4699
fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev)));
drivers/usb/fotg210/fotg210-hcd.c
4706
fotg210_info(fotg210, "rejecting invalid request for uframe_periodic_max=%u\n",
drivers/usb/fotg210/fotg210-hcd.c
471
qh_lines(fotg210, qh, &next, &size);
drivers/usb/fotg210/fotg210-hcd.c
4717
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4724
if (uframe_periodic_max < fotg210->uframe_periodic_max) {
drivers/usb/fotg210/fotg210-hcd.c
4727
for (frame = 0; frame < fotg210->periodic_size; ++frame)
drivers/usb/fotg210/fotg210-hcd.c
473
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4730
periodic_usecs(fotg210, frame,
drivers/usb/fotg210/fotg210-hcd.c
4734
fotg210_info(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4743
fotg210_info(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4748
fotg210_warn(fotg210, "max periodic bandwidth set is non-standard\n");
drivers/usb/fotg210/fotg210-hcd.c
4750
fotg210->uframe_periodic_max = uframe_periodic_max;
drivers/usb/fotg210/fotg210-hcd.c
4754
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
4760
static inline int create_sysfs_files(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
4762
struct device *controller = fotg210_to_hcd(fotg210)->self.controller;
drivers/usb/fotg210/fotg210-hcd.c
4767
static inline void remove_sysfs_files(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
4769
struct device *controller = fotg210_to_hcd(fotg210)->self.controller;
drivers/usb/fotg210/fotg210-hcd.c
4777
static void fotg210_turn_off_all_ports(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
4779
u32 __iomem *status_reg = &fotg210->regs->port_status;
drivers/usb/fotg210/fotg210-hcd.c
4781
fotg210_writel(fotg210, PORT_RWC_BITS, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
4787
static void fotg210_silence_controller(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
4789
fotg210_halt(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
479
static unsigned output_buf_tds_dir(char *buf, struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
4791
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4792
fotg210->rh_state = FOTG210_RH_HALTED;
drivers/usb/fotg210/fotg210-hcd.c
4793
fotg210_turn_off_all_ports(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4794
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4803
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
4805
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4806
fotg210->shutdown = true;
drivers/usb/fotg210/fotg210-hcd.c
4807
fotg210->rh_state = FOTG210_RH_STOPPING;
drivers/usb/fotg210/fotg210-hcd.c
4808
fotg210->enabled_hrtimer_events = 0;
drivers/usb/fotg210/fotg210-hcd.c
4809
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4811
fotg210_silence_controller(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4813
hrtimer_cancel(&fotg210->hrtimer);
drivers/usb/fotg210/fotg210-hcd.c
4819
static void fotg210_work(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
482
u32 scratch = hc32_to_cpup(fotg210, &hw->hw_info1);
drivers/usb/fotg210/fotg210-hcd.c
4825
if (fotg210->scanning) {
drivers/usb/fotg210/fotg210-hcd.c
4826
fotg210->need_rescan = true;
drivers/usb/fotg210/fotg210-hcd.c
4829
fotg210->scanning = true;
drivers/usb/fotg210/fotg210-hcd.c
4832
fotg210->need_rescan = false;
drivers/usb/fotg210/fotg210-hcd.c
4833
if (fotg210->async_count)
drivers/usb/fotg210/fotg210-hcd.c
4834
scan_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4835
if (fotg210->intr_count > 0)
drivers/usb/fotg210/fotg210-hcd.c
4836
scan_intr(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4837
if (fotg210->isoc_count > 0)
drivers/usb/fotg210/fotg210-hcd.c
4838
scan_isoc(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4839
if (fotg210->need_rescan)
drivers/usb/fotg210/fotg210-hcd.c
4841
fotg210->scanning = false;
drivers/usb/fotg210/fotg210-hcd.c
4847
turn_on_io_watchdog(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4854
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
4856
fotg210_dbg(fotg210, "stop\n");
drivers/usb/fotg210/fotg210-hcd.c
4860
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4861
fotg210->enabled_hrtimer_events = 0;
drivers/usb/fotg210/fotg210-hcd.c
4862
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4864
fotg210_quiesce(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4865
fotg210_silence_controller(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4866
fotg210_reset(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4868
hrtimer_cancel(&fotg210->hrtimer);
drivers/usb/fotg210/fotg210-hcd.c
4869
remove_sysfs_files(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4870
remove_debug_files(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4873
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4874
end_free_itds(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4875
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
4876
fotg210_mem_cleanup(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4879
fotg210_dbg(fotg210, "irq normal %ld err %ld iaa %ld (lost %ld)\n",
drivers/usb/fotg210/fotg210-hcd.c
4880
fotg210->stats.normal, fotg210->stats.error,
drivers/usb/fotg210/fotg210-hcd.c
4881
fotg210->stats.iaa, fotg210->stats.lost_iaa);
drivers/usb/fotg210/fotg210-hcd.c
4882
fotg210_dbg(fotg210, "complete %ld unlink %ld\n",
drivers/usb/fotg210/fotg210-hcd.c
4883
fotg210->stats.complete, fotg210->stats.unlink);
drivers/usb/fotg210/fotg210-hcd.c
4886
dbg_status(fotg210, "fotg210_stop completed",
drivers/usb/fotg210/fotg210-hcd.c
4887
fotg210_readl(fotg210, &fotg210->regs->status));
drivers/usb/fotg210/fotg210-hcd.c
4893
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
4899
spin_lock_init(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
490
switch ((hc32_to_cpu(fotg210, qtd->hw_token) >> 8) & 0x03) {
drivers/usb/fotg210/fotg210-hcd.c
4904
fotg210->need_io_watchdog = 1;
drivers/usb/fotg210/fotg210-hcd.c
4906
hrtimer_setup(&fotg210->hrtimer, fotg210_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
drivers/usb/fotg210/fotg210-hcd.c
4907
fotg210->next_hrtimer_event = FOTG210_HRTIMER_NO_EVENT;
drivers/usb/fotg210/fotg210-hcd.c
4909
hcc_params = fotg210_readl(fotg210, &fotg210->caps->hcc_params);
drivers/usb/fotg210/fotg210-hcd.c
4915
fotg210->uframe_periodic_max = 100;
drivers/usb/fotg210/fotg210-hcd.c
4921
fotg210->periodic_size = DEFAULT_I_TDPS;
drivers/usb/fotg210/fotg210-hcd.c
4922
INIT_LIST_HEAD(&fotg210->intr_qh_list);
drivers/usb/fotg210/fotg210-hcd.c
4923
INIT_LIST_HEAD(&fotg210->cached_itd_list);
drivers/usb/fotg210/fotg210-hcd.c
4929
fotg210->periodic_size = 1024;
drivers/usb/fotg210/fotg210-hcd.c
4932
fotg210->periodic_size = 512;
drivers/usb/fotg210/fotg210-hcd.c
4935
fotg210->periodic_size = 256;
drivers/usb/fotg210/fotg210-hcd.c
4941
retval = fotg210_mem_init(fotg210, GFP_KERNEL);
drivers/usb/fotg210/fotg210-hcd.c
4946
fotg210->i_thresh = 2;
drivers/usb/fotg210/fotg210-hcd.c
4955
fotg210->async->qh_next.qh = NULL;
drivers/usb/fotg210/fotg210-hcd.c
4956
hw = fotg210->async->hw;
drivers/usb/fotg210/fotg210-hcd.c
4957
hw->hw_next = QH_NEXT(fotg210, fotg210->async->qh_dma);
drivers/usb/fotg210/fotg210-hcd.c
4958
hw->hw_info1 = cpu_to_hc32(fotg210, QH_HEAD);
drivers/usb/fotg210/fotg210-hcd.c
4959
hw->hw_token = cpu_to_hc32(fotg210, QTD_STS_HALT);
drivers/usb/fotg210/fotg210-hcd.c
4960
hw->hw_qtd_next = FOTG210_LIST_END(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
4961
fotg210->async->qh_state = QH_STATE_LINKED;
drivers/usb/fotg210/fotg210-hcd.c
4962
hw->hw_alt_next = QTD_NEXT(fotg210, fotg210->async->dummy->qtd_dma);
drivers/usb/fotg210/fotg210-hcd.c
4981
fotg210_dbg(fotg210, "park %d\n", park);
drivers/usb/fotg210/fotg210-hcd.c
4988
fotg210->command = temp;
drivers/usb/fotg210/fotg210-hcd.c
4999
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5006
fotg210_writel(fotg210, fotg210->periodic_dma,
drivers/usb/fotg210/fotg210-hcd.c
5007
&fotg210->regs->frame_list);
drivers/usb/fotg210/fotg210-hcd.c
5008
fotg210_writel(fotg210, (u32)fotg210->async->qh_dma,
drivers/usb/fotg210/fotg210-hcd.c
5009
&fotg210->regs->async_next);
drivers/usb/fotg210/fotg210-hcd.c
5023
fotg210_readl(fotg210, &fotg210->caps->hcc_params);
drivers/usb/fotg210/fotg210-hcd.c
5029
fotg210->command &= ~(CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
drivers/usb/fotg210/fotg210-hcd.c
5030
fotg210->command |= CMD_RUN;
drivers/usb/fotg210/fotg210-hcd.c
5031
fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
5032
dbg_cmd(fotg210, "init", fotg210->command);
drivers/usb/fotg210/fotg210-hcd.c
5049
fotg210->rh_state = FOTG210_RH_RUNNING;
drivers/usb/fotg210/fotg210-hcd.c
5051
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
5054
fotg210->last_periodic_enable = ktime_get_real();
drivers/usb/fotg210/fotg210-hcd.c
5056
temp = HC_VERSION(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
5057
fotg210_readl(fotg210, &fotg210->caps->hc_capbase));
drivers/usb/fotg210/fotg210-hcd.c
5058
fotg210_info(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
5060
((fotg210->sbrn & 0xf0) >> 4), (fotg210->sbrn & 0x0f),
drivers/usb/fotg210/fotg210-hcd.c
5063
fotg210_writel(fotg210, INTR_MASK,
drivers/usb/fotg210/fotg210-hcd.c
5064
&fotg210->regs->intr_enable); /* Turn On Interrupts */
drivers/usb/fotg210/fotg210-hcd.c
5070
create_debug_files(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5071
create_sysfs_files(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5078
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5081
fotg210->regs = (void __iomem *)fotg210->caps +
drivers/usb/fotg210/fotg210-hcd.c
5082
HC_LENGTH(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
5083
fotg210_readl(fotg210, &fotg210->caps->hc_capbase));
drivers/usb/fotg210/fotg210-hcd.c
5084
dbg_hcs_params(fotg210, "reset");
drivers/usb/fotg210/fotg210-hcd.c
5085
dbg_hcc_params(fotg210, "reset");
drivers/usb/fotg210/fotg210-hcd.c
5088
fotg210->hcs_params = fotg210_readl(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
5089
&fotg210->caps->hcs_params);
drivers/usb/fotg210/fotg210-hcd.c
5091
fotg210->sbrn = HCD_USB2;
drivers/usb/fotg210/fotg210-hcd.c
5098
retval = fotg210_halt(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
510
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
5102
fotg210_reset(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5109
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5113
spin_lock(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
5115
status = fotg210_readl(fotg210, &fotg210->regs->status);
drivers/usb/fotg210/fotg210-hcd.c
5119
fotg210_dbg(fotg210, "device removed\n");
drivers/usb/fotg210/fotg210-hcd.c
5131
unlikely(fotg210->rh_state == FOTG210_RH_HALTED)) {
drivers/usb/fotg210/fotg210-hcd.c
5132
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
5137
fotg210_writel(fotg210, masked_status, &fotg210->regs->status);
drivers/usb/fotg210/fotg210-hcd.c
5138
cmd = fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
5142
dbg_status(fotg210, "irq", status);
drivers/usb/fotg210/fotg210-hcd.c
5149
INCR(fotg210->stats.normal);
drivers/usb/fotg210/fotg210-hcd.c
5151
INCR(fotg210->stats.error);
drivers/usb/fotg210/fotg210-hcd.c
5159
fotg210->enabled_hrtimer_events &=
drivers/usb/fotg210/fotg210-hcd.c
5169
if (fotg210->next_hrtimer_event == FOTG210_HRTIMER_IAA_WATCHDOG)
drivers/usb/fotg210/fotg210-hcd.c
5170
++fotg210->next_hrtimer_event;
drivers/usb/fotg210/fotg210-hcd.c
5174
fotg210_dbg(fotg210, "IAA with IAAD still set?\n");
drivers/usb/fotg210/fotg210-hcd.c
5175
if (fotg210->async_iaa) {
drivers/usb/fotg210/fotg210-hcd.c
5176
INCR(fotg210->stats.iaa);
drivers/usb/fotg210/fotg210-hcd.c
5177
end_unlink_async(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5179
fotg210_dbg(fotg210, "IAA with nothing unlinked?\n");
drivers/usb/fotg210/fotg210-hcd.c
5185
u32 __iomem *status_reg = &fotg210->regs->port_status;
drivers/usb/fotg210/fotg210-hcd.c
5191
if (fotg210->rh_state == FOTG210_RH_SUSPENDED)
drivers/usb/fotg210/fotg210-hcd.c
5194
pstatus = fotg210_readl(fotg210, status_reg);
drivers/usb/fotg210/fotg210-hcd.c
5196
if (test_bit(0, &fotg210->suspended_ports) &&
drivers/usb/fotg210/fotg210-hcd.c
5200
fotg210->reset_done[0] == 0) {
drivers/usb/fotg210/fotg210-hcd.c
5207
fotg210->reset_done[0] = jiffies + msecs_to_jiffies(25);
drivers/usb/fotg210/fotg210-hcd.c
5208
set_bit(0, &fotg210->resuming_ports);
drivers/usb/fotg210/fotg210-hcd.c
5209
fotg210_dbg(fotg210, "port 1 remote wakeup\n");
drivers/usb/fotg210/fotg210-hcd.c
5210
mod_timer(&hcd->rh_timer, fotg210->reset_done[0]);
drivers/usb/fotg210/fotg210-hcd.c
5216
fotg210_err(fotg210, "fatal error\n");
drivers/usb/fotg210/fotg210-hcd.c
5217
dbg_cmd(fotg210, "fatal", cmd);
drivers/usb/fotg210/fotg210-hcd.c
5218
dbg_status(fotg210, "fatal", status);
drivers/usb/fotg210/fotg210-hcd.c
5223
fotg210->shutdown = true;
drivers/usb/fotg210/fotg210-hcd.c
5224
fotg210->rh_state = FOTG210_RH_STOPPING;
drivers/usb/fotg210/fotg210-hcd.c
5225
fotg210->command &= ~(CMD_RUN | CMD_ASE | CMD_PSE);
drivers/usb/fotg210/fotg210-hcd.c
5226
fotg210_writel(fotg210, fotg210->command,
drivers/usb/fotg210/fotg210-hcd.c
5227
&fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
5228
fotg210_writel(fotg210, 0, &fotg210->regs->intr_enable);
drivers/usb/fotg210/fotg210-hcd.c
5229
fotg210_handle_controller_death(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5236
fotg210_work(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
5237
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
525
fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5257
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5272
if (!qh_urb_transaction(fotg210, urb, &qtd_list, mem_flags))
drivers/usb/fotg210/fotg210-hcd.c
5274
return submit_async(fotg210, urb, &qtd_list, mem_flags);
drivers/usb/fotg210/fotg210-hcd.c
5277
if (!qh_urb_transaction(fotg210, urb, &qtd_list, mem_flags))
drivers/usb/fotg210/fotg210-hcd.c
5279
return intr_submit(fotg210, urb, &qtd_list, mem_flags);
drivers/usb/fotg210/fotg210-hcd.c
5282
return itd_submit(fotg210, urb, mem_flags);
drivers/usb/fotg210/fotg210-hcd.c
529
temp = scnprintf(next, size, "size = %d\n", fotg210->periodic_size);
drivers/usb/fotg210/fotg210-hcd.c
5292
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5297
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5312
start_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5320
qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5332
start_unlink_intr(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5335
qh_completions(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5338
fotg210_dbg(fotg210, "bogus qh %p state %d\n",
drivers/usb/fotg210/fotg210-hcd.c
5352
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
536
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5361
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5369
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
537
for (i = 0; i < fotg210->periodic_size; i++) {
drivers/usb/fotg210/fotg210-hcd.c
538
p = fotg210->pshadow[i];
drivers/usb/fotg210/fotg210-hcd.c
5388
if (fotg210->rh_state < FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
5393
for (tmp = fotg210->async->qh_next.qh;
drivers/usb/fotg210/fotg210-hcd.c
5401
start_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5406
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5413
qh_destroy(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
542
tag = Q_NEXT_TYPE(fotg210, fotg210->periodic[i]);
drivers/usb/fotg210/fotg210-hcd.c
5421
fotg210_err(fotg210, "qh %p (#%02x) state %d%s\n",
drivers/usb/fotg210/fotg210-hcd.c
5428
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5434
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5444
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5464
start_unlink_async(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5466
start_unlink_intr(fotg210, qh);
drivers/usb/fotg210/fotg210-hcd.c
5469
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
5474
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5476
return (fotg210_read_frame_index(fotg210) >> 3) %
drivers/usb/fotg210/fotg210-hcd.c
5477
fotg210->periodic_size;
drivers/usb/fotg210/fotg210-hcd.c
551
switch (hc32_to_cpu(fotg210, tag)) {
drivers/usb/fotg210/fotg210-hcd.c
5532
static void fotg210_init(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
5537
&fotg210->regs->gmir);
drivers/usb/fotg210/fotg210-hcd.c
5539
value = ioread32(&fotg210->regs->otgcsr);
drivers/usb/fotg210/fotg210-hcd.c
5542
iowrite32(value, &fotg210->regs->otgcsr);
drivers/usb/fotg210/fotg210-hcd.c
5552
int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg)
drivers/usb/fotg210/fotg210-hcd.c
5558
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
556
hc32_to_cpup(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
5583
fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
5585
fotg210->fotg = fotg;
drivers/usb/fotg210/fotg210-hcd.c
5586
fotg210->caps = hcd->regs;
drivers/usb/fotg210/fotg210-hcd.c
5592
fotg210_init(fotg210);
drivers/usb/fotg210/fotg210-hcd.c
578
fotg210, hw,
drivers/usb/fotg210/fotg210-hcd.c
585
tag = Q_NEXT_TYPE(fotg210, hw->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
592
tag = Q_NEXT_TYPE(fotg210, p.fstn->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
598
tag = Q_NEXT_TYPE(fotg210, p.itd->hw_next);
drivers/usb/fotg210/fotg210-hcd.c
610
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
617
static const char *rh_state_string(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
619
switch (fotg210->rh_state) {
drivers/usb/fotg210/fotg210-hcd.c
635
struct fotg210_hcd *fotg210;
drivers/usb/fotg210/fotg210-hcd.c
643
fotg210 = hcd_to_fotg210(hcd);
drivers/usb/fotg210/fotg210-hcd.c
647
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
661
i = HC_VERSION(fotg210, fotg210_readl(fotg210,
drivers/usb/fotg210/fotg210-hcd.c
662
&fotg210->caps->hc_capbase));
drivers/usb/fotg210/fotg210-hcd.c
670
i >> 8, i & 0x0ff, rh_state_string(fotg210));
drivers/usb/fotg210/fotg210-hcd.c
675
i = fotg210_readl(fotg210, &fotg210->caps->hcs_params);
drivers/usb/fotg210/fotg210-hcd.c
680
i = fotg210_readl(fotg210, &fotg210->caps->hcc_params);
drivers/usb/fotg210/fotg210-hcd.c
687
fotg210_readl(fotg210, &fotg210->regs->status));
drivers/usb/fotg210/fotg210-hcd.c
693
fotg210_readl(fotg210, &fotg210->regs->command));
drivers/usb/fotg210/fotg210-hcd.c
699
fotg210_readl(fotg210, &fotg210->regs->intr_enable));
drivers/usb/fotg210/fotg210-hcd.c
705
fotg210_read_frame_index(fotg210));
drivers/usb/fotg210/fotg210-hcd.c
709
if (fotg210->async_unlink) {
drivers/usb/fotg210/fotg210-hcd.c
711
fotg210->async_unlink);
drivers/usb/fotg210/fotg210-hcd.c
719
fotg210->stats.normal, fotg210->stats.error,
drivers/usb/fotg210/fotg210-hcd.c
720
fotg210->stats.iaa, fotg210->stats.lost_iaa);
drivers/usb/fotg210/fotg210-hcd.c
725
fotg210->stats.complete, fotg210->stats.unlink);
drivers/usb/fotg210/fotg210-hcd.c
731
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-hcd.c
81
#define fotg210_dbg(fotg210, fmt, args...) \
drivers/usb/fotg210/fotg210-hcd.c
82
dev_dbg(fotg210_to_hcd(fotg210)->self.controller, fmt, ## args)
drivers/usb/fotg210/fotg210-hcd.c
83
#define fotg210_err(fotg210, fmt, args...) \
drivers/usb/fotg210/fotg210-hcd.c
839
static inline void create_debug_files(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
84
dev_err(fotg210_to_hcd(fotg210)->self.controller, fmt, ## args)
drivers/usb/fotg210/fotg210-hcd.c
841
struct usb_bus *bus = &fotg210_to_hcd(fotg210)->self;
drivers/usb/fotg210/fotg210-hcd.c
85
#define fotg210_info(fotg210, fmt, args...) \
drivers/usb/fotg210/fotg210-hcd.c
853
static inline void remove_debug_files(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
855
struct usb_bus *bus = &fotg210_to_hcd(fotg210)->self;
drivers/usb/fotg210/fotg210-hcd.c
86
dev_info(fotg210_to_hcd(fotg210)->self.controller, fmt, ## args)
drivers/usb/fotg210/fotg210-hcd.c
87
#define fotg210_warn(fotg210, fmt, args...) \
drivers/usb/fotg210/fotg210-hcd.c
876
static int handshake(struct fotg210_hcd *fotg210, void __iomem *ptr,
drivers/usb/fotg210/fotg210-hcd.c
88
dev_warn(fotg210_to_hcd(fotg210)->self.controller, fmt, ## args)
drivers/usb/fotg210/fotg210-hcd.c
894
static int fotg210_halt(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
898
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
901
fotg210_writel(fotg210, 0, &fotg210->regs->intr_enable);
drivers/usb/fotg210/fotg210-hcd.c
907
fotg210->command &= ~CMD_RUN;
drivers/usb/fotg210/fotg210-hcd.c
908
temp = fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
910
fotg210_writel(fotg210, temp, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
912
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
913
synchronize_irq(fotg210_to_hcd(fotg210)->irq);
drivers/usb/fotg210/fotg210-hcd.c
915
return handshake(fotg210, &fotg210->regs->status,
drivers/usb/fotg210/fotg210-hcd.c
922
static int fotg210_reset(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
925
u32 command = fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
93
static void dbg_hcs_params(struct fotg210_hcd *fotg210, char *label)
drivers/usb/fotg210/fotg210-hcd.c
930
if (fotg210->debug && !dbgp_reset_prep(fotg210_to_hcd(fotg210)))
drivers/usb/fotg210/fotg210-hcd.c
931
fotg210->debug = NULL;
drivers/usb/fotg210/fotg210-hcd.c
934
dbg_cmd(fotg210, "reset", command);
drivers/usb/fotg210/fotg210-hcd.c
935
fotg210_writel(fotg210, command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
936
fotg210->rh_state = FOTG210_RH_HALTED;
drivers/usb/fotg210/fotg210-hcd.c
937
fotg210->next_statechange = jiffies;
drivers/usb/fotg210/fotg210-hcd.c
938
retval = handshake(fotg210, &fotg210->regs->command,
drivers/usb/fotg210/fotg210-hcd.c
944
if (fotg210->debug)
drivers/usb/fotg210/fotg210-hcd.c
945
dbgp_external_startup(fotg210_to_hcd(fotg210));
drivers/usb/fotg210/fotg210-hcd.c
947
fotg210->port_c_suspend = fotg210->suspended_ports =
drivers/usb/fotg210/fotg210-hcd.c
948
fotg210->resuming_ports = 0;
drivers/usb/fotg210/fotg210-hcd.c
95
u32 params = fotg210_readl(fotg210, &fotg210->caps->hcs_params);
drivers/usb/fotg210/fotg210-hcd.c
955
static void fotg210_quiesce(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.c
959
if (fotg210->rh_state != FOTG210_RH_RUNNING)
drivers/usb/fotg210/fotg210-hcd.c
963
temp = (fotg210->command << 10) & (STS_ASS | STS_PSS);
drivers/usb/fotg210/fotg210-hcd.c
964
handshake(fotg210, &fotg210->regs->status, STS_ASS | STS_PSS, temp,
drivers/usb/fotg210/fotg210-hcd.c
968
spin_lock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
969
fotg210->command &= ~(CMD_ASE | CMD_PSE);
drivers/usb/fotg210/fotg210-hcd.c
97
fotg210_dbg(fotg210, "%s hcs_params 0x%x ports=%d\n", label, params,
drivers/usb/fotg210/fotg210-hcd.c
970
fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
971
spin_unlock_irq(&fotg210->lock);
drivers/usb/fotg210/fotg210-hcd.c
974
handshake(fotg210, &fotg210->regs->status, STS_ASS | STS_PSS, 0,
drivers/usb/fotg210/fotg210-hcd.c
978
static void end_unlink_async(struct fotg210_hcd *fotg210);
drivers/usb/fotg210/fotg210-hcd.c
979
static void unlink_empty_async(struct fotg210_hcd *fotg210);
drivers/usb/fotg210/fotg210-hcd.c
980
static void fotg210_work(struct fotg210_hcd *fotg210);
drivers/usb/fotg210/fotg210-hcd.c
981
static void start_unlink_intr(struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.c
983
static void end_unlink_intr(struct fotg210_hcd *fotg210, struct fotg210_qh *qh);
drivers/usb/fotg210/fotg210-hcd.c
986
static void fotg210_set_command_bit(struct fotg210_hcd *fotg210, u32 bit)
drivers/usb/fotg210/fotg210-hcd.c
988
fotg210->command |= bit;
drivers/usb/fotg210/fotg210-hcd.c
989
fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
992
fotg210_readl(fotg210, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.c
996
static void fotg210_clear_command_bit(struct fotg210_hcd *fotg210, u32 bit)
drivers/usb/fotg210/fotg210-hcd.c
998
fotg210->command &= ~bit;
drivers/usb/fotg210/fotg210-hcd.c
999
fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
drivers/usb/fotg210/fotg210-hcd.h
185
struct fotg210 *fotg; /* Overarching FOTG210 device */
drivers/usb/fotg210/fotg210-hcd.h
195
static inline struct usb_hcd *fotg210_to_hcd(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.h
197
return container_of((void *) fotg210, struct usb_hcd, hcd_priv);
drivers/usb/fotg210/fotg210-hcd.h
213
#define HC_LENGTH(fotg210, p) (0x00ff&((p) >> /* bits 7:0 / offset 00h */ \
drivers/usb/fotg210/fotg210-hcd.h
214
(fotg210_big_endian_capbase(fotg210) ? 24 : 0)))
drivers/usb/fotg210/fotg210-hcd.h
215
#define HC_VERSION(fotg210, p) (0xffff&((p) >> /* bits 31:16 / offset 02h */ \
drivers/usb/fotg210/fotg210-hcd.h
216
(fotg210_big_endian_capbase(fotg210) ? 0 : 16)))
drivers/usb/fotg210/fotg210-hcd.h
308
#define QTD_NEXT(fotg210, dma) cpu_to_hc32(fotg210, (u32)dma)
drivers/usb/fotg210/fotg210-hcd.h
337
#define ACTIVE_BIT(fotg210) cpu_to_hc32(fotg210, QTD_STS_ACTIVE)
drivers/usb/fotg210/fotg210-hcd.h
338
#define HALT_BIT(fotg210) cpu_to_hc32(fotg210, QTD_STS_HALT)
drivers/usb/fotg210/fotg210-hcd.h
339
#define STATUS_BIT(fotg210) cpu_to_hc32(fotg210, QTD_STS_STS)
drivers/usb/fotg210/fotg210-hcd.h
352
#define QTD_MASK(fotg210) cpu_to_hc32(fotg210, ~0x1f)
drivers/usb/fotg210/fotg210-hcd.h
359
#define Q_NEXT_TYPE(fotg210, dma) ((dma) & cpu_to_hc32(fotg210, 3 << 1))
drivers/usb/fotg210/fotg210-hcd.h
375
#define QH_NEXT(fotg210, dma) \
drivers/usb/fotg210/fotg210-hcd.h
376
(cpu_to_hc32(fotg210, (((u32)dma)&~0x01f)|Q_TYPE_QH))
drivers/usb/fotg210/fotg210-hcd.h
379
#define FOTG210_LIST_END(fotg210) \
drivers/usb/fotg210/fotg210-hcd.h
380
cpu_to_hc32(fotg210, 1) /* "null pointer" to hw */
drivers/usb/fotg210/fotg210-hcd.h
552
#define ITD_ACTIVE(fotg210) cpu_to_hc32(fotg210, FOTG210_ISOC_ACTIVE)
drivers/usb/fotg210/fotg210-hcd.h
595
#define fotg210_prepare_ports_for_controller_suspend(fotg210, do_wakeup) \
drivers/usb/fotg210/fotg210-hcd.h
596
fotg210_adjust_port_wakeup_flags(fotg210, true, do_wakeup)
drivers/usb/fotg210/fotg210-hcd.h
598
#define fotg210_prepare_ports_for_controller_resume(fotg210) \
drivers/usb/fotg210/fotg210-hcd.h
599
fotg210_adjust_port_wakeup_flags(fotg210, false, false)
drivers/usb/fotg210/fotg210-hcd.h
611
fotg210_get_speed(struct fotg210_hcd *fotg210, unsigned int portsc)
drivers/usb/fotg210/fotg210-hcd.h
613
return (readl(&fotg210->regs->otgcsr)
drivers/usb/fotg210/fotg210-hcd.h
619
fotg210_port_speed(struct fotg210_hcd *fotg210, unsigned int portsc)
drivers/usb/fotg210/fotg210-hcd.h
621
switch (fotg210_get_speed(fotg210, portsc)) {
drivers/usb/fotg210/fotg210-hcd.h
650
static inline unsigned int fotg210_readl(const struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.h
656
static inline void fotg210_writel(const struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.h
663
static inline __hc32 cpu_to_hc32(const struct fotg210_hcd *fotg210, const u32 x)
drivers/usb/fotg210/fotg210-hcd.h
669
static inline u32 hc32_to_cpu(const struct fotg210_hcd *fotg210, const __hc32 x)
drivers/usb/fotg210/fotg210-hcd.h
674
static inline u32 hc32_to_cpup(const struct fotg210_hcd *fotg210,
drivers/usb/fotg210/fotg210-hcd.h
682
static inline unsigned fotg210_read_frame_index(struct fotg210_hcd *fotg210)
drivers/usb/fotg210/fotg210-hcd.h
684
return fotg210_readl(fotg210, &fotg210->regs->frame_index);
drivers/usb/fotg210/fotg210-udc.c
1002
iowrite32(reg, fotg210->reg + FOTG210_PHYTMSR);
drivers/usb/fotg210/fotg210-udc.c
1008
struct fotg210_udc *fotg210 = gadget_to_fotg210(g);
drivers/usb/fotg210/fotg210-udc.c
1013
fotg210->driver = driver;
drivers/usb/fotg210/fotg210-udc.c
1014
fotg210->gadget.dev.of_node = fotg210->dev->of_node;
drivers/usb/fotg210/fotg210-udc.c
1015
fotg210->gadget.speed = USB_SPEED_UNKNOWN;
drivers/usb/fotg210/fotg210-udc.c
1017
dev_info(fotg210->dev, "bound driver %s\n", driver->driver.name);
drivers/usb/fotg210/fotg210-udc.c
1019
if (!IS_ERR_OR_NULL(fotg210->phy)) {
drivers/usb/fotg210/fotg210-udc.c
1020
ret = otg_set_peripheral(fotg210->phy->otg,
drivers/usb/fotg210/fotg210-udc.c
1021
&fotg210->gadget);
drivers/usb/fotg210/fotg210-udc.c
1023
dev_err(fotg210->dev, "can't bind to phy\n");
drivers/usb/fotg210/fotg210-udc.c
1027
value = ioread32(fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1029
iowrite32(value, fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1032
value = ioread32(fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1034
iowrite32(value, fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1039
static void fotg210_init(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
104
val = ioread32(fotg210->reg + FOTG210_EPMAP);
drivers/usb/fotg210/fotg210-udc.c
1045
fotg210->reg + FOTG210_GMIR);
drivers/usb/fotg210/fotg210-udc.c
1049
fotg210->reg + FOTG210_DMIGR);
drivers/usb/fotg210/fotg210-udc.c
1052
iowrite32(DMCR_SFRST, fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1057
value = ioread32(fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1059
iowrite32(value, fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
1065
fotg210->reg + FOTG210_DMISGR2);
drivers/usb/fotg210/fotg210-udc.c
1068
iowrite32(~(u32)0, fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
107
iowrite32(val, fotg210->reg + FOTG210_EPMAP);
drivers/usb/fotg210/fotg210-udc.c
1071
value = ioread32(fotg210->reg + FOTG210_DMISGR0);
drivers/usb/fotg210/fotg210-udc.c
1073
iowrite32(value, fotg210->reg + FOTG210_DMISGR0);
drivers/usb/fotg210/fotg210-udc.c
1078
struct fotg210_udc *fotg210 = gadget_to_fotg210(g);
drivers/usb/fotg210/fotg210-udc.c
1081
if (!IS_ERR_OR_NULL(fotg210->phy))
drivers/usb/fotg210/fotg210-udc.c
1082
return otg_set_peripheral(fotg210->phy->otg, NULL);
drivers/usb/fotg210/fotg210-udc.c
1084
spin_lock_irqsave(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
1086
fotg210_init(fotg210);
drivers/usb/fotg210/fotg210-udc.c
1087
fotg210->driver = NULL;
drivers/usb/fotg210/fotg210-udc.c
1088
fotg210->gadget.speed = USB_SPEED_UNKNOWN;
drivers/usb/fotg210/fotg210-udc.c
1090
spin_unlock_irqrestore(&fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
110
val = ioread32(fotg210->reg + FOTG210_FIFOMAP);
drivers/usb/fotg210/fotg210-udc.c
1104
struct fotg210_udc *fotg210 = gadget_to_fotg210(g);
drivers/usb/fotg210/fotg210-udc.c
1107
fotg210_vbus(fotg210->fotg, is_active);
drivers/usb/fotg210/fotg210-udc.c
113
iowrite32(val, fotg210->reg + FOTG210_FIFOMAP);
drivers/usb/fotg210/fotg210-udc.c
1153
struct fotg210_udc *fotg210 = platform_get_drvdata(pdev);
drivers/usb/fotg210/fotg210-udc.c
1156
usb_del_gadget_udc(&fotg210->gadget);
drivers/usb/fotg210/fotg210-udc.c
1157
if (!IS_ERR_OR_NULL(fotg210->phy)) {
drivers/usb/fotg210/fotg210-udc.c
1158
usb_unregister_notifier(fotg210->phy, &fotg210_phy_notifier);
drivers/usb/fotg210/fotg210-udc.c
1159
usb_put_phy(fotg210->phy);
drivers/usb/fotg210/fotg210-udc.c
116
val = ioread32(fotg210->reg + FOTG210_FIFOCF);
drivers/usb/fotg210/fotg210-udc.c
1161
iounmap(fotg210->reg);
drivers/usb/fotg210/fotg210-udc.c
1162
free_irq(platform_get_irq(pdev, 0), fotg210);
drivers/usb/fotg210/fotg210-udc.c
1164
fotg210_ep_free_request(&fotg210->ep[0]->ep, fotg210->ep0_req);
drivers/usb/fotg210/fotg210-udc.c
1166
kfree(fotg210->ep[i]);
drivers/usb/fotg210/fotg210-udc.c
1168
kfree(fotg210);
drivers/usb/fotg210/fotg210-udc.c
1173
int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg)
drivers/usb/fotg210/fotg210-udc.c
1175
struct fotg210_udc *fotg210 = NULL;
drivers/usb/fotg210/fotg210-udc.c
118
iowrite32(val, fotg210->reg + FOTG210_FIFOCF);
drivers/usb/fotg210/fotg210-udc.c
1186
fotg210 = kzalloc_obj(struct fotg210_udc);
drivers/usb/fotg210/fotg210-udc.c
1187
if (fotg210 == NULL)
drivers/usb/fotg210/fotg210-udc.c
1190
fotg210->dev = dev;
drivers/usb/fotg210/fotg210-udc.c
1191
fotg210->fotg = fotg;
drivers/usb/fotg210/fotg210-udc.c
1193
fotg210->phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0);
drivers/usb/fotg210/fotg210-udc.c
1194
if (IS_ERR(fotg210->phy)) {
drivers/usb/fotg210/fotg210-udc.c
1195
ret = PTR_ERR(fotg210->phy);
drivers/usb/fotg210/fotg210-udc.c
1199
fotg210->phy = NULL;
drivers/usb/fotg210/fotg210-udc.c
1201
ret = usb_phy_init(fotg210->phy);
drivers/usb/fotg210/fotg210-udc.c
1210
fotg210->ep[i] = kzalloc_obj(struct fotg210_ep);
drivers/usb/fotg210/fotg210-udc.c
1211
if (!fotg210->ep[i])
drivers/usb/fotg210/fotg210-udc.c
1215
fotg210->reg = fotg->base;
drivers/usb/fotg210/fotg210-udc.c
1217
spin_lock_init(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
1219
platform_set_drvdata(pdev, fotg210);
drivers/usb/fotg210/fotg210-udc.c
1221
fotg210->gadget.ops = &fotg210_gadget_ops;
drivers/usb/fotg210/fotg210-udc.c
1223
fotg210->gadget.max_speed = USB_SPEED_HIGH;
drivers/usb/fotg210/fotg210-udc.c
1224
fotg210->gadget.dev.parent = dev;
drivers/usb/fotg210/fotg210-udc.c
1225
fotg210->gadget.dev.dma_mask = dev->dma_mask;
drivers/usb/fotg210/fotg210-udc.c
1226
fotg210->gadget.name = udc_name;
drivers/usb/fotg210/fotg210-udc.c
1228
INIT_LIST_HEAD(&fotg210->gadget.ep_list);
drivers/usb/fotg210/fotg210-udc.c
123
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
1231
struct fotg210_ep *ep = fotg210->ep[i];
drivers/usb/fotg210/fotg210-udc.c
1234
INIT_LIST_HEAD(&fotg210->ep[i]->ep.ep_list);
drivers/usb/fotg210/fotg210-udc.c
1235
list_add_tail(&fotg210->ep[i]->ep.ep_list,
drivers/usb/fotg210/fotg210-udc.c
1236
&fotg210->gadget.ep_list);
drivers/usb/fotg210/fotg210-udc.c
1238
ep->fotg210 = fotg210;
drivers/usb/fotg210/fotg210-udc.c
1255
usb_ep_set_maxpacket_limit(&fotg210->ep[0]->ep, 0x40);
drivers/usb/fotg210/fotg210-udc.c
1256
fotg210->gadget.ep0 = &fotg210->ep[0]->ep;
drivers/usb/fotg210/fotg210-udc.c
1257
INIT_LIST_HEAD(&fotg210->gadget.ep0->ep_list);
drivers/usb/fotg210/fotg210-udc.c
1259
fotg210->ep0_req = fotg210_ep_alloc_request(&fotg210->ep[0]->ep,
drivers/usb/fotg210/fotg210-udc.c
126
val = ioread32(fotg210->reg + FOTG210_FIFOMAP);
drivers/usb/fotg210/fotg210-udc.c
1261
if (fotg210->ep0_req == NULL)
drivers/usb/fotg210/fotg210-udc.c
1264
fotg210->ep0_req->complete = fotg210_ep0_complete;
drivers/usb/fotg210/fotg210-udc.c
1266
fotg210_init(fotg210);
drivers/usb/fotg210/fotg210-udc.c
1268
fotg210_disable_unplug(fotg210);
drivers/usb/fotg210/fotg210-udc.c
1271
udc_name, fotg210);
drivers/usb/fotg210/fotg210-udc.c
1277
if (!IS_ERR_OR_NULL(fotg210->phy))
drivers/usb/fotg210/fotg210-udc.c
1278
usb_register_notifier(fotg210->phy, &fotg210_phy_notifier);
drivers/usb/fotg210/fotg210-udc.c
128
iowrite32(val, fotg210->reg + FOTG210_FIFOMAP);
drivers/usb/fotg210/fotg210-udc.c
1280
ret = usb_add_gadget_udc(dev, &fotg210->gadget);
drivers/usb/fotg210/fotg210-udc.c
1289
if (!IS_ERR_OR_NULL(fotg210->phy))
drivers/usb/fotg210/fotg210-udc.c
1290
usb_unregister_notifier(fotg210->phy, &fotg210_phy_notifier);
drivers/usb/fotg210/fotg210-udc.c
1291
free_irq(irq, fotg210);
drivers/usb/fotg210/fotg210-udc.c
1294
fotg210_ep_free_request(&fotg210->ep[0]->ep, fotg210->ep0_req);
drivers/usb/fotg210/fotg210-udc.c
1297
iounmap(fotg210->reg);
drivers/usb/fotg210/fotg210-udc.c
1301
kfree(fotg210->ep[i]);
drivers/usb/fotg210/fotg210-udc.c
1304
kfree(fotg210);
drivers/usb/fotg210/fotg210-udc.c
133
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
136
val = ioread32(fotg210->reg + FOTG210_FIFOCF);
drivers/usb/fotg210/fotg210-udc.c
138
iowrite32(val, fotg210->reg + FOTG210_FIFOCF);
drivers/usb/fotg210/fotg210-udc.c
144
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
149
val = ioread32(fotg210->reg + offset);
drivers/usb/fotg210/fotg210-udc.c
151
iowrite32(val, fotg210->reg + offset);
drivers/usb/fotg210/fotg210-udc.c
157
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
164
fotg210->ep[ep->epnum] = ep;
drivers/usb/fotg210/fotg210-udc.c
185
static void fotg210_reset_tseq(struct fotg210_udc *fotg210, u8 epnum)
drivers/usb/fotg210/fotg210-udc.c
187
struct fotg210_ep *ep = fotg210->ep[epnum];
drivers/usb/fotg210/fotg210-udc.c
192
fotg210->reg + FOTG210_INEPMPSR(epnum) :
drivers/usb/fotg210/fotg210-udc.c
193
fotg210->reg + FOTG210_OUTEPMPSR(epnum);
drivers/usb/fotg210/fotg210-udc.c
216
fotg210_reset_tseq(ep->fotg210, ep->epnum);
drivers/usb/fotg210/fotg210-udc.c
234
spin_lock_irqsave(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
236
spin_unlock_irqrestore(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
269
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
272
value = ioread32(fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
275
iowrite32(value, fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
278
value = ioread32(fotg210->reg + FOTG210_DMATFNR);
drivers/usb/fotg210/fotg210-udc.c
283
iowrite32(value, fotg210->reg + FOTG210_DMATFNR);
drivers/usb/fotg210/fotg210-udc.c
286
iowrite32(d, fotg210->reg + FOTG210_DMACPSR2);
drivers/usb/fotg210/fotg210-udc.c
289
value = ioread32(fotg210->reg + FOTG210_DMISGR2);
drivers/usb/fotg210/fotg210-udc.c
291
iowrite32(value, fotg210->reg + FOTG210_DMISGR2);
drivers/usb/fotg210/fotg210-udc.c
294
value = ioread32(fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
296
iowrite32(value, fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
301
iowrite32(DMATFNR_DISDMA, ep->fotg210->reg + FOTG210_DMATFNR);
drivers/usb/fotg210/fotg210-udc.c
309
value = ioread32(ep->fotg210->reg + FOTG210_DISGR2);
drivers/usb/fotg210/fotg210-udc.c
315
fotg210_ack_int(ep->fotg210, FOTG210_DISGR2, DISGR2_DMA_CMPLT);
drivers/usb/fotg210/fotg210-udc.c
319
value = ioread32(ep->fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
32
static void fotg210_ack_int(struct fotg210_udc *fotg210, u32 offset, u32 mask)
drivers/usb/fotg210/fotg210-udc.c
321
iowrite32(value, ep->fotg210->reg + FOTG210_DMACPSR1);
drivers/usb/fotg210/fotg210-udc.c
325
value = ioread32(ep->fotg210->reg +
drivers/usb/fotg210/fotg210-udc.c
328
iowrite32(value, ep->fotg210->reg +
drivers/usb/fotg210/fotg210-udc.c
331
value = ioread32(ep->fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
333
iowrite32(value, ep->fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
34
u32 value = ioread32(fotg210->reg + offset);
drivers/usb/fotg210/fotg210-udc.c
340
struct device *dev = &ep->fotg210->gadget.dev;
drivers/usb/fotg210/fotg210-udc.c
351
length = ioread32(ep->fotg210->reg +
drivers/usb/fotg210/fotg210-udc.c
37
iowrite32(value, fotg210->reg + offset);
drivers/usb/fotg210/fotg210-udc.c
397
u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0);
drivers/usb/fotg210/fotg210-udc.c
400
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0);
drivers/usb/fotg210/fotg210-udc.c
415
if (ep->fotg210->gadget.speed == USB_SPEED_UNKNOWN)
drivers/usb/fotg210/fotg210-udc.c
418
spin_lock_irqsave(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
42
u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
433
spin_unlock_irqrestore(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
447
spin_lock_irqsave(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
450
spin_unlock_irqrestore(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
457
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
464
value = ioread32(fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
469
fotg210->reg + FOTG210_INEPMPSR(ep->epnum) :
drivers/usb/fotg210/fotg210-udc.c
470
fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum);
drivers/usb/fotg210/fotg210-udc.c
478
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
48
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
483
fotg210->reg + FOTG210_INEPMPSR(ep->epnum) :
drivers/usb/fotg210/fotg210-udc.c
484
fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum);
drivers/usb/fotg210/fotg210-udc.c
493
struct fotg210_udc *fotg210;
drivers/usb/fotg210/fotg210-udc.c
498
fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
500
spin_lock_irqsave(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
508
fotg210_reset_tseq(fotg210, ep->epnum);
drivers/usb/fotg210/fotg210-udc.c
516
spin_unlock_irqrestore(&ep->fotg210->lock, flags);
drivers/usb/fotg210/fotg210-udc.c
53
u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
549
static void fotg210_clear_tx0byte(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
551
u32 value = ioread32(fotg210->reg + FOTG210_TX0BYTE);
drivers/usb/fotg210/fotg210-udc.c
555
iowrite32(value, fotg210->reg + FOTG210_TX0BYTE);
drivers/usb/fotg210/fotg210-udc.c
558
static void fotg210_clear_rx0byte(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
560
u32 value = ioread32(fotg210->reg + FOTG210_RX0BYTE);
drivers/usb/fotg210/fotg210-udc.c
564
iowrite32(value, fotg210->reg + FOTG210_RX0BYTE);
drivers/usb/fotg210/fotg210-udc.c
568
static void fotg210_rdsetupp(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
576
iowrite32(DMATFNR_ACC_CXF, fotg210->reg + FOTG210_DMATFNR);
drivers/usb/fotg210/fotg210-udc.c
579
data = ioread32(fotg210->reg + FOTG210_CXPORT);
drivers/usb/fotg210/fotg210-udc.c
589
data = ioread32(fotg210->reg + FOTG210_CXPORT);
drivers/usb/fotg210/fotg210-udc.c
59
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
593
data = ioread32(fotg210->reg + FOTG210_CXPORT);
drivers/usb/fotg210/fotg210-udc.c
598
data = ioread32(fotg210->reg + FOTG210_CXPORT);
drivers/usb/fotg210/fotg210-udc.c
607
iowrite32(DMATFNR_DISDMA, fotg210->reg + FOTG210_DMATFNR);
drivers/usb/fotg210/fotg210-udc.c
610
static void fotg210_set_configuration(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
612
u32 value = ioread32(fotg210->reg + FOTG210_DAR);
drivers/usb/fotg210/fotg210-udc.c
615
iowrite32(value, fotg210->reg + FOTG210_DAR);
drivers/usb/fotg210/fotg210-udc.c
618
static void fotg210_set_dev_addr(struct fotg210_udc *fotg210, u32 addr)
drivers/usb/fotg210/fotg210-udc.c
62
static void fotg210_set_cxdone(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
620
u32 value = ioread32(fotg210->reg + FOTG210_DAR);
drivers/usb/fotg210/fotg210-udc.c
623
iowrite32(value, fotg210->reg + FOTG210_DAR);
drivers/usb/fotg210/fotg210-udc.c
626
static void fotg210_set_cxstall(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
628
u32 value = ioread32(fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
631
iowrite32(value, fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
634
static void fotg210_request_error(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
636
fotg210_set_cxstall(fotg210);
drivers/usb/fotg210/fotg210-udc.c
64
u32 value = ioread32(fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
640
static void fotg210_set_address(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
644
fotg210_request_error(fotg210);
drivers/usb/fotg210/fotg210-udc.c
646
fotg210_set_dev_addr(fotg210, le16_to_cpu(ctrl->wValue));
drivers/usb/fotg210/fotg210-udc.c
647
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
651
static void fotg210_set_feature(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
656
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
659
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
665
fotg210_set_epnstall(fotg210->ep[epnum]);
drivers/usb/fotg210/fotg210-udc.c
667
fotg210_set_cxstall(fotg210);
drivers/usb/fotg210/fotg210-udc.c
668
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
67
iowrite32(value, fotg210->reg + FOTG210_DCFESR);
drivers/usb/fotg210/fotg210-udc.c
672
fotg210_request_error(fotg210);
drivers/usb/fotg210/fotg210-udc.c
677
static void fotg210_clear_feature(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
681
fotg210->ep[ctrl->wIndex & USB_ENDPOINT_NUMBER_MASK];
drivers/usb/fotg210/fotg210-udc.c
685
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
688
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
693
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
699
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
702
fotg210_request_error(fotg210);
drivers/usb/fotg210/fotg210-udc.c
709
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
714
fotg210->reg + FOTG210_INEPMPSR(ep->epnum) :
drivers/usb/fotg210/fotg210-udc.c
715
fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum);
drivers/usb/fotg210/fotg210-udc.c
724
struct fotg210_udc *fotg210;
drivers/usb/fotg210/fotg210-udc.c
727
fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
730
dev_warn(&fotg210->gadget.dev, "EP0 request failed: %d\n", req->status);
drivers/usb/fotg210/fotg210-udc.c
734
static void fotg210_get_status(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
741
fotg210->ep0_data = cpu_to_le16(1 << USB_DEVICE_SELF_POWERED);
drivers/usb/fotg210/fotg210-udc.c
744
fotg210->ep0_data = cpu_to_le16(0);
drivers/usb/fotg210/fotg210-udc.c
749
fotg210->ep0_data =
drivers/usb/fotg210/fotg210-udc.c
750
cpu_to_le16(fotg210_is_epnstall(fotg210->ep[epnum])
drivers/usb/fotg210/fotg210-udc.c
753
fotg210_request_error(fotg210);
drivers/usb/fotg210/fotg210-udc.c
757
fotg210_request_error(fotg210);
drivers/usb/fotg210/fotg210-udc.c
76
if (ep->fotg210->gadget.speed == USB_SPEED_UNKNOWN)
drivers/usb/fotg210/fotg210-udc.c
761
fotg210->ep0_req->buf = &fotg210->ep0_data;
drivers/usb/fotg210/fotg210-udc.c
762
fotg210->ep0_req->length = 2;
drivers/usb/fotg210/fotg210-udc.c
764
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
765
fotg210_ep_queue(fotg210->gadget.ep0, fotg210->ep0_req, GFP_ATOMIC);
drivers/usb/fotg210/fotg210-udc.c
766
spin_lock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
769
static int fotg210_setup_packet(struct fotg210_udc *fotg210,
drivers/usb/fotg210/fotg210-udc.c
775
fotg210_rdsetupp(fotg210, p);
drivers/usb/fotg210/fotg210-udc.c
777
fotg210->ep[0]->dir_in = ctrl->bRequestType & USB_DIR_IN;
drivers/usb/fotg210/fotg210-udc.c
779
if (fotg210->gadget.speed == USB_SPEED_UNKNOWN) {
drivers/usb/fotg210/fotg210-udc.c
780
u32 value = ioread32(fotg210->reg + FOTG210_DMCR);
drivers/usb/fotg210/fotg210-udc.c
781
fotg210->gadget.speed = value & DMCR_HS_EN ?
drivers/usb/fotg210/fotg210-udc.c
789
fotg210_get_status(fotg210, ctrl);
drivers/usb/fotg210/fotg210-udc.c
792
fotg210_clear_feature(fotg210, ctrl);
drivers/usb/fotg210/fotg210-udc.c
795
fotg210_set_feature(fotg210, ctrl);
drivers/usb/fotg210/fotg210-udc.c
798
fotg210_set_address(fotg210, ctrl);
drivers/usb/fotg210/fotg210-udc.c
801
fotg210_set_configuration(fotg210);
drivers/usb/fotg210/fotg210-udc.c
81
spin_unlock(&ep->fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
815
static void fotg210_ep0out(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
817
struct fotg210_ep *ep = fotg210->ep[0];
drivers/usb/fotg210/fotg210-udc.c
83
spin_lock(&ep->fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
835
static void fotg210_ep0in(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
837
struct fotg210_ep *ep = fotg210->ep[0];
drivers/usb/fotg210/fotg210-udc.c
851
fotg210_set_cxdone(fotg210);
drivers/usb/fotg210/fotg210-udc.c
869
int disgr1 = ioread32(ep->fotg210->reg + FOTG210_DISGR1);
drivers/usb/fotg210/fotg210-udc.c
884
struct fotg210_udc *fotg210 = _fotg210;
drivers/usb/fotg210/fotg210-udc.c
885
u32 int_grp = ioread32(fotg210->reg + FOTG210_DIGR);
drivers/usb/fotg210/fotg210-udc.c
886
u32 int_msk = ioread32(fotg210->reg + FOTG210_DMIGR);
drivers/usb/fotg210/fotg210-udc.c
89
fotg210_set_cxdone(ep->fotg210);
drivers/usb/fotg210/fotg210-udc.c
890
spin_lock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
893
void __iomem *reg = fotg210->reg + FOTG210_DISGR2;
drivers/usb/fotg210/fotg210-udc.c
895
u32 int_msk2 = ioread32(fotg210->reg + FOTG210_DMISGR2);
drivers/usb/fotg210/fotg210-udc.c
900
usb_gadget_udc_reset(&fotg210->gadget,
drivers/usb/fotg210/fotg210-udc.c
901
fotg210->driver);
drivers/usb/fotg210/fotg210-udc.c
902
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_USBRST_INT);
drivers/usb/fotg210/fotg210-udc.c
906
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_SUSP_INT);
drivers/usb/fotg210/fotg210-udc.c
910
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_RESM_INT);
drivers/usb/fotg210/fotg210-udc.c
914
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_ISO_SEQ_ERR_INT);
drivers/usb/fotg210/fotg210-udc.c
918
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_ISO_SEQ_ABORT_INT);
drivers/usb/fotg210/fotg210-udc.c
922
fotg210_clear_tx0byte(fotg210);
drivers/usb/fotg210/fotg210-udc.c
923
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_TX0BYTE_INT);
drivers/usb/fotg210/fotg210-udc.c
927
fotg210_clear_rx0byte(fotg210);
drivers/usb/fotg210/fotg210-udc.c
928
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_RX0BYTE_INT);
drivers/usb/fotg210/fotg210-udc.c
932
fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_DMA_ERROR);
drivers/usb/fotg210/fotg210-udc.c
937
void __iomem *reg = fotg210->reg + FOTG210_DISGR0;
drivers/usb/fotg210/fotg210-udc.c
939
u32 int_msk0 = ioread32(fotg210->reg + FOTG210_DMISGR0);
drivers/usb/fotg210/fotg210-udc.c
946
fotg210_ack_int(fotg210, FOTG210_DISGR0, DISGR0_CX_COMABT_INT);
drivers/usb/fotg210/fotg210-udc.c
951
if (fotg210_setup_packet(fotg210, &ctrl)) {
drivers/usb/fotg210/fotg210-udc.c
952
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
953
if (fotg210->driver->setup(&fotg210->gadget,
drivers/usb/fotg210/fotg210-udc.c
955
fotg210_set_cxstall(fotg210);
drivers/usb/fotg210/fotg210-udc.c
956
spin_lock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
96
struct fotg210_udc *fotg210 = ep->fotg210;
drivers/usb/fotg210/fotg210-udc.c
963
fotg210_ep0in(fotg210);
drivers/usb/fotg210/fotg210-udc.c
966
fotg210_ep0out(fotg210);
drivers/usb/fotg210/fotg210-udc.c
969
fotg210_set_cxstall(fotg210);
drivers/usb/fotg210/fotg210-udc.c
975
void __iomem *reg = fotg210->reg + FOTG210_DISGR1;
drivers/usb/fotg210/fotg210-udc.c
977
u32 int_msk1 = ioread32(fotg210->reg + FOTG210_DMISGR1);
drivers/usb/fotg210/fotg210-udc.c
984
fotg210_in_fifo_handler(fotg210->ep[fifo + 1]);
drivers/usb/fotg210/fotg210-udc.c
988
fotg210_out_fifo_handler(fotg210->ep[fifo + 1]);
drivers/usb/fotg210/fotg210-udc.c
992
spin_unlock(&fotg210->lock);
drivers/usb/fotg210/fotg210-udc.c
997
static void fotg210_disable_unplug(struct fotg210_udc *fotg210)
drivers/usb/fotg210/fotg210-udc.c
999
u32 reg = ioread32(fotg210->reg + FOTG210_PHYTMSR);
drivers/usb/fotg210/fotg210-udc.h
219
struct fotg210_udc *fotg210;
drivers/usb/fotg210/fotg210-udc.h
240
struct fotg210 *fotg;
drivers/usb/fotg210/fotg210.h
20
void fotg210_vbus(struct fotg210 *fotg, bool enable);
drivers/usb/fotg210/fotg210.h
23
int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg);
drivers/usb/fotg210/fotg210.h
29
struct fotg210 *fotg)
drivers/usb/fotg210/fotg210.h
47
int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg);
drivers/usb/fotg210/fotg210.h
51
struct fotg210 *fotg)