Lines Matching full:host
122 The host should not use TAAC, NSAC, and R2W_FACTOR in mmcsd_parse_csd()
161 /* host should not use this factor and should use 250ms for write timeout */ in mmcsd_parse_csd()
191 struct rt_mmcsd_host *host = card->host; in mmcsd_switch() local
230 mmcsd_send_request(host, &req); in mmcsd_switch()
260 mmcsd_send_request(host, &req); in mmcsd_switch()
288 static rt_err_t mmcsd_app_cmd(struct rt_mmcsd_host *host, in mmcsd_app_cmd() argument
307 err = mmcsd_send_cmd(host, &cmd, 0); in mmcsd_app_cmd()
312 if (!controller_is_spi(host) && !(cmd.resp[0] & R1_APP_CMD)) in mmcsd_app_cmd()
319 rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host, in mmcsd_send_app_cmd() argument
339 err = mmcsd_app_cmd(host, card); in mmcsd_send_app_cmd()
343 if (controller_is_spi(host)) in mmcsd_send_app_cmd()
358 mmcsd_send_request(host, &req); in mmcsd_send_app_cmd()
365 if (controller_is_spi(host)) in mmcsd_send_app_cmd()
397 err = mmcsd_send_app_cmd(card->host, card, &cmd, 3); in mmcsd_app_set_bus_width()
404 rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, in mmcsd_send_app_op_cond() argument
415 if (controller_is_spi(host)) in mmcsd_send_app_op_cond()
423 err = mmcsd_send_app_cmd(host, RT_NULL, &cmd, 3); in mmcsd_send_app_op_cond()
432 if (controller_is_spi(host)) in mmcsd_send_app_op_cond()
448 if (rocr && !controller_is_spi(host)) in mmcsd_send_app_op_cond()
459 rt_err_t mmcsd_send_if_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr) in mmcsd_send_if_cond() argument
469 err = mmcsd_send_cmd(host, &cmd, 0); in mmcsd_send_if_cond()
473 if (controller_is_spi(host)) in mmcsd_send_if_cond()
484 rt_err_t mmcsd_get_card_addr(struct rt_mmcsd_host *host, rt_uint32_t *rca) in mmcsd_get_card_addr() argument
495 err = mmcsd_send_cmd(host, &cmd, 3); in mmcsd_get_card_addr()
517 err = mmcsd_app_cmd(card->host, card); in mmcsd_get_scr()
539 mmcsd_send_request(card->host, &req); in mmcsd_get_scr()
553 static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, in mmcsd_sd_init_card() argument
561 mmcsd_go_idle(host); in mmcsd_sd_init_card()
569 err = mmcsd_send_if_cond(host, ocr); in mmcsd_sd_init_card()
573 err = mmcsd_send_app_op_cond(host, ocr, RT_NULL); in mmcsd_sd_init_card()
577 if (controller_is_spi(host)) in mmcsd_sd_init_card()
578 err = mmcsd_get_cid(host, resp); in mmcsd_sd_init_card()
580 err = mmcsd_all_get_cid(host, resp); in mmcsd_sd_init_card()
594 card->host = host; in mmcsd_sd_init_card()
600 if (!controller_is_spi(host)) in mmcsd_sd_init_card()
602 err = mmcsd_get_card_addr(host, &card->rca); in mmcsd_sd_init_card()
606 mmcsd_set_bus_mode(host, MMCSD_BUSMODE_PUSHPULL); in mmcsd_sd_init_card()
617 if (!controller_is_spi(host)) in mmcsd_sd_init_card()
630 if (controller_is_spi(host)) in mmcsd_sd_init_card()
632 err = mmcsd_spi_use_crc(host, 1); in mmcsd_sd_init_card()
657 mmcsd_set_clock(host, max_data_rate); in mmcsd_sd_init_card()
660 if ((host->flags & MMCSD_BUSWIDTH_4) && in mmcsd_sd_init_card()
667 mmcsd_set_bus_width(host, MMCSD_BUS_WIDTH_4); in mmcsd_sd_init_card()
670 host->card = card; in mmcsd_sd_init_card()
684 rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr) in init_sd() argument
691 if (controller_is_spi(host)) in init_sd()
693 mmcsd_go_idle(host); in init_sd()
695 err = mmcsd_spi_read_ocr(host, 0, &ocr); in init_sd()
708 current_ocr = mmcsd_select_voltage(host, ocr); in init_sd()
722 err = mmcsd_sd_init_card(host, current_ocr); in init_sd()
726 mmcsd_host_unlock(host); in init_sd()
728 err = rt_mmcsd_blk_probe(host->card); in init_sd()
731 mmcsd_host_lock(host); in init_sd()
736 mmcsd_host_lock(host); in init_sd()
737 rt_mmcsd_blk_remove(host->card); in init_sd()
738 rt_free(host->card); in init_sd()
739 host->card = RT_NULL; in init_sd()