Lines Matching refs:host

164 static inline void IRQ_ON(struct au1xmmc_host *host, u32 mask)  in IRQ_ON()  argument
166 u32 val = __raw_readl(HOST_CONFIG(host)); in IRQ_ON()
168 __raw_writel(val, HOST_CONFIG(host)); in IRQ_ON()
172 static inline void FLUSH_FIFO(struct au1xmmc_host *host) in FLUSH_FIFO() argument
174 u32 val = __raw_readl(HOST_CONFIG2(host)); in FLUSH_FIFO()
176 __raw_writel(val | SD_CONFIG2_FF, HOST_CONFIG2(host)); in FLUSH_FIFO()
183 __raw_writel(val, HOST_CONFIG2(host)); in FLUSH_FIFO()
187 static inline void IRQ_OFF(struct au1xmmc_host *host, u32 mask) in IRQ_OFF() argument
189 u32 val = __raw_readl(HOST_CONFIG(host)); in IRQ_OFF()
191 __raw_writel(val, HOST_CONFIG(host)); in IRQ_OFF()
195 static inline void SEND_STOP(struct au1xmmc_host *host) in SEND_STOP() argument
199 WARN_ON(host->status != HOST_S_DATA); in SEND_STOP()
200 host->status = HOST_S_STOP; in SEND_STOP()
202 config2 = __raw_readl(HOST_CONFIG2(host)); in SEND_STOP()
203 __raw_writel(config2 | SD_CONFIG2_DF, HOST_CONFIG2(host)); in SEND_STOP()
207 __raw_writel(STOP_CMD, HOST_CMD(host)); in SEND_STOP()
211 static void au1xmmc_set_power(struct au1xmmc_host *host, int state) in au1xmmc_set_power() argument
213 if (host->platdata && host->platdata->set_power) in au1xmmc_set_power()
214 host->platdata->set_power(host->mmc, state); in au1xmmc_set_power()
219 struct au1xmmc_host *host = mmc_priv(mmc); in au1xmmc_card_inserted() local
221 if (host->platdata && host->platdata->card_inserted) in au1xmmc_card_inserted()
222 return !!host->platdata->card_inserted(host->mmc); in au1xmmc_card_inserted()
229 struct au1xmmc_host *host = mmc_priv(mmc); in au1xmmc_card_readonly() local
231 if (host->platdata && host->platdata->card_readonly) in au1xmmc_card_readonly()
232 return !!host->platdata->card_readonly(mmc); in au1xmmc_card_readonly()
237 static void au1xmmc_finish_request(struct au1xmmc_host *host) in au1xmmc_finish_request() argument
239 struct mmc_request *mrq = host->mrq; in au1xmmc_finish_request()
241 host->mrq = NULL; in au1xmmc_finish_request()
242 host->flags &= HOST_F_ACTIVE | HOST_F_DMA; in au1xmmc_finish_request()
244 host->dma.len = 0; in au1xmmc_finish_request()
245 host->dma.dir = 0; in au1xmmc_finish_request()
247 host->pio.index = 0; in au1xmmc_finish_request()
248 host->pio.offset = 0; in au1xmmc_finish_request()
249 host->pio.len = 0; in au1xmmc_finish_request()
251 host->status = HOST_S_IDLE; in au1xmmc_finish_request()
253 mmc_request_done(host->mmc, mrq); in au1xmmc_finish_request()
258 struct au1xmmc_host *host = from_tasklet(host, t, finish_task); in au1xmmc_tasklet_finish() local
259 au1xmmc_finish_request(host); in au1xmmc_tasklet_finish()
262 static int au1xmmc_send_command(struct au1xmmc_host *host, in au1xmmc_send_command() argument
302 __raw_writel(cmd->arg, HOST_CMDARG(host)); in au1xmmc_send_command()
305 __raw_writel((mmccmd | SD_CMD_GO), HOST_CMD(host)); in au1xmmc_send_command()
309 while (__raw_readl(HOST_CMD(host)) & SD_CMD_GO) in au1xmmc_send_command()
315 static void au1xmmc_data_complete(struct au1xmmc_host *host, u32 status) in au1xmmc_data_complete() argument
317 struct mmc_request *mrq = host->mrq; in au1xmmc_data_complete()
321 WARN_ON((host->status != HOST_S_DATA) && (host->status != HOST_S_STOP)); in au1xmmc_data_complete()
323 if (host->mrq == NULL) in au1xmmc_data_complete()
329 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_data_complete()
332 while ((host->flags & HOST_F_XMIT) && (status & SD_STATUS_DB)) in au1xmmc_data_complete()
333 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_data_complete()
336 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->dma.dir); in au1xmmc_data_complete()
340 if (host->flags & HOST_F_XMIT) in au1xmmc_data_complete()
347 __raw_writel(SD_STATUS_WC | SD_STATUS_RC, HOST_STATUS(host)); in au1xmmc_data_complete()
352 if (host->flags & (HOST_F_DMA | HOST_F_DBDMA)) { in au1xmmc_data_complete()
353 u32 chan = DMA_CHANNEL(host); in au1xmmc_data_complete()
360 (data->blocks * data->blksz) - host->pio.len; in au1xmmc_data_complete()
363 au1xmmc_finish_request(host); in au1xmmc_data_complete()
368 struct au1xmmc_host *host = from_tasklet(host, t, data_task); in au1xmmc_tasklet_data() local
370 u32 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_tasklet_data()
371 au1xmmc_data_complete(host, status); in au1xmmc_tasklet_data()
376 static void au1xmmc_send_pio(struct au1xmmc_host *host) in au1xmmc_send_pio() argument
384 data = host->mrq->data; in au1xmmc_send_pio()
386 if (!(host->flags & HOST_F_XMIT)) in au1xmmc_send_pio()
390 sg = &data->sg[host->pio.index]; in au1xmmc_send_pio()
391 sg_ptr = kmap_local_page(sg_page(sg)) + sg->offset + host->pio.offset; in au1xmmc_send_pio()
394 sg_len = data->sg[host->pio.index].length - host->pio.offset; in au1xmmc_send_pio()
397 max = (sg_len > host->pio.len) ? host->pio.len : sg_len; in au1xmmc_send_pio()
402 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_send_pio()
409 __raw_writel((unsigned long)val, HOST_TXPORT(host)); in au1xmmc_send_pio()
414 host->pio.len -= count; in au1xmmc_send_pio()
415 host->pio.offset += count; in au1xmmc_send_pio()
418 host->pio.index++; in au1xmmc_send_pio()
419 host->pio.offset = 0; in au1xmmc_send_pio()
422 if (host->pio.len == 0) { in au1xmmc_send_pio()
423 IRQ_OFF(host, SD_CONFIG_TH); in au1xmmc_send_pio()
425 if (host->flags & HOST_F_STOP) in au1xmmc_send_pio()
426 SEND_STOP(host); in au1xmmc_send_pio()
428 tasklet_schedule(&host->data_task); in au1xmmc_send_pio()
432 static void au1xmmc_receive_pio(struct au1xmmc_host *host) in au1xmmc_receive_pio() argument
440 data = host->mrq->data; in au1xmmc_receive_pio()
442 if (!(host->flags & HOST_F_RECV)) in au1xmmc_receive_pio()
445 max = host->pio.len; in au1xmmc_receive_pio()
447 if (host->pio.index < host->dma.len) { in au1xmmc_receive_pio()
448 sg = &data->sg[host->pio.index]; in au1xmmc_receive_pio()
449 sg_ptr = kmap_local_page(sg_page(sg)) + sg->offset + host->pio.offset; in au1xmmc_receive_pio()
452 sg_len = sg_dma_len(&data->sg[host->pio.index]) - host->pio.offset; in au1xmmc_receive_pio()
463 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_receive_pio()
469 DBG("RX CRC Error [%d + %d].\n", host->pdev->id, in au1xmmc_receive_pio()
470 host->pio.len, count); in au1xmmc_receive_pio()
475 DBG("RX Overrun [%d + %d]\n", host->pdev->id, in au1xmmc_receive_pio()
476 host->pio.len, count); in au1xmmc_receive_pio()
480 DBG("RX Underrun [%d + %d]\n", host->pdev->id, in au1xmmc_receive_pio()
481 host->pio.len, count); in au1xmmc_receive_pio()
485 val = __raw_readl(HOST_RXPORT(host)); in au1xmmc_receive_pio()
493 host->pio.len -= count; in au1xmmc_receive_pio()
494 host->pio.offset += count; in au1xmmc_receive_pio()
497 host->pio.index++; in au1xmmc_receive_pio()
498 host->pio.offset = 0; in au1xmmc_receive_pio()
501 if (host->pio.len == 0) { in au1xmmc_receive_pio()
503 IRQ_OFF(host, SD_CONFIG_NE); in au1xmmc_receive_pio()
505 if (host->flags & HOST_F_STOP) in au1xmmc_receive_pio()
506 SEND_STOP(host); in au1xmmc_receive_pio()
508 tasklet_schedule(&host->data_task); in au1xmmc_receive_pio()
515 static void au1xmmc_cmd_complete(struct au1xmmc_host *host, u32 status) in au1xmmc_cmd_complete() argument
517 struct mmc_request *mrq = host->mrq; in au1xmmc_cmd_complete()
522 if (!host->mrq) in au1xmmc_cmd_complete()
530 r[0] = __raw_readl(host->iobase + SD_RESP3); in au1xmmc_cmd_complete()
531 r[1] = __raw_readl(host->iobase + SD_RESP2); in au1xmmc_cmd_complete()
532 r[2] = __raw_readl(host->iobase + SD_RESP1); in au1xmmc_cmd_complete()
533 r[3] = __raw_readl(host->iobase + SD_RESP0); in au1xmmc_cmd_complete()
552 cmd->resp[0] = __raw_readl(host->iobase + SD_RESP0); in au1xmmc_cmd_complete()
560 trans = host->flags & (HOST_F_XMIT | HOST_F_RECV); in au1xmmc_cmd_complete()
563 IRQ_OFF(host, SD_CONFIG_TH | SD_CONFIG_RA | SD_CONFIG_RF); in au1xmmc_cmd_complete()
564 tasklet_schedule(&host->finish_task); in au1xmmc_cmd_complete()
568 host->status = HOST_S_DATA; in au1xmmc_cmd_complete()
570 if ((host->flags & (HOST_F_DMA | HOST_F_DBDMA))) { in au1xmmc_cmd_complete()
571 u32 channel = DMA_CHANNEL(host); in au1xmmc_cmd_complete()
575 if (host->flags & HOST_F_RECV) { in au1xmmc_cmd_complete()
579 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_cmd_complete()
586 static void au1xmmc_set_clock(struct au1xmmc_host *host, int rate) in au1xmmc_set_clock() argument
588 unsigned int pbus = clk_get_rate(host->clk); in au1xmmc_set_clock()
592 config = __raw_readl(HOST_CONFIG(host)); in au1xmmc_set_clock()
597 __raw_writel(config, HOST_CONFIG(host)); in au1xmmc_set_clock()
601 static int au1xmmc_prepare_data(struct au1xmmc_host *host, in au1xmmc_prepare_data() argument
607 host->flags |= HOST_F_RECV; in au1xmmc_prepare_data()
609 host->flags |= HOST_F_XMIT; in au1xmmc_prepare_data()
611 if (host->mrq->stop) in au1xmmc_prepare_data()
612 host->flags |= HOST_F_STOP; in au1xmmc_prepare_data()
614 host->dma.dir = DMA_BIDIRECTIONAL; in au1xmmc_prepare_data()
616 host->dma.len = dma_map_sg(mmc_dev(host->mmc), data->sg, in au1xmmc_prepare_data()
617 data->sg_len, host->dma.dir); in au1xmmc_prepare_data()
619 if (host->dma.len == 0) in au1xmmc_prepare_data()
622 __raw_writel(data->blksz - 1, HOST_BLKSIZE(host)); in au1xmmc_prepare_data()
624 if (host->flags & (HOST_F_DMA | HOST_F_DBDMA)) { in au1xmmc_prepare_data()
626 u32 channel = DMA_CHANNEL(host); in au1xmmc_prepare_data()
630 for (i = 0; i < host->dma.len; i++) { in au1xmmc_prepare_data()
637 if (i == host->dma.len - 1) in au1xmmc_prepare_data()
640 if (host->flags & HOST_F_XMIT) { in au1xmmc_prepare_data()
654 host->pio.index = 0; in au1xmmc_prepare_data()
655 host->pio.offset = 0; in au1xmmc_prepare_data()
656 host->pio.len = datalen; in au1xmmc_prepare_data()
658 if (host->flags & HOST_F_XMIT) in au1xmmc_prepare_data()
659 IRQ_ON(host, SD_CONFIG_TH); in au1xmmc_prepare_data()
661 IRQ_ON(host, SD_CONFIG_NE); in au1xmmc_prepare_data()
668 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, in au1xmmc_prepare_data()
669 host->dma.dir); in au1xmmc_prepare_data()
676 struct au1xmmc_host *host = mmc_priv(mmc); in au1xmmc_request() local
680 WARN_ON(host->status != HOST_S_IDLE); in au1xmmc_request()
682 host->mrq = mrq; in au1xmmc_request()
683 host->status = HOST_S_CMD; in au1xmmc_request()
688 au1xmmc_finish_request(host); in au1xmmc_request()
693 FLUSH_FIFO(host); in au1xmmc_request()
694 ret = au1xmmc_prepare_data(host, mrq->data); in au1xmmc_request()
698 ret = au1xmmc_send_command(host, mrq->cmd, mrq->data); in au1xmmc_request()
702 au1xmmc_finish_request(host); in au1xmmc_request()
706 static void au1xmmc_reset_controller(struct au1xmmc_host *host) in au1xmmc_reset_controller() argument
709 __raw_writel(SD_ENABLE_CE, HOST_ENABLE(host)); in au1xmmc_reset_controller()
713 __raw_writel(SD_ENABLE_R | SD_ENABLE_CE, HOST_ENABLE(host)); in au1xmmc_reset_controller()
717 __raw_writel(~0, HOST_STATUS(host)); in au1xmmc_reset_controller()
720 __raw_writel(0, HOST_BLKSIZE(host)); in au1xmmc_reset_controller()
721 __raw_writel(0x001fffff, HOST_TIMEOUT(host)); in au1xmmc_reset_controller()
724 __raw_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); in au1xmmc_reset_controller()
727 __raw_writel(SD_CONFIG2_EN | SD_CONFIG2_FF, HOST_CONFIG2(host)); in au1xmmc_reset_controller()
731 __raw_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); in au1xmmc_reset_controller()
735 __raw_writel(AU1XMMC_INTERRUPTS, HOST_CONFIG(host)); in au1xmmc_reset_controller()
742 struct au1xmmc_host *host = mmc_priv(mmc); in au1xmmc_set_ios() local
746 au1xmmc_set_power(host, 0); in au1xmmc_set_ios()
748 au1xmmc_set_power(host, 1); in au1xmmc_set_ios()
751 if (ios->clock && ios->clock != host->clock) { in au1xmmc_set_ios()
752 au1xmmc_set_clock(host, ios->clock); in au1xmmc_set_ios()
753 host->clock = ios->clock; in au1xmmc_set_ios()
756 config2 = __raw_readl(HOST_CONFIG2(host)); in au1xmmc_set_ios()
769 __raw_writel(config2, HOST_CONFIG2(host)); in au1xmmc_set_ios()
779 struct au1xmmc_host *host = dev_id; in au1xmmc_irq() local
782 status = __raw_readl(HOST_STATUS(host)); in au1xmmc_irq()
788 mmc_signal_sdio_irq(host->mmc); in au1xmmc_irq()
790 if (host->mrq && (status & STATUS_TIMEOUT)) { in au1xmmc_irq()
792 host->mrq->cmd->error = -ETIMEDOUT; in au1xmmc_irq()
794 host->mrq->data->error = -ETIMEDOUT; in au1xmmc_irq()
797 IRQ_OFF(host, SD_CONFIG_NE | SD_CONFIG_TH); in au1xmmc_irq()
800 tasklet_schedule(&host->finish_task); in au1xmmc_irq()
805 if (!(host->flags & HOST_F_DMA) && (status & SD_STATUS_NE)) in au1xmmc_irq()
806 au1xmmc_receive_pio(host); in au1xmmc_irq()
808 au1xmmc_data_complete(host, status); in au1xmmc_irq()
814 if (host->status == HOST_S_CMD) in au1xmmc_irq()
815 au1xmmc_cmd_complete(host, status); in au1xmmc_irq()
817 } else if (!(host->flags & HOST_F_DMA)) { in au1xmmc_irq()
818 if ((host->flags & HOST_F_XMIT) && (status & STATUS_DATA_OUT)) in au1xmmc_irq()
819 au1xmmc_send_pio(host); in au1xmmc_irq()
820 else if ((host->flags & HOST_F_RECV) && (status & STATUS_DATA_IN)) in au1xmmc_irq()
821 au1xmmc_receive_pio(host); in au1xmmc_irq()
824 DBG("Unhandled status %8.8x\n", host->pdev->id, in au1xmmc_irq()
828 __raw_writel(status, HOST_STATUS(host)); in au1xmmc_irq()
848 struct au1xmmc_host *host = (struct au1xmmc_host *)dev_id; in au1xmmc_dbdma_callback() local
851 if (!host->mrq) in au1xmmc_dbdma_callback()
854 if (host->flags & HOST_F_STOP) in au1xmmc_dbdma_callback()
855 SEND_STOP(host); in au1xmmc_dbdma_callback()
857 tasklet_schedule(&host->data_task); in au1xmmc_dbdma_callback()
860 static int au1xmmc_dbdma_init(struct au1xmmc_host *host) in au1xmmc_dbdma_init() argument
865 res = platform_get_resource(host->pdev, IORESOURCE_DMA, 0); in au1xmmc_dbdma_init()
870 res = platform_get_resource(host->pdev, IORESOURCE_DMA, 1); in au1xmmc_dbdma_init()
878 host->tx_chan = au1xxx_dbdma_chan_alloc(memid, txid, in au1xmmc_dbdma_init()
879 au1xmmc_dbdma_callback, (void *)host); in au1xmmc_dbdma_init()
880 if (!host->tx_chan) { in au1xmmc_dbdma_init()
881 dev_err(&host->pdev->dev, "cannot allocate TX DMA\n"); in au1xmmc_dbdma_init()
885 host->rx_chan = au1xxx_dbdma_chan_alloc(rxid, memid, in au1xmmc_dbdma_init()
886 au1xmmc_dbdma_callback, (void *)host); in au1xmmc_dbdma_init()
887 if (!host->rx_chan) { in au1xmmc_dbdma_init()
888 dev_err(&host->pdev->dev, "cannot allocate RX DMA\n"); in au1xmmc_dbdma_init()
889 au1xxx_dbdma_chan_free(host->tx_chan); in au1xmmc_dbdma_init()
893 au1xxx_dbdma_set_devwidth(host->tx_chan, 8); in au1xmmc_dbdma_init()
894 au1xxx_dbdma_set_devwidth(host->rx_chan, 8); in au1xmmc_dbdma_init()
896 au1xxx_dbdma_ring_alloc(host->tx_chan, AU1XMMC_DESCRIPTOR_COUNT); in au1xmmc_dbdma_init()
897 au1xxx_dbdma_ring_alloc(host->rx_chan, AU1XMMC_DESCRIPTOR_COUNT); in au1xmmc_dbdma_init()
900 host->flags |= HOST_F_DMA | HOST_F_DBDMA; in au1xmmc_dbdma_init()
905 static void au1xmmc_dbdma_shutdown(struct au1xmmc_host *host) in au1xmmc_dbdma_shutdown() argument
907 if (host->flags & HOST_F_DMA) { in au1xmmc_dbdma_shutdown()
908 host->flags &= ~HOST_F_DMA; in au1xmmc_dbdma_shutdown()
909 au1xxx_dbdma_chan_free(host->tx_chan); in au1xmmc_dbdma_shutdown()
910 au1xxx_dbdma_chan_free(host->rx_chan); in au1xmmc_dbdma_shutdown()
916 struct au1xmmc_host *host = mmc_priv(mmc); in au1xmmc_enable_sdio_irq() local
919 IRQ_ON(host, SD_CONFIG_SI); in au1xmmc_enable_sdio_irq()
921 IRQ_OFF(host, SD_CONFIG_SI); in au1xmmc_enable_sdio_irq()
935 struct au1xmmc_host *host; in au1xmmc_probe() local
946 host = mmc_priv(mmc); in au1xmmc_probe()
947 host->mmc = mmc; in au1xmmc_probe()
948 host->platdata = pdev->dev.platform_data; in au1xmmc_probe()
949 host->pdev = pdev; in au1xmmc_probe()
958 host->ioarea = request_mem_region(r->start, resource_size(r), in au1xmmc_probe()
960 if (!host->ioarea) { in au1xmmc_probe()
965 host->iobase = ioremap(r->start, 0x3c); in au1xmmc_probe()
966 if (!host->iobase) { in au1xmmc_probe()
971 host->irq = platform_get_irq(pdev, 0); in au1xmmc_probe()
972 if (host->irq < 0) { in au1xmmc_probe()
973 ret = host->irq; in au1xmmc_probe()
1002 if (host->ioarea->start == AU1100_SD0_PHYS_ADDR) in au1xmmc_probe()
1007 ret = request_irq(host->irq, au1xmmc_irq, iflag, DRIVER_NAME, host); in au1xmmc_probe()
1013 host->clk = clk_get(&pdev->dev, ALCHEMY_PERIPH_CLK); in au1xmmc_probe()
1014 if (IS_ERR(host->clk)) { in au1xmmc_probe()
1016 ret = PTR_ERR(host->clk); in au1xmmc_probe()
1020 ret = clk_prepare_enable(host->clk); in au1xmmc_probe()
1026 host->status = HOST_S_IDLE; in au1xmmc_probe()
1029 if (host->platdata && host->platdata->cd_setup) { in au1xmmc_probe()
1030 ret = host->platdata->cd_setup(mmc, 1); in au1xmmc_probe()
1039 if (host->platdata) in au1xmmc_probe()
1040 mmc->caps &= ~(host->platdata->mask_host_caps); in au1xmmc_probe()
1042 tasklet_setup(&host->data_task, au1xmmc_tasklet_data); in au1xmmc_probe()
1044 tasklet_setup(&host->finish_task, au1xmmc_tasklet_finish); in au1xmmc_probe()
1047 ret = au1xmmc_dbdma_init(host); in au1xmmc_probe()
1053 if (host->platdata && host->platdata->led) { in au1xmmc_probe()
1054 struct led_classdev *led = host->platdata->led; in au1xmmc_probe()
1064 au1xmmc_reset_controller(host); in au1xmmc_probe()
1072 platform_set_drvdata(pdev, host); in au1xmmc_probe()
1075 " (mode=%s)\n", pdev->id, host->iobase, in au1xmmc_probe()
1076 host->flags & HOST_F_DMA ? "dma" : "pio"); in au1xmmc_probe()
1082 if (host->platdata && host->platdata->led) in au1xmmc_probe()
1083 led_classdev_unregister(host->platdata->led); in au1xmmc_probe()
1086 __raw_writel(0, HOST_ENABLE(host)); in au1xmmc_probe()
1087 __raw_writel(0, HOST_CONFIG(host)); in au1xmmc_probe()
1088 __raw_writel(0, HOST_CONFIG2(host)); in au1xmmc_probe()
1091 if (host->flags & HOST_F_DBDMA) in au1xmmc_probe()
1092 au1xmmc_dbdma_shutdown(host); in au1xmmc_probe()
1094 tasklet_kill(&host->data_task); in au1xmmc_probe()
1095 tasklet_kill(&host->finish_task); in au1xmmc_probe()
1097 if (host->platdata && host->platdata->cd_setup && in au1xmmc_probe()
1099 host->platdata->cd_setup(mmc, 0); in au1xmmc_probe()
1101 clk_disable_unprepare(host->clk); in au1xmmc_probe()
1103 clk_put(host->clk); in au1xmmc_probe()
1105 free_irq(host->irq, host); in au1xmmc_probe()
1107 iounmap((void *)host->iobase); in au1xmmc_probe()
1109 release_resource(host->ioarea); in au1xmmc_probe()
1110 kfree(host->ioarea); in au1xmmc_probe()
1119 struct au1xmmc_host *host = platform_get_drvdata(pdev); in au1xmmc_remove() local
1121 if (host) { in au1xmmc_remove()
1122 mmc_remove_host(host->mmc); in au1xmmc_remove()
1125 if (host->platdata && host->platdata->led) in au1xmmc_remove()
1126 led_classdev_unregister(host->platdata->led); in au1xmmc_remove()
1129 if (host->platdata && host->platdata->cd_setup && in au1xmmc_remove()
1130 !(host->mmc->caps & MMC_CAP_NEEDS_POLL)) in au1xmmc_remove()
1131 host->platdata->cd_setup(host->mmc, 0); in au1xmmc_remove()
1133 __raw_writel(0, HOST_ENABLE(host)); in au1xmmc_remove()
1134 __raw_writel(0, HOST_CONFIG(host)); in au1xmmc_remove()
1135 __raw_writel(0, HOST_CONFIG2(host)); in au1xmmc_remove()
1138 tasklet_kill(&host->data_task); in au1xmmc_remove()
1139 tasklet_kill(&host->finish_task); in au1xmmc_remove()
1141 if (host->flags & HOST_F_DBDMA) in au1xmmc_remove()
1142 au1xmmc_dbdma_shutdown(host); in au1xmmc_remove()
1144 au1xmmc_set_power(host, 0); in au1xmmc_remove()
1146 clk_disable_unprepare(host->clk); in au1xmmc_remove()
1147 clk_put(host->clk); in au1xmmc_remove()
1149 free_irq(host->irq, host); in au1xmmc_remove()
1150 iounmap((void *)host->iobase); in au1xmmc_remove()
1151 release_resource(host->ioarea); in au1xmmc_remove()
1152 kfree(host->ioarea); in au1xmmc_remove()
1154 mmc_free_host(host->mmc); in au1xmmc_remove()
1161 struct au1xmmc_host *host = platform_get_drvdata(pdev); in au1xmmc_suspend() local
1163 __raw_writel(0, HOST_CONFIG2(host)); in au1xmmc_suspend()
1164 __raw_writel(0, HOST_CONFIG(host)); in au1xmmc_suspend()
1165 __raw_writel(0xffffffff, HOST_STATUS(host)); in au1xmmc_suspend()
1166 __raw_writel(0, HOST_ENABLE(host)); in au1xmmc_suspend()
1174 struct au1xmmc_host *host = platform_get_drvdata(pdev); in au1xmmc_resume() local
1176 au1xmmc_reset_controller(host); in au1xmmc_resume()