提交 f136f889 编写于 作者: R ruiqian 提交者: GitHub

Update sdio.c

上级 24185f47
...@@ -1169,6 +1169,7 @@ rt_int32_t sdio_detach_irq(struct rt_sdio_function *func) ...@@ -1169,6 +1169,7 @@ rt_int32_t sdio_detach_irq(struct rt_sdio_function *func)
void sdio_irq_wakeup(struct rt_mmcsd_host *host) void sdio_irq_wakeup(struct rt_mmcsd_host *host)
{ {
if (host->flags & MMCSD_SUP_SDIO_IRQ)
host->ops->enable_sdio_irq(host, 0); host->ops->enable_sdio_irq(host, 0);
rt_sem_release(host->sdio_irq_sem); rt_sem_release(host->sdio_irq_sem);
} }
...@@ -1197,7 +1198,7 @@ rt_int32_t sdio_enable_func(struct rt_sdio_function *func) ...@@ -1197,7 +1198,7 @@ rt_int32_t sdio_enable_func(struct rt_sdio_function *func)
if (ret) if (ret)
goto err; goto err;
timeout = rt_tick_get() + func->enable_timeout_val * 1000 / RT_TICK_PER_SECOND; timeout = rt_tick_get() + func->enable_timeout_val * RT_TICK_PER_SECOND / 1000;
while (1) while (1)
{ {
...@@ -1287,7 +1288,7 @@ rt_inline rt_int32_t sdio_match_card(struct rt_mmcsd_card *card, ...@@ -1287,7 +1288,7 @@ rt_inline rt_int32_t sdio_match_card(struct rt_mmcsd_card *card,
(id->manufacturer != card->cis.manufacturer)) (id->manufacturer != card->cis.manufacturer))
return 0; return 0;
if ((id->product != SDIO_ANY_PROD_ID) && if ((id->product != SDIO_ANY_PROD_ID) &&
(id->product != card->cis.product)) (id->product != (card->cis.product | 1)))
return 0; return 0;
return 1; return 1;
...@@ -1334,11 +1335,11 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver) ...@@ -1334,11 +1335,11 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver)
card = sdio_match_driver(driver->id); card = sdio_match_driver(driver->id);
if (card != RT_NULL) if (card != RT_NULL)
{ {
driver->probe(card); return driver->probe(card);
} }
} }
return 0; return -RT_EEMPTY;
} }
rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver) rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册