Browse Source

rename some variable and add comment

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1982 bbd45198-f89e-11dd-88c7-29a3b14d5316
luohui2320@gmail.com 13 years ago
parent
commit
8b68c3aaa4
2 changed files with 26 additions and 9 deletions
  1. 21 6
      components/drivers/sdio/mmcsd_card.h
  2. 5 3
      components/drivers/sdio/sdio.c

+ 21 - 6
components/drivers/sdio/mmcsd_card.h

@@ -65,12 +65,27 @@ struct rt_sd_scr {
 struct rt_sdio_cccr {
 struct rt_sdio_cccr {
 	rt_uint8_t		sdio_version;
 	rt_uint8_t		sdio_version;
 	rt_uint8_t		sd_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 {
 struct rt_sdio_cis {

+ 5 - 3
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)
 	if (data & SDIO_CCCR_CAP_LSC)
 		card->cccr.low_speed = 1;
 		card->cccr.low_speed = 1;
 	if (data & SDIO_CCCR_CAP_4BLS)
 	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) 
 	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;
 			goto out;
 
 
 		if (data & SDIO_POWER_SMPC)
 		if (data & SDIO_POWER_SMPC)
-			card->cccr.high_power = 1;
+			card->cccr.power_ctrl = 1;
 	}
 	}
 
 
 	if (cccr_version >= SDIO_CCCR_REV_1_20) 
 	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))
 	if (!(card->host->flags & MMCSD_BUSWIDTH_4))
 		return 0;
 		return 0;
 
 
-	if (card->cccr.low_speed && !card->cccr.wide_bus)
+	if (card->cccr.low_speed && !card->cccr.bus_width)
 		return 0;
 		return 0;
 
 
 	busif = sdio_io_readb(card->sdio_func0, SDIO_REG_CCCR_BUS_IF, &ret);
 	busif = sdio_io_readb(card->sdio_func0, SDIO_REG_CCCR_BUS_IF, &ret);