Lines Matching refs:sock
85 struct tifm_dev *sock = host->dev; in tifm_ms_read_data() local
98 while (!(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) { in tifm_ms_read_data()
101 *(unsigned int *)(buf + off) = __raw_readl(sock->addr in tifm_ms_read_data()
108 && !(TIFM_MS_STAT_EMP & readl(sock->addr + SOCK_MS_STATUS))) { in tifm_ms_read_data()
109 host->io_word = readl(sock->addr + SOCK_MS_DATA); in tifm_ms_read_data()
125 struct tifm_dev *sock = host->dev; in tifm_ms_write_data() local
137 && !(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) { in tifm_ms_write_data()
138 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM), in tifm_ms_write_data()
139 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_write_data()
140 writel(host->io_word, sock->addr + SOCK_MS_DATA); in tifm_ms_write_data()
150 while (!(TIFM_MS_STAT_FUL & readl(sock->addr + SOCK_MS_STATUS))) { in tifm_ms_write_data()
153 writel(TIFM_MS_SYS_FDIR | readl(sock->addr + SOCK_MS_SYSTEM), in tifm_ms_write_data()
154 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_write_data()
156 sock->addr + SOCK_MS_DATA); in tifm_ms_write_data()
182 struct tifm_dev *sock = host->dev; in tifm_ms_transfer_data() local
197 dev_dbg(&sock->dev, "fifo data transfer, %d, %d\n", length, in tifm_ms_transfer_data()
233 dev_dbg(&sock->dev, "fifo data transfer, %d remaining\n", length); in tifm_ms_transfer_data()
237 | readl(sock->addr + SOCK_MS_SYSTEM), in tifm_ms_transfer_data()
238 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_transfer_data()
239 writel(host->io_word, sock->addr + SOCK_MS_DATA); in tifm_ms_transfer_data()
242 | readl(sock->addr + SOCK_MS_SYSTEM), in tifm_ms_transfer_data()
243 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_transfer_data()
244 writel(0, sock->addr + SOCK_MS_DATA); in tifm_ms_transfer_data()
246 readl(sock->addr + SOCK_MS_DATA); in tifm_ms_transfer_data()
254 struct tifm_dev *sock = host->dev; in tifm_ms_issue_cmd() local
275 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); in tifm_ms_issue_cmd()
277 sock->addr + SOCK_FIFO_CONTROL); in tifm_ms_issue_cmd()
280 if (1 != tifm_map_sg(sock, &host->req->sg, 1, in tifm_ms_issue_cmd()
290 sock->addr + SOCK_FIFO_PAGE_SIZE); in tifm_ms_issue_cmd()
292 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); in tifm_ms_issue_cmd()
298 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); in tifm_ms_issue_cmd()
301 sock->addr + SOCK_DMA_ADDRESS); in tifm_ms_issue_cmd()
302 writel(sys_param, sock->addr + SOCK_DMA_CONTROL); in tifm_ms_issue_cmd()
305 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_issue_cmd()
308 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); in tifm_ms_issue_cmd()
312 writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), in tifm_ms_issue_cmd()
313 sock->addr + SOCK_CONTROL); in tifm_ms_issue_cmd()
316 sys_param = readl(sock->addr + SOCK_MS_SYSTEM); in tifm_ms_issue_cmd()
324 writel(sys_param, sock->addr + SOCK_MS_SYSTEM); in tifm_ms_issue_cmd()
328 writel(cmd, sock->addr + SOCK_MS_COMMAND); in tifm_ms_issue_cmd()
330 dev_dbg(&sock->dev, "executing TPC %x, %x\n", cmd, sys_param); in tifm_ms_issue_cmd()
336 struct tifm_dev *sock = host->dev; in tifm_ms_complete_cmd() local
337 struct memstick_host *msh = tifm_get_drvdata(sock); in tifm_ms_complete_cmd()
342 host->req->int_reg = readl(sock->addr + SOCK_MS_STATUS) & 0xff; in tifm_ms_complete_cmd()
347 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); in tifm_ms_complete_cmd()
348 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); in tifm_ms_complete_cmd()
351 tifm_unmap_sg(sock, &host->req->sg, 1, in tifm_ms_complete_cmd()
357 writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), in tifm_ms_complete_cmd()
358 sock->addr + SOCK_CONTROL); in tifm_ms_complete_cmd()
360 dev_dbg(&sock->dev, "TPC complete\n"); in tifm_ms_complete_cmd()
381 static void tifm_ms_data_event(struct tifm_dev *sock) in tifm_ms_data_event() argument
387 spin_lock(&sock->lock); in tifm_ms_data_event()
388 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock)); in tifm_ms_data_event()
389 fifo_status = readl(sock->addr + SOCK_DMA_FIFO_STATUS); in tifm_ms_data_event()
390 host_status = readl(sock->addr + SOCK_MS_STATUS); in tifm_ms_data_event()
391 dev_dbg(&sock->dev, in tifm_ms_data_event()
408 writel(fifo_status, sock->addr + SOCK_DMA_FIFO_STATUS); in tifm_ms_data_event()
412 spin_unlock(&sock->lock); in tifm_ms_data_event()
417 static void tifm_ms_card_event(struct tifm_dev *sock) in tifm_ms_card_event() argument
423 spin_lock(&sock->lock); in tifm_ms_card_event()
424 host = memstick_priv((struct memstick_host *)tifm_get_drvdata(sock)); in tifm_ms_card_event()
425 host_status = readl(sock->addr + SOCK_MS_STATUS); in tifm_ms_card_event()
426 dev_dbg(&sock->dev, "host event: host_status %x, flags %x\n", in tifm_ms_card_event()
445 writel(TIFM_MS_SYS_INTCLR | readl(sock->addr + SOCK_MS_SYSTEM), in tifm_ms_card_event()
446 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_card_event()
451 spin_unlock(&sock->lock); in tifm_ms_card_event()
459 struct tifm_dev *sock = host->dev; in tifm_ms_req_tasklet() local
463 spin_lock_irqsave(&sock->lock, flags); in tifm_ms_req_tasklet()
471 spin_unlock_irqrestore(&sock->lock, flags); in tifm_ms_req_tasklet()
479 spin_unlock_irqrestore(&sock->lock, flags); in tifm_ms_req_tasklet()
499 struct tifm_dev *sock = host->dev; in tifm_ms_set_param() local
506 writel(TIFM_MS_SYS_RESET, sock->addr + SOCK_MS_SYSTEM); in tifm_ms_set_param()
508 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_set_param()
509 writel(0xffffffff, sock->addr + SOCK_MS_STATUS); in tifm_ms_set_param()
512 sock->addr + SOCK_MS_SYSTEM); in tifm_ms_set_param()
513 writel(0xffffffff, sock->addr + SOCK_MS_STATUS); in tifm_ms_set_param()
521 & readl(sock->addr + SOCK_CONTROL), in tifm_ms_set_param()
522 sock->addr + SOCK_CONTROL); in tifm_ms_set_param()
526 | readl(sock->addr + SOCK_CONTROL), in tifm_ms_set_param()
527 sock->addr + SOCK_CONTROL); in tifm_ms_set_param()
551 static int tifm_ms_probe(struct tifm_dev *sock) in tifm_ms_probe() argument
558 & readl(sock->addr + SOCK_PRESENT_STATE))) { in tifm_ms_probe()
560 dev_name(&sock->dev)); in tifm_ms_probe()
564 msh = memstick_alloc_host(sizeof(struct tifm_ms), &sock->dev); in tifm_ms_probe()
569 tifm_set_drvdata(sock, msh); in tifm_ms_probe()
570 host->dev = sock; in tifm_ms_probe()
578 sock->card_event = tifm_ms_card_event; in tifm_ms_probe()
579 sock->data_event = tifm_ms_data_event; in tifm_ms_probe()
580 if (tifm_has_ms_pif(sock)) in tifm_ms_probe()
591 static void tifm_ms_remove(struct tifm_dev *sock) in tifm_ms_remove() argument
593 struct memstick_host *msh = tifm_get_drvdata(sock); in tifm_ms_remove()
600 spin_lock_irqsave(&sock->lock, flags); in tifm_ms_remove()
605 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); in tifm_ms_remove()
606 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); in tifm_ms_remove()
608 tifm_unmap_sg(sock, &host->req->sg, 1, in tifm_ms_remove()
620 spin_unlock_irqrestore(&sock->lock, flags); in tifm_ms_remove()
628 static int tifm_ms_suspend(struct tifm_dev *sock, pm_message_t state) in tifm_ms_suspend() argument
630 struct memstick_host *msh = tifm_get_drvdata(sock); in tifm_ms_suspend()
636 static int tifm_ms_resume(struct tifm_dev *sock) in tifm_ms_resume() argument
638 struct memstick_host *msh = tifm_get_drvdata(sock); in tifm_ms_resume()