Lines Matching full:mmc
3 * WM8505/WM8650 SD/MMC Host Controller
25 #include <linux/mmc/host.h>
26 #include <linux/mmc/mmc.h>
27 #include <linux/mmc/sd.h>
35 /* MMC/SD controller registers */
121 /* MMC/SD DMA Controller Registers */
185 struct mmc_host *mmc; member
222 static void wmt_mci_read_response(struct mmc_host *mmc) in wmt_mci_read_response() argument
229 priv = mmc_priv(mmc); in wmt_mci_read_response()
253 static int wmt_mci_send_command(struct mmc_host *mmc, u8 command, u8 cmdtype, in wmt_mci_send_command() argument
259 priv = mmc_priv(mmc); in wmt_mci_send_command()
302 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
305 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
310 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
312 wmt_mci_read_response(priv->mmc); in wmt_complete_data_request()
315 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
325 wmt_mci_send_command(priv->mmc, req->data->stop->opcode, in wmt_complete_data_request()
387 mmc_detect_change(priv->mmc, 0); in wmt_mci_regular_isr()
416 wmt_mci_read_response(priv->mmc); in wmt_mci_regular_isr()
420 mmc_request_done(priv->mmc, priv->req); in wmt_mci_regular_isr()
461 static void wmt_reset_hardware(struct mmc_host *mmc) in wmt_reset_hardware() argument
466 priv = mmc_priv(mmc); in wmt_reset_hardware()
500 static int wmt_dma_init(struct mmc_host *mmc) in wmt_dma_init() argument
504 priv = mmc_priv(mmc); in wmt_dma_init()
524 static void wmt_dma_config(struct mmc_host *mmc, u32 descaddr, u8 dir) in wmt_dma_config() argument
529 priv = mmc_priv(mmc); in wmt_dma_config()
558 static void wmt_mci_request(struct mmc_host *mmc, struct mmc_request *req) in wmt_mci_request() argument
575 priv = mmc_priv(mmc); in wmt_mci_request()
598 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
606 wmt_dma_init(mmc); in wmt_mci_request()
619 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
625 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
653 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
656 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
659 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
669 static void wmt_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in wmt_mci_set_ios() argument
674 priv = mmc_priv(mmc); in wmt_mci_set_ios()
677 wmt_reset_hardware(mmc); in wmt_mci_set_ios()
709 static int wmt_mci_get_ro(struct mmc_host *mmc) in wmt_mci_get_ro() argument
711 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_ro()
716 static int wmt_mci_get_cd(struct mmc_host *mmc) in wmt_mci_get_cd() argument
718 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_cd()
750 struct mmc_host *mmc; in wmt_mci_probe() local
777 mmc = mmc_alloc_host(sizeof(struct wmt_mci_priv), &pdev->dev); in wmt_mci_probe()
778 if (!mmc) { in wmt_mci_probe()
784 mmc->ops = &wmt_mci_ops; in wmt_mci_probe()
785 mmc->f_min = wmt_caps->f_min; in wmt_mci_probe()
786 mmc->f_max = wmt_caps->f_max; in wmt_mci_probe()
787 mmc->ocr_avail = wmt_caps->ocr_avail; in wmt_mci_probe()
788 mmc->caps = wmt_caps->caps; in wmt_mci_probe()
790 mmc->max_seg_size = wmt_caps->max_seg_size; in wmt_mci_probe()
791 mmc->max_segs = wmt_caps->max_segs; in wmt_mci_probe()
792 mmc->max_blk_size = wmt_caps->max_blk_size; in wmt_mci_probe()
794 mmc->max_req_size = (16*512*mmc->max_segs); in wmt_mci_probe()
795 mmc->max_blk_count = mmc->max_req_size / 512; in wmt_mci_probe()
797 priv = mmc_priv(mmc); in wmt_mci_probe()
798 priv->mmc = mmc; in wmt_mci_probe()
831 mmc->max_blk_count * 16, in wmt_mci_probe()
840 platform_set_drvdata(pdev, mmc); in wmt_mci_probe()
854 wmt_reset_hardware(mmc); in wmt_mci_probe()
856 ret = mmc_add_host(mmc); in wmt_mci_probe()
868 dma_free_coherent(&pdev->dev, mmc->max_blk_count * 16, in wmt_mci_probe()
877 mmc_free_host(mmc); in wmt_mci_probe()
884 struct mmc_host *mmc; in wmt_mci_remove() local
888 mmc = platform_get_drvdata(pdev); in wmt_mci_remove()
889 priv = mmc_priv(mmc); in wmt_mci_remove()
900 dma_free_coherent(&pdev->dev, priv->mmc->max_blk_count * 16, in wmt_mci_remove()
903 mmc_remove_host(mmc); in wmt_mci_remove()
913 mmc_free_host(mmc); in wmt_mci_remove()
922 struct mmc_host *mmc = dev_get_drvdata(dev); in wmt_mci_suspend() local
925 if (!mmc) in wmt_mci_suspend()
928 priv = mmc_priv(mmc); in wmt_mci_suspend()
946 struct mmc_host *mmc = dev_get_drvdata(dev); in wmt_mci_resume() local
949 if (mmc) { in wmt_mci_resume()
950 priv = mmc_priv(mmc); in wmt_mci_resume()
996 MODULE_DESCRIPTION("Wondermedia MMC/SD Driver");