Lines Matching refs:mmc
189 struct mmc_host *mmc; member
226 static void wmt_mci_read_response(struct mmc_host *mmc) in wmt_mci_read_response() argument
233 priv = mmc_priv(mmc); in wmt_mci_read_response()
257 static int wmt_mci_send_command(struct mmc_host *mmc, u8 command, u8 cmdtype, in wmt_mci_send_command() argument
263 priv = mmc_priv(mmc); in wmt_mci_send_command()
306 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
309 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
314 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
316 wmt_mci_read_response(priv->mmc); in wmt_complete_data_request()
319 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
329 wmt_mci_send_command(priv->mmc, req->data->stop->opcode, in wmt_complete_data_request()
391 mmc_detect_change(priv->mmc, 0); in wmt_mci_regular_isr()
420 wmt_mci_read_response(priv->mmc); in wmt_mci_regular_isr()
424 mmc_request_done(priv->mmc, priv->req); in wmt_mci_regular_isr()
465 static void wmt_reset_hardware(struct mmc_host *mmc) in wmt_reset_hardware() argument
470 priv = mmc_priv(mmc); in wmt_reset_hardware()
504 static int wmt_dma_init(struct mmc_host *mmc) in wmt_dma_init() argument
508 priv = mmc_priv(mmc); in wmt_dma_init()
528 static void wmt_dma_config(struct mmc_host *mmc, u32 descaddr, u8 dir) in wmt_dma_config() argument
533 priv = mmc_priv(mmc); in wmt_dma_config()
562 static void wmt_mci_request(struct mmc_host *mmc, struct mmc_request *req) in wmt_mci_request() argument
579 priv = mmc_priv(mmc); in wmt_mci_request()
602 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
610 wmt_dma_init(mmc); in wmt_mci_request()
623 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
629 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
657 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
660 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
663 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
673 static void wmt_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in wmt_mci_set_ios() argument
678 priv = mmc_priv(mmc); in wmt_mci_set_ios()
681 wmt_reset_hardware(mmc); in wmt_mci_set_ios()
713 static int wmt_mci_get_ro(struct mmc_host *mmc) in wmt_mci_get_ro() argument
715 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_ro()
720 static int wmt_mci_get_cd(struct mmc_host *mmc) in wmt_mci_get_cd() argument
722 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_cd()
754 struct mmc_host *mmc; in wmt_mci_probe() local
784 mmc = mmc_alloc_host(sizeof(struct wmt_mci_priv), &pdev->dev); in wmt_mci_probe()
785 if (!mmc) { in wmt_mci_probe()
791 mmc->ops = &wmt_mci_ops; in wmt_mci_probe()
792 mmc->f_min = wmt_caps->f_min; in wmt_mci_probe()
793 mmc->f_max = wmt_caps->f_max; in wmt_mci_probe()
794 mmc->ocr_avail = wmt_caps->ocr_avail; in wmt_mci_probe()
795 mmc->caps = wmt_caps->caps; in wmt_mci_probe()
797 mmc->max_seg_size = wmt_caps->max_seg_size; in wmt_mci_probe()
798 mmc->max_segs = wmt_caps->max_segs; in wmt_mci_probe()
799 mmc->max_blk_size = wmt_caps->max_blk_size; in wmt_mci_probe()
801 mmc->max_req_size = (16*512*mmc->max_segs); in wmt_mci_probe()
802 mmc->max_blk_count = mmc->max_req_size / 512; in wmt_mci_probe()
804 priv = mmc_priv(mmc); in wmt_mci_probe()
805 priv->mmc = mmc; in wmt_mci_probe()
840 mmc->max_blk_count * 16, in wmt_mci_probe()
849 platform_set_drvdata(pdev, mmc); in wmt_mci_probe()
861 wmt_reset_hardware(mmc); in wmt_mci_probe()
863 mmc_add_host(mmc); in wmt_mci_probe()
875 mmc_free_host(mmc); in wmt_mci_probe()
882 struct mmc_host *mmc; in wmt_mci_remove() local
887 mmc = platform_get_drvdata(pdev); in wmt_mci_remove()
888 priv = mmc_priv(mmc); in wmt_mci_remove()
899 dma_free_coherent(&pdev->dev, priv->mmc->max_blk_count * 16, in wmt_mci_remove()
902 mmc_remove_host(mmc); in wmt_mci_remove()
915 mmc_free_host(mmc); in wmt_mci_remove()
927 struct mmc_host *mmc = platform_get_drvdata(pdev); in wmt_mci_suspend() local
930 if (!mmc) in wmt_mci_suspend()
933 priv = mmc_priv(mmc); in wmt_mci_suspend()
952 struct mmc_host *mmc = platform_get_drvdata(pdev); in wmt_mci_resume() local
955 if (mmc) { in wmt_mci_resume()
956 priv = mmc_priv(mmc); in wmt_mci_resume()