summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-02-29 16:25:48 +0000
committer[email protected] <[email protected]>2012-02-29 16:25:48 +0000
commit8b68c3aaa4d5dea05d8b699fb6ff338a5cd40ee6 (patch)
tree67075cd6d4b4fe5b1042a667fbecbffaf53a702d /components
parentcc4874a8b6fd4e1a5c99f0ad4cc81284c4ecfcbc (diff)
rename some variable and add comment
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1982 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/drivers/sdio/mmcsd_card.h27
-rw-r--r--components/drivers/sdio/sdio.c8
2 files changed, 26 insertions, 9 deletions
diff --git a/components/drivers/sdio/mmcsd_card.h b/components/drivers/sdio/mmcsd_card.h
index 6d6de634cd..083f335139 100644
--- a/components/drivers/sdio/mmcsd_card.h
+++ b/components/drivers/sdio/mmcsd_card.h
@@ -65,12 +65,27 @@ struct rt_sd_scr {
struct rt_sdio_cccr {
rt_uint8_t sdio_version;
rt_uint8_t sd_version;
- rt_uint8_t multi_block:1,
- low_speed:1,
- wide_bus:1,
- high_power:1,
- high_speed:1,
- disable_cd:1;
+ rt_uint8_t direct_cmd:1, /* Card Supports Direct Commands during data transfer
+ only SD mode, not used for SPI mode */
+ multi_block:1, /* Card Supports Multi-Block */
+ read_wait:1, /* Card Supports Read Wait
+ only SD mode, not used for SPI mode */
+ suspend_resume:1, /* Card supports Suspend/Resume
+ only SD mode, not used for SPI mode */
+ s4mi:1, /* generate interrupts during a 4-bit
+ multi-block data transfer */
+ e4mi:1, /* Enable the multi-block IRQ during
+ 4-bit transfer for the SDIO card */
+ low_speed:1, /* Card is a Low-Speed card */
+ low_speed_4:1; /* 4-bit support for Low-Speed cards */
+
+ rt_uint8_t bus_width:1, /* Support SDIO bus width, 1:4bit, 0:1bit */
+ cd_disable:1, /* Connect[0]/Disconnect[1] the 10K-90K ohm pull-up
+ resistor on CD/DAT[3] (pin 1) of the card */
+ power_ctrl:1, /* Support Master Power Control */
+ high_speed:1; /* Support High-Speed */
+
+
};
struct rt_sdio_cis {
diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c
index b72c2fdb1d..88d19d054b 100644
--- a/components/drivers/sdio/sdio.c
+++ b/components/drivers/sdio/sdio.c
@@ -397,7 +397,9 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card)
if (data & SDIO_CCCR_CAP_LSC)
card->cccr.low_speed = 1;
if (data & SDIO_CCCR_CAP_4BLS)
- card->cccr.wide_bus = 1;
+ card->cccr.low_speed_4 = 1;
+ if (data & SDIO_CCCR_CAP_4BLS)
+ card->cccr.bus_width = 1;
if (cccr_version >= SDIO_CCCR_REV_1_10)
{
@@ -406,7 +408,7 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card)
goto out;
if (data & SDIO_POWER_SMPC)
- card->cccr.high_power = 1;
+ card->cccr.power_ctrl = 1;
}
if (cccr_version >= SDIO_CCCR_REV_1_20)
@@ -707,7 +709,7 @@ static rt_int32_t sdio_set_bus_wide(struct rt_mmcsd_card *card)
if (!(card->host->flags & MMCSD_BUSWIDTH_4))
return 0;
- if (card->cccr.low_speed && !card->cccr.wide_bus)
+ if (card->cccr.low_speed && !card->cccr.bus_width)
return 0;
busif = sdio_io_readb(card->sdio_func0, SDIO_REG_CCCR_BUS_IF, &ret);