Beispiel #1
0
int mmc_send_cid(struct mmc_host *host, u32 *cid)
{
    int ret, i;

    if (!mmc_host_is_spi(host)) {
        if (!host->card)
            return -EINVAL;
#ifdef CONFIG_ARCH_EMXX
        return mmc_send_cxd_native(host, host->card[0]->rca << 16,
                                   cid, MMC_SEND_CID);
#else
        return mmc_send_cxd_native(host, host->card->rca << 16,
                                   cid, MMC_SEND_CID);
#endif
    }

    ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16);
    if (ret)
        return ret;

    for (i = 0; i < 4; i++)
        cid[i] = be32_to_cpu(cid[i]);

    return 0;
}
int mmc_send_cid(struct mmc_host *host, u32 *cid)
{
	int ret, i;
	u32 *cid_tmp;

	if (!mmc_host_is_spi(host)) {
		if (!host->card)
			return -EINVAL;
		return mmc_send_cxd_native(host, host->card->rca << 16,
				cid, MMC_SEND_CID);
	}

	cid_tmp = kmalloc(16, GFP_KERNEL);
	if (!cid_tmp)
		return -ENOMEM;

	ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid_tmp, 16);
	if (ret)
		goto err;

	for (i = 0;i < 4;i++)
		cid[i] = be32_to_cpu(cid_tmp[i]);

err:
	kfree(cid_tmp);
	return ret;
}
int mmc_send_csd(struct mmc_card *card, u32 *csd)
{
	int ret, i;
	u32 *csd_tmp;

	if (!mmc_host_is_spi(card->host))
		return mmc_send_cxd_native(card->host, card->rca << 16,
				csd, MMC_SEND_CSD);

	csd_tmp = kmalloc(16, GFP_KERNEL);

	if (!csd_tmp)
		return -ENOMEM;

	ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd_tmp, 16);
	if (ret)
		goto err;

	for (i = 0;i < 4;i++)
		csd[i] = be32_to_cpu(csd_tmp[i]);

err:
	kfree(csd_tmp);
	return ret;
}
Beispiel #4
0
int mmc_send_cid(struct mmc_host *host, u32 *cid)
{
	int ret, i;
	DBG("[%s] s\n",__func__);
	if (!mmc_host_is_spi(host)) {
		if (!host->card) {
			DBG("[%s] e1\n",__func__);
			return -EINVAL;
		}
		ret = mmc_send_cxd_native(host, host->card->rca << 16,
				cid, MMC_SEND_CID);
		DBG("[%s] e2\n",__func__);
		return ret;
	}

	ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16);
	if (ret) {
		DBG("[%s] e3\n",__func__);
		return ret;
	}

	for (i = 0;i < 4;i++)
		cid[i] = be32_to_cpu(cid[i]);

	DBG("[%s] e3\n",__func__);
	return 0;
}
Beispiel #5
0
int mmc_send_csd(struct mmc_card *card, u32 *csd)
{
    int ret, i;

    if (!mmc_host_is_spi(card->host))
        return mmc_send_cxd_native(card->host, card->rca << 16,
                                   csd, MMC_SEND_CSD);

    ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16);
    if (ret)
        return ret;

    for (i = 0; i < 4; i++)
        csd[i] = be32_to_cpu(csd[i]);

    return 0;
}
Beispiel #6
0
int mmc_send_csd(struct mmc_card *card, u32 *csd)
{
	int ret, i;
	DBG("[%s] s\n",__func__);

	if (!mmc_host_is_spi(card->host)) {
		ret = mmc_send_cxd_native(card->host, card->rca << 16,
				csd, MMC_SEND_CSD);
		DBG("[%s] e1\n",__func__);
		return ret;
	}

	ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16);
	if (ret) {
		DBG("[%s] e2\n",__func__);
		return ret;
	}

	for (i = 0;i < 4;i++)
		csd[i] = be32_to_cpu(csd[i]);

	DBG("[%s] e3\n",__func__);
	return 0;
}