Commit 500156a0 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/rmk/linux-2.6-mmc

* master.kernel.org:/home/rmk/linux-2.6-mmc:
  [MMC] Pass -DDEBUG on compiler command line if MMC_DEBUG selected
  [MMC] Add OMAP MMC host driver
parents 5b67e8dd c6563178
...@@ -60,6 +60,17 @@ config MMC_SDHCI ...@@ -60,6 +60,17 @@ config MMC_SDHCI
If unsure, say N. If unsure, say N.
config MMC_OMAP
tristate "TI OMAP Multimedia Card Interface support"
depends on ARCH_OMAP && MMC
select TPS65010 if MACH_OMAP_H2
help
This selects the TI OMAP Multimedia card Interface.
If you have an OMAP board with a Multimedia Card slot,
say Y or M here.
If unsure, say N.
config MMC_WBSD config MMC_WBSD
tristate "Winbond W83L51xD SD/MMC Card Interface support" tristate "Winbond W83L51xD SD/MMC Card Interface support"
depends on MMC && ISA_DMA_API depends on MMC && ISA_DMA_API
......
...@@ -20,5 +20,10 @@ obj-$(CONFIG_MMC_PXA) += pxamci.o ...@@ -20,5 +20,10 @@ obj-$(CONFIG_MMC_PXA) += pxamci.o
obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o
obj-$(CONFIG_MMC_WBSD) += wbsd.o obj-$(CONFIG_MMC_WBSD) += wbsd.o
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
obj-$(CONFIG_MMC_OMAP) += omap.o
mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o
ifeq ($(CONFIG_MMC_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
...@@ -56,12 +56,11 @@ ...@@ -56,12 +56,11 @@
#define DRIVER_NAME "au1xxx-mmc" #define DRIVER_NAME "au1xxx-mmc"
/* Set this to enable special debugging macros */ /* Set this to enable special debugging macros */
/* #define MMC_DEBUG */
#ifdef MMC_DEBUG #ifdef DEBUG
#define DEBUG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args) #define DBG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
#else #else
#define DEBUG(fmt, idx, args...) #define DBG(fmt, idx, args...)
#endif #endif
const struct { const struct {
...@@ -424,18 +423,18 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host) ...@@ -424,18 +423,18 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host)
break; break;
if (status & SD_STATUS_RC) { if (status & SD_STATUS_RC) {
DEBUG("RX CRC Error [%d + %d].\n", host->id, DBG("RX CRC Error [%d + %d].\n", host->id,
host->pio.len, count); host->pio.len, count);
break; break;
} }
if (status & SD_STATUS_RO) { if (status & SD_STATUS_RO) {
DEBUG("RX Overrun [%d + %d]\n", host->id, DBG("RX Overrun [%d + %d]\n", host->id,
host->pio.len, count); host->pio.len, count);
break; break;
} }
else if (status & SD_STATUS_RU) { else if (status & SD_STATUS_RU) {
DEBUG("RX Underrun [%d + %d]\n", host->id, DBG("RX Underrun [%d + %d]\n", host->id,
host->pio.len, count); host->pio.len, count);
break; break;
} }
...@@ -721,7 +720,7 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) ...@@ -721,7 +720,7 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
{ {
struct au1xmmc_host *host = mmc_priv(mmc); struct au1xmmc_host *host = mmc_priv(mmc);
DEBUG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n", DBG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
host->id, ios->power_mode, ios->clock, ios->vdd, host->id, ios->power_mode, ios->clock, ios->vdd,
ios->bus_mode); ios->bus_mode);
...@@ -810,7 +809,7 @@ static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -810,7 +809,7 @@ static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs)
au1xmmc_receive_pio(host); au1xmmc_receive_pio(host);
} }
else if (status & 0x203FBC70) { else if (status & 0x203FBC70) {
DEBUG("Unhandled status %8.8x\n", host->id, status); DBG("Unhandled status %8.8x\n", host->id, status);
handled = 0; handled = 0;
} }
...@@ -839,7 +838,7 @@ static void au1xmmc_poll_event(unsigned long arg) ...@@ -839,7 +838,7 @@ static void au1xmmc_poll_event(unsigned long arg)
if (host->mrq != NULL) { if (host->mrq != NULL) {
u32 status = au_readl(HOST_STATUS(host)); u32 status = au_readl(HOST_STATUS(host));
DEBUG("PENDING - %8.8x\n", host->id, status); DBG("PENDING - %8.8x\n", host->id, status);
} }
mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT); mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT);
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
#include "mmc.h" #include "mmc.h"
#ifdef CONFIG_MMC_DEBUG
#define DBG(x...) printk(KERN_DEBUG x)
#else
#define DBG(x...) do { } while (0)
#endif
#define CMD_RETRIES 3 #define CMD_RETRIES 3
/* /*
...@@ -77,8 +71,9 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) ...@@ -77,8 +71,9 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
{ {
struct mmc_command *cmd = mrq->cmd; struct mmc_command *cmd = mrq->cmd;
int err = mrq->cmd->error; int err = mrq->cmd->error;
DBG("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", cmd->opcode, pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n",
err, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]); cmd->opcode, err, cmd->resp[0], cmd->resp[1],
cmd->resp[2], cmd->resp[3]);
if (err && cmd->retries) { if (err && cmd->retries) {
cmd->retries--; cmd->retries--;
...@@ -102,7 +97,7 @@ EXPORT_SYMBOL(mmc_request_done); ...@@ -102,7 +97,7 @@ EXPORT_SYMBOL(mmc_request_done);
void void
mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{ {
DBG("MMC: starting cmd %02x arg %08x flags %08x\n", pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n",
mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags); mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
WARN_ON(host->card_busy == NULL); WARN_ON(host->card_busy == NULL);
...@@ -976,7 +971,7 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host) ...@@ -976,7 +971,7 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host)
if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr) if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr)
max_dtr = card->csd.max_dtr; max_dtr = card->csd.max_dtr;
DBG("MMC: selected %d.%03dMHz transfer rate\n", pr_debug("MMC: selected %d.%03dMHz transfer rate\n",
max_dtr / 1000000, (max_dtr / 1000) % 1000); max_dtr / 1000000, (max_dtr / 1000) % 1000);
return max_dtr; return max_dtr;
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#define DRIVER_NAME "mmci-pl18x" #define DRIVER_NAME "mmci-pl18x"
#ifdef CONFIG_MMC_DEBUG
#define DBG(host,fmt,args...) \ #define DBG(host,fmt,args...) \
pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args) pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
#else
#define DBG(host,fmt,args...) do { } while (0)
#endif
static unsigned int fmax = 515633; static unsigned int fmax = 515633;
......
This diff is collapsed.
#ifndef DRIVERS_MEDIA_MMC_OMAP_H
#define DRIVERS_MEDIA_MMC_OMAP_H
#define OMAP_MMC_REG_CMD 0x00
#define OMAP_MMC_REG_ARGL 0x04
#define OMAP_MMC_REG_ARGH 0x08
#define OMAP_MMC_REG_CON 0x0c
#define OMAP_MMC_REG_STAT 0x10
#define OMAP_MMC_REG_IE 0x14
#define OMAP_MMC_REG_CTO 0x18
#define OMAP_MMC_REG_DTO 0x1c
#define OMAP_MMC_REG_DATA 0x20
#define OMAP_MMC_REG_BLEN 0x24
#define OMAP_MMC_REG_NBLK 0x28
#define OMAP_MMC_REG_BUF 0x2c
#define OMAP_MMC_REG_SDIO 0x34
#define OMAP_MMC_REG_REV 0x3c
#define OMAP_MMC_REG_RSP0 0x40
#define OMAP_MMC_REG_RSP1 0x44
#define OMAP_MMC_REG_RSP2 0x48
#define OMAP_MMC_REG_RSP3 0x4c
#define OMAP_MMC_REG_RSP4 0x50
#define OMAP_MMC_REG_RSP5 0x54
#define OMAP_MMC_REG_RSP6 0x58
#define OMAP_MMC_REG_RSP7 0x5c
#define OMAP_MMC_REG_IOSR 0x60
#define OMAP_MMC_REG_SYSC 0x64
#define OMAP_MMC_REG_SYSS 0x68
#define OMAP_MMC_STAT_CARD_ERR (1 << 14)
#define OMAP_MMC_STAT_CARD_IRQ (1 << 13)
#define OMAP_MMC_STAT_OCR_BUSY (1 << 12)
#define OMAP_MMC_STAT_A_EMPTY (1 << 11)
#define OMAP_MMC_STAT_A_FULL (1 << 10)
#define OMAP_MMC_STAT_CMD_CRC (1 << 8)
#define OMAP_MMC_STAT_CMD_TOUT (1 << 7)
#define OMAP_MMC_STAT_DATA_CRC (1 << 6)
#define OMAP_MMC_STAT_DATA_TOUT (1 << 5)
#define OMAP_MMC_STAT_END_BUSY (1 << 4)
#define OMAP_MMC_STAT_END_OF_DATA (1 << 3)
#define OMAP_MMC_STAT_CARD_BUSY (1 << 2)
#define OMAP_MMC_STAT_END_OF_CMD (1 << 0)
#define OMAP_MMC_READ(base, reg) __raw_readw((base) + OMAP_MMC_REG_##reg)
#define OMAP_MMC_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MMC_REG_##reg)
/*
* Command types
*/
#define OMAP_MMC_CMDTYPE_BC 0
#define OMAP_MMC_CMDTYPE_BCR 1
#define OMAP_MMC_CMDTYPE_AC 2
#define OMAP_MMC_CMDTYPE_ADTC 3
#endif
...@@ -37,12 +37,6 @@ ...@@ -37,12 +37,6 @@
#include "pxamci.h" #include "pxamci.h"
#ifdef CONFIG_MMC_DEBUG
#define DBG(x...) printk(KERN_DEBUG x)
#else
#define DBG(x...) do { } while (0)
#endif
#define DRIVER_NAME "pxa2xx-mci" #define DRIVER_NAME "pxa2xx-mci"
#define NR_SG 1 #define NR_SG 1
...@@ -206,7 +200,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, ...@@ -206,7 +200,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd,
static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq) static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq)
{ {
DBG("PXAMCI: request done\n"); pr_debug("PXAMCI: request done\n");
host->mrq = NULL; host->mrq = NULL;
host->cmd = NULL; host->cmd = NULL;
host->data = NULL; host->data = NULL;
...@@ -252,7 +246,7 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat) ...@@ -252,7 +246,7 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
if ((cmd->resp[0] & 0x80000000) == 0) if ((cmd->resp[0] & 0x80000000) == 0)
cmd->error = MMC_ERR_BADCRC; cmd->error = MMC_ERR_BADCRC;
} else { } else {
DBG("ignoring CRC from command %d - *risky*\n",cmd->opcode); pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode);
} }
#else #else
cmd->error = MMC_ERR_BADCRC; cmd->error = MMC_ERR_BADCRC;
...@@ -317,12 +311,12 @@ static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs) ...@@ -317,12 +311,12 @@ static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs)
ireg = readl(host->base + MMC_I_REG); ireg = readl(host->base + MMC_I_REG);
DBG("PXAMCI: irq %08x\n", ireg); pr_debug("PXAMCI: irq %08x\n", ireg);
if (ireg) { if (ireg) {
unsigned stat = readl(host->base + MMC_STAT); unsigned stat = readl(host->base + MMC_STAT);
DBG("PXAMCI: stat %08x\n", stat); pr_debug("PXAMCI: stat %08x\n", stat);
if (ireg & END_CMD_RES) if (ireg & END_CMD_RES)
handled |= pxamci_cmd_done(host, stat); handled |= pxamci_cmd_done(host, stat);
...@@ -376,7 +370,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -376,7 +370,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{ {
struct pxamci_host *host = mmc_priv(mmc); struct pxamci_host *host = mmc_priv(mmc);
DBG("pxamci_set_ios: clock %u power %u vdd %u.%02u\n", pr_debug("pxamci_set_ios: clock %u power %u vdd %u.%02u\n",
ios->clock, ios->power_mode, ios->vdd / 100, ios->clock, ios->power_mode, ios->vdd / 100,
ios->vdd % 100); ios->vdd % 100);
...@@ -405,7 +399,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -405,7 +399,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->cmdat |= CMDAT_INIT; host->cmdat |= CMDAT_INIT;
} }
DBG("pxamci_set_ios: clkrt = %x cmdat = %x\n", pr_debug("pxamci_set_ios: clkrt = %x cmdat = %x\n",
host->clkrt, host->cmdat); host->clkrt, host->cmdat);
} }
......
...@@ -31,12 +31,8 @@ ...@@ -31,12 +31,8 @@
#define BUGMAIL "<sdhci-devel@list.drzeus.cx>" #define BUGMAIL "<sdhci-devel@list.drzeus.cx>"
#ifdef CONFIG_MMC_DEBUG
#define DBG(f, x...) \ #define DBG(f, x...) \
printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__,## x) pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
#else
#define DBG(f, x...) do { } while (0)
#endif
static const struct pci_device_id pci_ids[] __devinitdata = { static const struct pci_device_id pci_ids[] __devinitdata = {
/* handle any SD host controller */ /* handle any SD host controller */
......
...@@ -44,15 +44,10 @@ ...@@ -44,15 +44,10 @@
#define DRIVER_NAME "wbsd" #define DRIVER_NAME "wbsd"
#define DRIVER_VERSION "1.5" #define DRIVER_VERSION "1.5"
#ifdef CONFIG_MMC_DEBUG
#define DBG(x...) \ #define DBG(x...) \
printk(KERN_DEBUG DRIVER_NAME ": " x) pr_debug(DRIVER_NAME ": " x)
#define DBGF(f, x...) \ #define DBGF(f, x...) \
printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__ , ##x) pr_debug(DRIVER_NAME " [%s()]: " f, __func__ , ##x)
#else
#define DBG(x...) do { } while (0)
#define DBGF(x...) do { } while (0)
#endif
/* /*
* Device resources * Device resources
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment