| 548 | } |
| 549 | |
| 550 | static rt_err_t rthw_sdctrl_create(ft_sdctrl_class_t *class_p) |
| 551 | { |
| 552 | struct rt_mmcsd_host *host; |
| 553 | |
| 554 | host = mmcsd_alloc_host(); |
| 555 | if (host == RT_NULL) |
| 556 | { |
| 557 | LOG_E("L:%d F:%s mmcsd alloc host fail"); |
| 558 | return -RT_ENOMEM; |
| 559 | } |
| 560 | |
| 561 | class_p->ft_sdctrl.config = *(FSdCtrl_Config_t *)FSdCtrl_LookupConfig(0); |
| 562 | rt_event_init(&class_p->event, "sdctrl", RT_IPC_FLAG_FIFO); |
| 563 | rt_mutex_init(&class_p->mutex, "sdctrl", RT_IPC_FLAG_PRIO); |
| 564 | |
| 565 | class_p->host = host; |
| 566 | host->ops = &ops; |
| 567 | /* range of sd work speed */ |
| 568 | host->freq_min = 400 * 1000; |
| 569 | host->freq_max = 48 * 1000000; |
| 570 | host->valid_ocr = 0X00FFFF80; /* The voltage range supported is 1.65v-3.6v */ |
| 571 | host->flags = MMCSD_BUSWIDTH_4; |
| 572 | host->private_data = class_p; |
| 573 | /* ready to change */ |
| 574 | |
| 575 | return RT_EOK; |
| 576 | } |
| 577 | |
| 578 | int rthw_sdctrl_init(void) |
| 579 | { |
no test coverage detected