update sdio driver

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1981 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
luohui2320@gmail.com 2012-02-29 15:41:58 +00:00
parent 79a699b7bf
commit cc4874a8b6
2 changed files with 45 additions and 4 deletions

View File

@ -317,19 +317,54 @@ rt_int32_t sdio_io_writew(struct rt_sdio_function *func, rt_uint16_t data, rt_ui
return sdio_io_rw_extended_block(func, 1, addr, 1, (rt_uint8_t *)&dmabuf, 2); return sdio_io_rw_extended_block(func, 1, addr, 1, (rt_uint8_t *)&dmabuf, 2);
} }
rt_int32_t sdio_io_read_multi_fifo_1(struct rt_sdio_function *func, rt_uint32_t sdio_io_readl(struct rt_sdio_function *func, rt_uint32_t addr, rt_int32_t *err)
{
rt_int32_t ret;
rt_uint32_t dmabuf;
if (err)
*err = 0;
ret = sdio_io_rw_extended_block(func, 0, addr, 1, (rt_uint8_t *)&dmabuf, 4);
if (ret)
{
if (err)
*err = ret;
}
return dmabuf;
}
rt_int32_t sdio_io_writel(struct rt_sdio_function *func, rt_uint32_t data, rt_uint32_t addr)
{
rt_uint32_t dmabuf = data;
return sdio_io_rw_extended_block(func, 1, addr, 1, (rt_uint8_t *)&dmabuf, 4);
}
rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len)
{ {
return sdio_io_rw_extended_block(func, 0, addr, 0, buf, len); return sdio_io_rw_extended_block(func, 0, addr, 0, buf, len);
} }
rt_int32_t sdio_io_write_multi_fifo_1(struct rt_sdio_function *func, rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len)
{ {
return sdio_io_rw_extended_block(func, 1, addr, 0, buf, len); return sdio_io_rw_extended_block(func, 1, addr, 0, buf, len);
} }
rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len)
{
return sdio_io_rw_extended_block(func, 0, addr, 1, buf, len);
}
rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len)
{
return sdio_io_rw_extended_block(func, 1, addr, 1, buf, len);
}
static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card) static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card)
{ {

View File

@ -203,9 +203,15 @@ rt_int32_t sdio_io_writeb(struct rt_sdio_function *func,
rt_uint32_t reg, rt_uint8_t data); rt_uint32_t reg, rt_uint8_t data);
rt_uint16_t sdio_io_readw(struct rt_sdio_function *func, rt_uint32_t addr, rt_int32_t *err); rt_uint16_t sdio_io_readw(struct rt_sdio_function *func, rt_uint32_t addr, rt_int32_t *err);
rt_int32_t sdio_io_writew(struct rt_sdio_function *func, rt_uint16_t data, rt_uint32_t addr); rt_int32_t sdio_io_writew(struct rt_sdio_function *func, rt_uint16_t data, rt_uint32_t addr);
rt_int32_t sdio_io_read_multi_fifo_1(struct rt_sdio_function *func, rt_uint32_t sdio_io_readl(struct rt_sdio_function *func, rt_uint32_t addr, rt_int32_t *err);
rt_int32_t sdio_io_writel(struct rt_sdio_function *func, rt_uint32_t data, rt_uint32_t addr);
rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len);
rt_int32_t sdio_io_write_multi_fifo_1(struct rt_sdio_function *func, rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len);
rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len);
rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func,
rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len);
rt_int32_t init_sdio(struct rt_mmcsd_host *host, rt_uint32_t ocr); rt_int32_t init_sdio(struct rt_mmcsd_host *host, rt_uint32_t ocr);
rt_int32_t sdio_attach_irq(struct rt_sdio_function *func, rt_sdio_irq_handler_t *handler); rt_int32_t sdio_attach_irq(struct rt_sdio_function *func, rt_sdio_irq_handler_t *handler);