| 741 | } |
| 742 | |
| 743 | static rt_int32_t sdio_set_highspeed(struct rt_mmcsd_card *card) |
| 744 | { |
| 745 | rt_int32_t ret; |
| 746 | rt_uint8_t speed; |
| 747 | |
| 748 | if (!(card->host->flags & MMCSD_SUP_HIGHSPEED)) |
| 749 | return 0; |
| 750 | |
| 751 | if (!card->cccr.high_speed) |
| 752 | return 0; |
| 753 | |
| 754 | speed = sdio_io_readb(card->sdio_function[0], SDIO_REG_CCCR_SPEED, &ret); |
| 755 | if (ret) |
| 756 | return ret; |
| 757 | |
| 758 | speed |= SDIO_SPEED_EHS; |
| 759 | |
| 760 | ret = sdio_io_writeb(card->sdio_function[0], SDIO_REG_CCCR_SPEED, speed); |
| 761 | if (ret) |
| 762 | return ret; |
| 763 | |
| 764 | card->flags |= CARD_FLAG_HIGHSPEED; |
| 765 | |
| 766 | return 0; |
| 767 | } |
| 768 | |
| 769 | static rt_int32_t sdio_set_bus_wide(struct rt_mmcsd_card *card) |
| 770 | { |
no test coverage detected