platform/msm_shared/mmc.c
static unsigned int
mmc_boot_select_card(struct mmc_boot_card *card, unsigned int rca)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_arg = 0;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;

	/* basic check */
	if (card == NULL) {
		return MMC_BOOT_E_INVAL;
	}

	memset((struct mmc_boot_command *)&cmd, 0,
	       sizeof(struct mmc_boot_command));

	/* CMD7 Format:
	 * [31:16] RCA
	 * [15:0] stuff bits
	 */
	mmc_arg |= rca << 16;

	cmd.cmd_index = CMD7_SELECT_DESELECT_CARD;
	cmd.argument = mmc_arg;
	cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
	/* If we are deselecting card, we do not get response */
	if (rca == card->rca && rca) {
		if (card->type == MMC_BOOT_TYPE_SDHC
		    || card->type == MMC_BOOT_TYPE_STD_SD)
			cmd.resp_type = MMC_BOOT_RESP_R1B;
		else
			cmd.resp_type = MMC_BOOT_RESP_R1;
	} else {
		cmd.resp_type = MMC_BOOT_RESP_NONE;
	}

	/* send command */
	mmc_ret = mmc_boot_send_command(&cmd);
	if (mmc_ret != MMC_BOOT_E_SUCCESS) {
		return mmc_ret;
	}

	/* As of now no need to look into a response. If it's required
	 * we'll explore later on */

	return MMC_BOOT_E_SUCCESS;
}
/*
 * Selects a card by sending CMD7 to the card with its RCA.
 * If RCA field is set as 0 ( or any other address ),
 * the card will be de-selected. (CMD7)
 */
Selects a card by sending CMD7 to the card with its RCA.
If RCA field is set as 0 ( or any other address ),
the card will be de-selected.
Selects a card by sending CMD7 to the card with its RCA . If RCA field is set as 0 ( or any other address ) the card will be de - selected .
static unsigned int
mmc_boot_select_card(struct mmc_boot_card *card, unsigned int rca)
{
	struct mmc_boot_command cmd;
	unsigned int mmc_arg = 0;
	unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
	if (card == NULL) {
		return MMC_BOOT_E_INVAL;
	}
	memset((struct mmc_boot_command *)&cmd, 0,
	       sizeof(struct mmc_boot_command));
	mmc_arg |= rca << 16;
	cmd.cmd_index = CMD7_SELECT_DESELECT_CARD;
	cmd.argument = mmc_arg;
	cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
	if (rca == card->rca && rca) {
		if (card->type == MMC_BOOT_TYPE_SDHC
		    || card->type == MMC_BOOT_TYPE_STD_SD)
			cmd.resp_type = MMC_BOOT_RESP_R1B;
		else
			cmd.resp_type = MMC_BOOT_RESP_R1;
	} else {
		cmd.resp_type = MMC_BOOT_RESP_NONE;
	}
	mmc_ret = mmc_boot_send_command(&cmd);
	if (mmc_ret != MMC_BOOT_E_SUCCESS) {
		return mmc_ret;
	}
	return MMC_BOOT_E_SUCCESS;
}
static unsigned int mmc_boot_select_card ( struct mmc_boot_card * card , unsigned int rca ) { struct mmc_boot_command cmd ; unsigned int mmc_arg = 0 ; unsigned int mmc_ret = MMC_BOOT_E_SUCCESS ; if ( card == NULL ) { return MMC_BOOT_E_INVAL ; } memset ( ( struct mmc_boot_command * ) & cmd , 0 , sizeof ( struct mmc_boot_command ) ) ; mmc_arg |= rca << 16 ; cmd . cmd_index = CMD7_SELECT_DESELECT_CARD ; cmd . argument = mmc_arg ; cmd . cmd_type = MMC_BOOT_CMD_ADDRESS ; if ( rca == card -> rca && rca ) { if ( card -> type == MMC_BOOT_TYPE_SDHC || card -> type == MMC_BOOT_TYPE_STD_SD ) cmd . resp_type = MMC_BOOT_RESP_R1B ; else cmd . resp_type = MMC_BOOT_RESP_R1 ; } else { cmd . resp_type = MMC_BOOT_RESP_NONE ; } mmc_ret = mmc_boot_send_command ( & cmd ) ; if ( mmc_ret != MMC_BOOT_E_SUCCESS ) { return mmc_ret ; } return MMC_BOOT_E_SUCCESS ; }
Selects a card by sending CMD7 to the card with its RCA.
Selects a card by sending CMD7 to the card with its RCA .
/* basic check */ /* CMD7 Format:
	 * [31:16] RCA
	 * [15:0] stuff bits
	 */ /* If we are deselecting card, we do not get response */ /* send command */ /* As of now no need to look into a response. If it's required
	 * we'll explore later on */