]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/core/mmc_ops.c
Merge branch 'for-linus' of git://neil.brown.name/md
[linux-2.6-omap-h63xx.git] / drivers / mmc / core / mmc_ops.c
index bf4bc6adcfef8fbed951a274ee2cc4ca12dae36f..9c50e6f1c23649d75ba0a2522f5e52b04ff4740e 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
@@ -249,8 +248,12 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
 
        sg_init_one(&sg, data_buf, len);
 
-       if (card)
-               mmc_set_data_timeout(&data, card);
+       /*
+        * The spec states that CSR and CID accesses have a timeout
+        * of 64 clock cycles.
+        */
+       data.timeout_ns = 0;
+       data.timeout_clks = 64;
 
        mmc_wait_for_req(host, &mrq);
 
@@ -267,15 +270,26 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
 
 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);
 
-       return mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16);
+       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;
 }
 
 int mmc_send_cid(struct mmc_host *host, u32 *cid)
 {
+       int ret, i;
+
        if (!mmc_host_is_spi(host)) {
                if (!host->card)
                        return -EINVAL;
@@ -283,7 +297,14 @@ int mmc_send_cid(struct mmc_host *host, u32 *cid)
                                cid, MMC_SEND_CID);
        }
 
-       return mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16);
+       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_ext_csd(struct mmc_card *card, u8 *ext_csd)