Lines Matching refs:sock
116 struct tifm_dev *sock = host->dev;
127 val = readl(sock->addr + SOCK_MMCSD_DATA);
142 struct tifm_dev *sock = host->dev;
149 writel(val, sock->addr + SOCK_MMCSD_DATA);
161 writel(val, sock->addr + SOCK_MMCSD_DATA);
264 struct tifm_dev *sock = host->dev;
317 dev_dbg(&sock->dev, "setting dma for %d blocks\n", dma_blk_cnt);
318 writel(sg_dma_address(sg) + dma_off, sock->addr + SOCK_DMA_ADDRESS);
321 sock->addr + SOCK_DMA_CONTROL);
324 sock->addr + SOCK_DMA_CONTROL);
373 struct tifm_dev *sock = host->dev;
382 dev_dbg(&sock->dev, "executing opcode 0x%x, arg: 0x%x, mask: 0x%x\n",
385 writel((cmd->arg >> 16) & 0xffff, sock->addr + SOCK_MMCSD_ARG_HIGH);
386 writel(cmd->arg & 0xffff, sock->addr + SOCK_MMCSD_ARG_LOW);
387 writel(cmd->opcode | cmd_mask, sock->addr + SOCK_MMCSD_COMMAND);
390 static void tifm_sd_fetch_resp(struct mmc_command *cmd, struct tifm_dev *sock)
392 cmd->resp[0] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x1c) << 16)
393 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x18);
394 cmd->resp[1] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x14) << 16)
395 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x10);
396 cmd->resp[2] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x0c) << 16)
397 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x08);
398 cmd->resp[3] = (readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x04) << 16)
399 | readl(sock->addr + SOCK_MMCSD_RESPONSE + 0x00);
404 struct tifm_dev *sock = host->dev;
433 | readl(sock->addr
435 sock->addr
444 & readl(sock->addr
446 sock->addr
453 & readl(sock->addr
455 sock->addr + SOCK_MMCSD_INT_ENABLE);
475 static void tifm_sd_data_event(struct tifm_dev *sock)
481 spin_lock(&sock->lock);
482 host = mmc_priv((struct mmc_host*)tifm_get_drvdata(sock));
483 fifo_status = readl(sock->addr + SOCK_DMA_FIFO_STATUS);
484 dev_dbg(&sock->dev, "data event: fifo_status %x, flags %x\n",
498 writel(fifo_status, sock->addr + SOCK_DMA_FIFO_STATUS);
499 spin_unlock(&sock->lock);
503 static void tifm_sd_card_event(struct tifm_dev *sock)
511 spin_lock(&sock->lock);
512 host = mmc_priv((struct mmc_host*)tifm_get_drvdata(sock));
513 host_status = readl(sock->addr + SOCK_MMCSD_STATUS);
514 dev_dbg(&sock->dev, "host event: host_status %x, flags %x\n",
522 sock->addr + SOCK_MMCSD_STATUS);
536 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
537 writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL);
555 tifm_sd_fetch_resp(cmd, sock);
559 sock);
569 sock->addr + SOCK_MMCSD_STATUS);
588 writel(host_status, sock->addr + SOCK_MMCSD_STATUS);
589 spin_unlock(&sock->lock);
595 struct tifm_dev *sock = host->dev;
605 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO);
607 & readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
608 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
613 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO);
615 | readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
616 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
623 struct tifm_dev *sock = host->dev;
627 spin_lock_irqsave(&sock->lock, flags);
635 dev_name(&sock->dev));
654 | readl(sock->addr + SOCK_MMCSD_INT_ENABLE),
655 sock->addr + SOCK_MMCSD_INT_ENABLE);
659 | readl(sock->addr + SOCK_MMCSD_INT_ENABLE),
660 sock->addr + SOCK_MMCSD_INT_ENABLE);
663 sock->addr + SOCK_MMCSD_BUFFER_CONFIG);
670 if(1 != tifm_map_sg(sock, &host->bounce_buf, 1,
675 dev_name(&sock->dev));
679 host->sg_len = tifm_map_sg(sock, r_data->sg,
687 dev_name(&sock->dev));
688 tifm_unmap_sg(sock, &host->bounce_buf, 1,
697 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
699 sock->addr + SOCK_FIFO_PAGE_SIZE);
701 sock->addr + SOCK_FIFO_CONTROL);
703 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
707 sock->addr + SOCK_MMCSD_BUFFER_CONFIG);
710 sock->addr + SOCK_MMCSD_BUFFER_CONFIG);
716 sock->addr + SOCK_MMCSD_NUM_BLOCKS);
718 sock->addr + SOCK_MMCSD_BLOCK_LEN);
723 writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL),
724 sock->addr + SOCK_CONTROL);
726 spin_unlock_irqrestore(&sock->lock, flags);
730 spin_unlock_irqrestore(&sock->lock, flags);
737 struct tifm_dev *sock = host->dev;
738 struct mmc_host *mmc = tifm_get_drvdata(sock);
743 spin_lock_irqsave(&sock->lock, flags);
751 dev_name(&sock->dev));
752 spin_unlock_irqrestore(&sock->lock, flags);
760 & readl(sock->addr + SOCK_MMCSD_INT_ENABLE),
761 sock->addr + SOCK_MMCSD_INT_ENABLE);
763 tifm_unmap_sg(sock, &host->bounce_buf, 1,
766 tifm_unmap_sg(sock, r_data->sg, r_data->sg_len,
772 - readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1;
775 - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1;
778 writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL),
779 sock->addr + SOCK_CONTROL);
781 spin_unlock_irqrestore(&sock->lock, flags);
800 struct tifm_dev *sock = host->dev;
804 spin_lock_irqsave(&sock->lock, flags);
806 dev_dbg(&sock->dev, "ios: clock = %u, vdd = %x, bus_mode = %x, "
812 writel(TIFM_MMCSD_4BBUS | readl(sock->addr + SOCK_MMCSD_CONFIG),
813 sock->addr + SOCK_MMCSD_CONFIG);
816 & readl(sock->addr + SOCK_MMCSD_CONFIG),
817 sock->addr + SOCK_MMCSD_CONFIG);
837 & readl(sock->addr + SOCK_CONTROL),
838 sock->addr + SOCK_CONTROL);
843 | readl(sock->addr + SOCK_CONTROL),
844 sock->addr + SOCK_CONTROL);
852 & readl(sock->addr + SOCK_MMCSD_CONFIG)),
853 sock->addr + SOCK_MMCSD_CONFIG);
861 spin_unlock_irqrestore(&sock->lock, flags);
868 struct tifm_dev *sock = host->dev;
871 spin_lock_irqsave(&sock->lock, flags);
872 if (TIFM_MMCSD_CARD_RO & readl(sock->addr + SOCK_PRESENT_STATE))
874 spin_unlock_irqrestore(&sock->lock, flags);
888 struct tifm_dev *sock = host->dev;
890 writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE);
894 writel(TIFM_MMCSD_RESET, sock->addr + SOCK_MMCSD_SYSTEM_CONTROL);
896 sock->addr + SOCK_MMCSD_CONFIG);
900 if (1 & readl(sock->addr + SOCK_MMCSD_SYSTEM_STATUS)) {
909 dev_name(&sock->dev));
913 writel(0, sock->addr + SOCK_MMCSD_NUM_BLOCKS);
915 sock->addr + SOCK_MMCSD_CONFIG);
916 writel(TIFM_MMCSD_RXDE, sock->addr + SOCK_MMCSD_BUFFER_CONFIG);
919 writel(64, sock->addr + SOCK_MMCSD_COMMAND_TO);
920 writel(TIFM_MMCSD_INAB, sock->addr + SOCK_MMCSD_COMMAND);
923 host_status = readl(sock->addr + SOCK_MMCSD_STATUS);
924 writel(host_status, sock->addr + SOCK_MMCSD_STATUS);
936 dev_name(&sock->dev));
942 sock->addr + SOCK_MMCSD_INT_ENABLE);
948 static int tifm_sd_probe(struct tifm_dev *sock)
955 & readl(sock->addr + SOCK_PRESENT_STATE))) {
957 dev_name(&sock->dev));
961 mmc = mmc_alloc_host(sizeof(struct tifm_sd), &sock->dev);
966 tifm_set_drvdata(sock, mmc);
967 host->dev = sock;
987 sock->card_event = tifm_sd_card_event;
988 sock->data_event = tifm_sd_data_event;
1000 static void tifm_sd_remove(struct tifm_dev *sock)
1002 struct mmc_host *mmc = tifm_get_drvdata(sock);
1006 spin_lock_irqsave(&sock->lock, flags);
1008 writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE);
1010 spin_unlock_irqrestore(&sock->lock, flags);
1014 spin_lock_irqsave(&sock->lock, flags);
1017 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
1018 writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
1024 spin_unlock_irqrestore(&sock->lock, flags);
1026 dev_dbg(&sock->dev, "after remove\n");
1033 static int tifm_sd_suspend(struct tifm_dev *sock, pm_message_t state)
1035 return mmc_suspend_host(tifm_get_drvdata(sock));
1038 static int tifm_sd_resume(struct tifm_dev *sock)
1040 struct mmc_host *mmc = tifm_get_drvdata(sock);
1045 dev_dbg(&sock->dev, "resume initialize %d\n", rc);