]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/host/omap.c
Merge omap-upstream
[linux-2.6-omap-h63xx.git] / drivers / mmc / host / omap.c
index 1914e65d4db120202389bfbb5761784e4782ab1c..816abf410c488f1e593caf9c3b2ee37381b07ed5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/media/mmc/omap.c
+ *  linux/drivers/mmc/host/omap.c
  *
  *  Copyright (C) 2004 Nokia Corporation
  *  Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@nokia.com>
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/timer.h>
+#include <linux/mmc/mmc.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
 #include <linux/clk.h>
@@ -36,6 +37,7 @@
 #include <asm/arch/mux.h>
 #include <asm/arch/fpga.h>
 #include <asm/arch/tps65010.h>
+#include <asm/arch/board-sx1.h>
 
 #define        OMAP_MMC_REG_CMD        0x00
 #define        OMAP_MMC_REG_ARGL       0x04
@@ -522,28 +524,10 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                }
 
                if (status & OMAP_MMC_STAT_CARD_ERR) {
-                       if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) {
-                               u32 response = OMAP_MMC_READ(host, RSP6)
-                                       | (OMAP_MMC_READ(host, RSP7) << 16);
-                               /* STOP sometimes sets must-ignore bits */
-                               if (!(response & (R1_CC_ERROR
-                                                               | R1_ILLEGAL_COMMAND
-                                                               | R1_COM_CRC_ERROR))) {
-                                       end_command = 1;
-                                       continue;
-                               }
-                       }
-
-                       dev_dbg(mmc_dev(host->mmc), "card status error (CMD%d)\n",
+                       dev_dbg(mmc_dev(host->mmc),
+                               "ignoring card status error (CMD%d)\n",
                                host->cmd->opcode);
-                       if (host->cmd) {
-                               host->cmd->error = MMC_ERR_FAILED;
-                               end_command = 1;
-                       }
-                       if (host->data) {
-                               host->data->error = MMC_ERR_FAILED;
-                               transfer_error = 1;
-                       }
+                       end_command = 1;
                }
 
                /*
@@ -586,9 +570,8 @@ static void mmc_omap_switch_timer(unsigned long arg)
 static void mmc_omap_switch_handler(struct work_struct *work)
 {
        struct mmc_omap_host *host = container_of(work, struct mmc_omap_host, switch_work);
-       struct mmc_card *card;
        static int complained = 0;
-       int cards = 0, cover_open;
+       int cover_open;
 
        if (host->switch_pin == -1)
                return;
@@ -598,10 +581,6 @@ static void mmc_omap_switch_handler(struct work_struct *work)
                host->switch_last_state = cover_open;
        }
        mmc_detect_change(host->mmc, 0);
-       list_for_each_entry(card, &host->mmc->cards, node) {
-               if (mmc_card_present(card))
-                       cards++;
-       }
        if (mmc_omap_cover_is_open(host)) {
                if (!complained) {
                        dev_info(mmc_dev(host->mmc), "cover is open\n");
@@ -906,7 +885,9 @@ static void innovator_fpga_socket_power(int on)
  */
 static void mmc_omap_power(struct mmc_omap_host *host, int on)
 {
-       if (on) {
+       if (machine_is_sx1())
+               sx1_setmmcpower(on);
+       else if (on) {
                if (machine_is_omap_innovator())
                        innovator_fpga_socket_power(1);
                else if (machine_is_omap_h2())