Lines Matching refs:mmc
188 struct mmc_host *mmc; member
239 static void wmt_mci_read_response(struct mmc_host *mmc) in wmt_mci_read_response() argument
246 priv = mmc_priv(mmc); in wmt_mci_read_response()
270 static int wmt_mci_send_command(struct mmc_host *mmc, u8 command, u8 cmdtype, in wmt_mci_send_command() argument
276 priv = mmc_priv(mmc); in wmt_mci_send_command()
319 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
322 dma_unmap_sg(mmc_dev(priv->mmc), req->data->sg, in wmt_complete_data_request()
327 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
329 wmt_mci_read_response(priv->mmc); in wmt_complete_data_request()
332 mmc_request_done(priv->mmc, req); in wmt_complete_data_request()
342 wmt_mci_send_command(priv->mmc, req->data->stop->opcode, in wmt_complete_data_request()
404 mmc_detect_change(priv->mmc, 0); in wmt_mci_regular_isr()
433 wmt_mci_read_response(priv->mmc); in wmt_mci_regular_isr()
437 mmc_request_done(priv->mmc, priv->req); in wmt_mci_regular_isr()
478 static void wmt_reset_hardware(struct mmc_host *mmc) in wmt_reset_hardware() argument
483 priv = mmc_priv(mmc); in wmt_reset_hardware()
517 static int wmt_dma_init(struct mmc_host *mmc) in wmt_dma_init() argument
521 priv = mmc_priv(mmc); in wmt_dma_init()
541 static void wmt_dma_config(struct mmc_host *mmc, u32 descaddr, u8 dir) in wmt_dma_config() argument
546 priv = mmc_priv(mmc); in wmt_dma_config()
575 static void wmt_mci_request(struct mmc_host *mmc, struct mmc_request *req) in wmt_mci_request() argument
592 priv = mmc_priv(mmc); in wmt_mci_request()
615 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
623 wmt_dma_init(mmc); in wmt_mci_request()
636 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
642 sg_cnt = dma_map_sg(mmc_dev(mmc), req->data->sg, in wmt_mci_request()
670 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
673 wmt_dma_config(mmc, priv->dma_desc_device_addr, in wmt_mci_request()
676 wmt_mci_send_command(mmc, command, cmdtype, arg, rsptype); in wmt_mci_request()
686 static void wmt_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in wmt_mci_set_ios() argument
691 priv = mmc_priv(mmc); in wmt_mci_set_ios()
694 wmt_reset_hardware(mmc); in wmt_mci_set_ios()
728 static int wmt_mci_get_ro(struct mmc_host *mmc) in wmt_mci_get_ro() argument
730 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_ro()
735 static int wmt_mci_get_cd(struct mmc_host *mmc) in wmt_mci_get_cd() argument
737 struct wmt_mci_priv *priv = mmc_priv(mmc); in wmt_mci_get_cd()
769 struct mmc_host *mmc; in wmt_mci_probe() local
797 mmc = mmc_alloc_host(sizeof(struct wmt_mci_priv), &pdev->dev); in wmt_mci_probe()
798 if (!mmc) { in wmt_mci_probe()
804 mmc->ops = &wmt_mci_ops; in wmt_mci_probe()
805 mmc->f_min = wmt_caps->f_min; in wmt_mci_probe()
806 mmc->f_max = wmt_caps->f_max; in wmt_mci_probe()
807 mmc->ocr_avail = wmt_caps->ocr_avail; in wmt_mci_probe()
808 mmc->caps = wmt_caps->caps; in wmt_mci_probe()
810 mmc->max_seg_size = wmt_caps->max_seg_size; in wmt_mci_probe()
811 mmc->max_segs = wmt_caps->max_segs; in wmt_mci_probe()
812 mmc->max_blk_size = wmt_caps->max_blk_size; in wmt_mci_probe()
814 mmc->max_req_size = (16*512*mmc->max_segs); in wmt_mci_probe()
815 mmc->max_blk_count = mmc->max_req_size / 512; in wmt_mci_probe()
817 priv = mmc_priv(mmc); in wmt_mci_probe()
818 priv->mmc = mmc; in wmt_mci_probe()
853 mmc->max_blk_count * 16, in wmt_mci_probe()
862 platform_set_drvdata(pdev, mmc); in wmt_mci_probe()
874 wmt_reset_hardware(mmc); in wmt_mci_probe()
876 mmc_add_host(mmc); in wmt_mci_probe()
888 mmc_free_host(mmc); in wmt_mci_probe()
895 struct mmc_host *mmc; in wmt_mci_remove() local
900 mmc = platform_get_drvdata(pdev); in wmt_mci_remove()
901 priv = mmc_priv(mmc); in wmt_mci_remove()
912 dma_free_coherent(&pdev->dev, priv->mmc->max_blk_count * 16, in wmt_mci_remove()
915 mmc_remove_host(mmc); in wmt_mci_remove()
928 mmc_free_host(mmc); in wmt_mci_remove()
942 struct mmc_host *mmc = platform_get_drvdata(pdev); in wmt_mci_suspend() local
946 if (!mmc) in wmt_mci_suspend()
949 priv = mmc_priv(mmc); in wmt_mci_suspend()
950 ret = mmc_suspend_host(mmc); in wmt_mci_suspend()
972 struct mmc_host *mmc = platform_get_drvdata(pdev); in wmt_mci_resume() local
976 if (mmc) { in wmt_mci_resume()
977 priv = mmc_priv(mmc); in wmt_mci_resume()
992 ret = mmc_resume_host(mmc); in wmt_mci_resume()