Lines Matching refs:sock
88 struct tifm_dev *sock = host->dev;
101 while (!(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) {
104 *(unsigned int *)(buf + off) = __raw_readl(sock->addr
111 && !(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) {
112 host->io_word = readl(sock->addr + SOCK_MS_DATA);
128 struct tifm_dev *sock = host->dev;
140 && !(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) {
141 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM),
142 sock->addr + SOCK_MS_SYSTEM);
143 writel(host->io_word, sock->addr + SOCK_MS_DATA);
153 while (!(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) {
156 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM),
157 sock->addr + SOCK_MS_SYSTEM);
159 sock->addr + SOCK_MS_DATA);
183 struct tifm_dev *sock = host->dev;
198 dev_dbg(&sock->dev, "fifo data transfer, %d, %d\n", length,
234 dev_dbg(&sock->dev, "fifo data transfer, %d remaining\n", length);
238 | readl(sock->addr + SOCK_MS_SYSTEM),
239 sock->addr + SOCK_MS_SYSTEM);
240 writel(host->io_word, sock->addr + SOCK_MS_DATA);
243 | readl(sock->addr + SOCK_MS_SYSTEM),
244 sock->addr + SOCK_MS_SYSTEM);
245 writel(0, sock->addr + SOCK_MS_DATA);
247 readl(sock->addr + SOCK_MS_DATA);
255 struct tifm_dev *sock = host->dev;
279 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
281 sock->addr + SOCK_FIFO_CONTROL);
284 if (1 != tifm_map_sg(sock, &host->req->sg, 1,
294 sock->addr + SOCK_FIFO_PAGE_SIZE);
296 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
302 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
305 sock->addr + SOCK_DMA_ADDRESS);
306 writel(sys_param, sock->addr + SOCK_DMA_CONTROL);
309 sock->addr + SOCK_MS_SYSTEM);
312 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
316 writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL),
317 sock->addr + SOCK_CONTROL);
320 sys_param = readl(sock->addr + SOCK_MS_SYSTEM);
328 writel(sys_param, sock->addr + SOCK_MS_SYSTEM);
332 writel(cmd, sock->addr + SOCK_MS_COMMAND);
334 dev_dbg(&sock->dev, "executing TPC %x, %x\n", cmd, sys_param);
340 struct tifm_dev *sock = host->dev;
341 struct memstick_host *msh = tifm_get_drvdata(sock);
346 host->req->int_reg = readl(sock->addr + SOCK_MS_STATUS) & 0xff;
351 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
352 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL);
355 tifm_unmap_sg(sock, &host->req->sg, 1,
361 writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL),
362 sock->addr + SOCK_CONTROL);
364 dev_dbg(&sock->dev, "TPC complete\n");
385 static void tifm_ms_data_event(struct tifm_dev *sock)
391 spin_lock(&sock->lock);
392 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock));
393 fifo_status = readl(sock->addr + SOCK_DMA_FIFO_STATUS);
394 host_status = readl(sock->addr + SOCK_MS_STATUS);
395 dev_dbg(&sock->dev,
412 writel(fifo_status, sock->addr + SOCK_DMA_FIFO_STATUS);
416 spin_unlock(&sock->lock);
421 static void tifm_ms_card_event(struct tifm_dev *sock)
427 spin_lock(&sock->lock);
428 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock));
429 host_status = readl(sock->addr + SOCK_MS_STATUS);
430 dev_dbg(&sock->dev, "host event: host_status %x, flags %x\n",
449 writel(TIFM_MS_SYS_INTCLR | readl(sock->addr + SOCK_MS_SYSTEM),
450 sock->addr + SOCK_MS_SYSTEM);
455 spin_unlock(&sock->lock);
463 struct tifm_dev *sock = host->dev;
467 spin_lock_irqsave(&sock->lock, flags);
475 spin_unlock_irqrestore(&sock->lock, flags);
483 spin_unlock_irqrestore(&sock->lock, flags);
503 struct tifm_dev *sock = host->dev;
510 writel(TIFM_MS_SYS_RESET, sock->addr + SOCK_MS_SYSTEM);
512 sock->addr + SOCK_MS_SYSTEM);
513 writel(0xffffffff, sock->addr + SOCK_MS_STATUS);
516 sock->addr + SOCK_MS_SYSTEM);
517 writel(0xffffffff, sock->addr + SOCK_MS_STATUS);
525 & readl(sock->addr + SOCK_CONTROL),
526 sock->addr + SOCK_CONTROL);
530 | readl(sock->addr + SOCK_CONTROL),
531 sock->addr + SOCK_CONTROL);
555 static int tifm_ms_probe(struct tifm_dev *sock)
562 & readl(sock->addr + SOCK_PRESENT_STATE))) {
564 dev_name(&sock->dev));
568 msh = memstick_alloc_host(sizeof(struct tifm_ms), &sock->dev);
573 tifm_set_drvdata(sock, msh);
574 host->dev = sock;
582 sock->card_event = tifm_ms_card_event;
583 sock->data_event = tifm_ms_data_event;
584 if (tifm_has_ms_pif(sock))
595 static void tifm_ms_remove(struct tifm_dev *sock)
597 struct memstick_host *msh = tifm_get_drvdata(sock);
604 spin_lock_irqsave(&sock->lock, flags);
609 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
610 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL);
612 tifm_unmap_sg(sock, &host->req->sg, 1,
624 spin_unlock_irqrestore(&sock->lock, flags);
632 static int tifm_ms_suspend(struct tifm_dev *sock, pm_message_t state)
634 struct memstick_host *msh = tifm_get_drvdata(sock);
640 static int tifm_ms_resume(struct tifm_dev *sock)
642 struct memstick_host *msh = tifm_get_drvdata(sock);