platform/msm_shared/mmc.c
static unsigned int
mmc_boot_set_read_timeout(struct mmc_boot_host *host,
			  struct mmc_boot_card *card)
{
	unsigned int timeout_ns = 0;

	if ((host == NULL) || (card == NULL)) {
		return MMC_BOOT_E_INVAL;
	}

	if ((card->type == MMC_BOOT_TYPE_MMCHC)
	    || (card->type == MMC_BOOT_TYPE_SDHC)) {
		card->rd_timeout_ns = 100000000;
	} else if ((card->type == MMC_BOOT_TYPE_STD_SD)
		   || (card->type == MMC_BOOT_TYPE_STD_MMC)) {
		timeout_ns = 10 * ((card->csd.taac_ns) +
				   (card->csd.nsac_clk_cycle /
				    (host->mclk_rate / 1000000000)));
		card->rd_timeout_ns = timeout_ns;
	} else {
		return MMC_BOOT_E_NOT_SUPPORTED;
	}

	dprintf(SPEW, " Read timeout set: %d ns\n", card->rd_timeout_ns);

	return MMC_BOOT_E_SUCCESS;
}
/* Sets a timeout for read operation.
 */
Sets a timeout for read operation.
Sets a timeout for read operation .
static unsigned int
mmc_boot_set_read_timeout(struct mmc_boot_host *host,
			  struct mmc_boot_card *card)
{
	unsigned int timeout_ns = 0;
	if ((host == NULL) || (card == NULL)) {
		return MMC_BOOT_E_INVAL;
	}
	if ((card->type == MMC_BOOT_TYPE_MMCHC)
	    || (card->type == MMC_BOOT_TYPE_SDHC)) {
		card->rd_timeout_ns = 100000000;
	} else if ((card->type == MMC_BOOT_TYPE_STD_SD)
		   || (card->type == MMC_BOOT_TYPE_STD_MMC)) {
		timeout_ns = 10 * ((card->csd.taac_ns) +
				   (card->csd.nsac_clk_cycle /
				    (host->mclk_rate / 1000000000)));
		card->rd_timeout_ns = timeout_ns;
	} else {
		return MMC_BOOT_E_NOT_SUPPORTED;
	}
	dprintf(SPEW, " Read timeout set: %d ns\n", card->rd_timeout_ns);
	return MMC_BOOT_E_SUCCESS;
}
static unsigned int mmc_boot_set_read_timeout ( struct mmc_boot_host * host , struct mmc_boot_card * card ) { unsigned int timeout_ns = 0 ; if ( ( host == NULL ) || ( card == NULL ) ) { return MMC_BOOT_E_INVAL ; } if ( ( card -> type == MMC_BOOT_TYPE_MMCHC ) || ( card -> type == MMC_BOOT_TYPE_SDHC ) ) { card -> rd_timeout_ns = 100000000 ; } else if ( ( card -> type == MMC_BOOT_TYPE_STD_SD ) || ( card -> type == MMC_BOOT_TYPE_STD_MMC ) ) { timeout_ns = 10 * ( ( card -> csd . taac_ns ) + ( card -> csd . nsac_clk_cycle / ( host -> mclk_rate / 1000000000 ) ) ) ; card -> rd_timeout_ns = timeout_ns ; } else { return MMC_BOOT_E_NOT_SUPPORTED ; } dprintf ( SPEW , " \n " , card -> rd_timeout_ns ) ; return MMC_BOOT_E_SUCCESS ; }
Sets a timeout for read operation.
Sets a timeout for read operation .