Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78e480731ab89e311ecdb455d04903cafbe163ca
Commit:     78e480731ab89e311ecdb455d04903cafbe163ca
Parent:     6356a9d955e1898eadaa8cba9a5137b1787c0c7e
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 27 14:14:23 2007 +0200
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Sat Oct 27 14:14:23 2007 +0200

    mmc: fix cid and csd byte order
    
    MMC over SPI sends the CID and CSD registers as data, not responses,
    which means that the host driver won't do the necessary byte flipping
    for us.
    
    Signed-off-by: Pierre Ossman <[EMAIL PROTECTED]>
---
 drivers/mmc/core/mmc_ops.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index bf4bc6a..7471d49 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -267,15 +267,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 +294,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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to