git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
mmc
/
mmci.c
diff --git
a/drivers/mmc/mmci.c
b/drivers/mmc/mmci.c
index
9fef29d
..
ccfe656
100644
(file)
--- a/
drivers/mmc/mmci.c
+++ b/
drivers/mmc/mmci.c
@@
-7,7
+7,6
@@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
@@
-33,12
+32,8
@@
#define DRIVER_NAME "mmci-pl18x"
#define DRIVER_NAME "mmci-pl18x"
-#ifdef CONFIG_MMC_DEBUG
#define DBG(host,fmt,args...) \
pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
#define DBG(host,fmt,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;
@@
-47,6
+42,8
@@
mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
{
writel(0, host->base + MMCICOMMAND);
{
writel(0, host->base + MMCICOMMAND);
+ BUG_ON(host->data);
+
host->mrq = NULL;
host->cmd = NULL;
host->mrq = NULL;
host->cmd = NULL;
@@
-74,12
+71,13
@@
static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
unsigned int datactrl, timeout, irqmask;
unsigned long long clks;
void __iomem *base;
unsigned int datactrl, timeout, irqmask;
unsigned long long clks;
void __iomem *base;
+ int blksz_bits;
DBG(host, "blksz %04x blks %04x flags %08x\n",
DBG(host, "blksz %04x blks %04x flags %08x\n",
-
1 << data->blksz_bits
, data->blocks, data->flags);
+
data->blksz
, data->blocks, data->flags);
host->data = data;
host->data = data;
- host->size = data->bl
ocks << data->blksz_bits
;
+ host->size = data->bl
ksz
;
host->data_xfered = 0;
mmci_init_sg(host, data);
host->data_xfered = 0;
mmci_init_sg(host, data);
@@
-93,7
+91,10
@@
static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
writel(timeout, base + MMCIDATATIMER);
writel(host->size, base + MMCIDATALENGTH);
writel(timeout, base + MMCIDATATIMER);
writel(host->size, base + MMCIDATALENGTH);
- datactrl = MCI_DPSM_ENABLE | data->blksz_bits << 4;
+ blksz_bits = ffs(data->blksz) - 1;
+ BUG_ON(1 << blksz_bits != data->blksz);
+
+ datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
if (data->flags & MMC_DATA_READ) {
datactrl |= MCI_DPSM_DIRECTION;
irqmask = MCI_RXFIFOHALFFULLMASK;
if (data->flags & MMC_DATA_READ) {
datactrl |= MCI_DPSM_DIRECTION;
irqmask = MCI_RXFIFOHALFFULLMASK;
@@
-150,7
+151,7
@@
mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
unsigned int status)
{
if (status & MCI_DATABLOCKEND) {
unsigned int status)
{
if (status & MCI_DATABLOCKEND) {
- host->data_xfered +=
1 << data->blksz_bits
;
+ host->data_xfered +=
data->blksz
;
}
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
if (status & MCI_DATACRCFAIL)
}
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
if (status & MCI_DATACRCFAIL)
@@
-199,6
+200,8
@@
mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
}
if (!cmd->data || cmd->error != MMC_ERR_NONE) {
}
if (!cmd->data || cmd->error != MMC_ERR_NONE) {
+ if (host->data)
+ mmci_stop_data(host);
mmci_request_end(host, cmd->mrq);
} else if (!(cmd->data->flags & MMC_DATA_READ)) {
mmci_start_data(host, cmd->data);
mmci_request_end(host, cmd->mrq);
} else if (!(cmd->data->flags & MMC_DATA_READ)) {
mmci_start_data(host, cmd->data);
@@
-262,7
+265,7
@@
static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
/*
* PIO data transfer IRQ handler.
*/
/*
* PIO data transfer IRQ handler.
*/
-static irqreturn_t mmci_pio_irq(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t mmci_pio_irq(int irq, void *dev_id)
{
struct mmci_host *host = dev_id;
void __iomem *base = host->base;
{
struct mmci_host *host = dev_id;
void __iomem *base = host->base;
@@
-348,7
+351,7
@@
static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs)
/*
* Handle completion of command and data transfers.
*/
/*
* Handle completion of command and data transfers.
*/
-static irqreturn_t mmci_irq(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t mmci_irq(int irq, void *dev_id)
{
struct mmci_host *host = dev_id;
u32 status;
{
struct mmci_host *host = dev_id;
u32 status;
@@
-406,9
+409,6
@@
static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
struct mmci_host *host = mmc_priv(mmc);
u32 clk = 0, pwr = 0;
struct mmci_host *host = mmc_priv(mmc);
u32 clk = 0, pwr = 0;
- DBG(host, "clock %uHz busmode %u powermode %u Vdd %u\n",
- ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
-
if (ios->clock) {
if (ios->clock >= host->mclk) {
clk = MCI_CLK_BYPASS;
if (ios->clock) {
if (ios->clock >= host->mclk) {
clk = MCI_CLK_BYPASS;
@@
-447,7
+447,7
@@
static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
}
}
}
}
-static struct mmc_host_ops mmci_ops = {
+static
const
struct mmc_host_ops mmci_ops = {
.request = mmci_request,
.set_ios = mmci_set_ios,
};
.request = mmci_request,
.set_ios = mmci_set_ios,
};
@@
-513,6
+513,7
@@
static int mmci_probe(struct amba_device *dev, void *id)
mmc->f_min = (host->mclk + 511) / 512;
mmc->f_max = min(host->mclk, fmax);
mmc->ocr_avail = plat->ocr_mask;
mmc->f_min = (host->mclk + 511) / 512;
mmc->f_max = min(host->mclk, fmax);
mmc->ocr_avail = plat->ocr_mask;
+ mmc->caps = MMC_CAP_MULTIWRITE;
/*
* We can do SGIO
/*
* We can do SGIO
@@
-539,11
+540,11
@@
static int mmci_probe(struct amba_device *dev, void *id)
writel(0, host->base + MMCIMASK1);
writel(0xfff, host->base + MMCICLEAR);
writel(0, host->base + MMCIMASK1);
writel(0xfff, host->base + MMCICLEAR);
- ret = request_irq(dev->irq[0], mmci_irq,
SA_SHIRQ
, DRIVER_NAME " (cmd)", host);
+ ret = request_irq(dev->irq[0], mmci_irq,
IRQF_SHARED
, DRIVER_NAME " (cmd)", host);
if (ret)
goto unmap;
if (ret)
goto unmap;
- ret = request_irq(dev->irq[1], mmci_pio_irq,
SA_SHIRQ
, DRIVER_NAME " (pio)", host);
+ ret = request_irq(dev->irq[1], mmci_pio_irq,
IRQF_SHARED
, DRIVER_NAME " (pio)", host);
if (ret)
goto irq0_free;
if (ret)
goto irq0_free;
@@
-553,9
+554,9
@@
static int mmci_probe(struct amba_device *dev, void *id)
mmc_add_host(mmc);
mmc_add_host(mmc);
- printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%0
8
lx irq %d,%d\n",
+ printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%0
16l
lx irq %d,%d\n",
mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
- dev->res.start, dev->irq[0], dev->irq[1]);
+
(unsigned long long)
dev->res.start, dev->irq[0], dev->irq[1]);
init_timer(&host->timer);
host->timer.data = (unsigned long)host;
init_timer(&host->timer);
host->timer.data = (unsigned long)host;