projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'audit.b21' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[powerpc.git]
/
drivers
/
mmc
/
au1xmmc.c
diff --git
a/drivers/mmc/au1xmmc.c
b/drivers/mmc/au1xmmc.c
index
227c39a
..
5dc4bee
100644
(file)
--- a/
drivers/mmc/au1xmmc.c
+++ b/
drivers/mmc/au1xmmc.c
@@
-37,7
+37,7
@@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/device.h>
+#include <linux/
platform_
device.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
@@
-56,12
+56,11
@@
#define DRIVER_NAME "au1xxx-mmc"
/* Set this to enable special debugging macros */
#define DRIVER_NAME "au1xxx-mmc"
/* Set this to enable special debugging macros */
-/* #define MMC_DEBUG */
-#ifdef
MMC_
DEBUG
-#define D
EBU
G(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
+#ifdef DEBUG
+#define D
B
G(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
#else
#else
-#define D
EBU
G(fmt, idx, args...)
+#define D
B
G(fmt, idx, args...)
#endif
const struct {
#endif
const struct {
@@
-87,7
+86,7
@@
struct au1xmmc_host *au1xmmc_hosts[AU1XMMC_CONTROLLER_COUNT];
static int dma = 1;
#ifdef MODULE
static int dma = 1;
#ifdef MODULE
-
MODULE_PARM(dma, "i"
);
+
module_param(dma, bool, 0
);
MODULE_PARM_DESC(dma, "Use DMA engine for data transfers (0 = disabled)");
#endif
MODULE_PARM_DESC(dma, "Use DMA engine for data transfers (0 = disabled)");
#endif
@@
-194,7
+193,7
@@
static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
- switch (mmc_r
sp_type(cmd->flags
)) {
+ switch (mmc_r
esp_type(cmd
)) {
case MMC_RSP_R1:
mmccmd |= SD_CMD_RT_1;
break;
case MMC_RSP_R1:
mmccmd |= SD_CMD_RT_1;
break;
@@
-311,7
+310,7
@@
static void au1xmmc_data_complete(struct au1xmmc_host *host, u32 status)
}
else
data->bytes_xfered =
}
else
data->bytes_xfered =
- (data->blocks *
(1 << data->blksz_bits)
) -
+ (data->blocks *
data->blksz
) -
host->pio.len;
}
host->pio.len;
}
@@
-424,18
+423,18
@@
static void au1xmmc_receive_pio(struct au1xmmc_host *host)
break;
if (status & SD_STATUS_RC) {
break;
if (status & SD_STATUS_RC) {
- D
EBU
G("RX CRC Error [%d + %d].\n", host->id,
+ D
B
G("RX CRC Error [%d + %d].\n", host->id,
host->pio.len, count);
break;
}
if (status & SD_STATUS_RO) {
host->pio.len, count);
break;
}
if (status & SD_STATUS_RO) {
- D
EBU
G("RX Overrun [%d + %d]\n", host->id,
+ D
B
G("RX Overrun [%d + %d]\n", host->id,
host->pio.len, count);
break;
}
else if (status & SD_STATUS_RU) {
host->pio.len, count);
break;
}
else if (status & SD_STATUS_RU) {
- D
EBU
G("RX Underrun [%d + %d]\n", host->id,
+ D
B
G("RX Underrun [%d + %d]\n", host->id,
host->pio.len, count);
break;
}
host->pio.len, count);
break;
}
@@
-576,7
+575,7
@@
static int
au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data)
{
au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data)
{
- int datalen = data->blocks *
(1 << data->blksz_bits)
;
+ int datalen = data->blocks *
data->blksz
;
if (dma != 0)
host->flags |= HOST_F_DMA;
if (dma != 0)
host->flags |= HOST_F_DMA;
@@
-597,7
+596,7
@@
au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data)
if (host->dma.len == 0)
return MMC_ERR_TIMEOUT;
if (host->dma.len == 0)
return MMC_ERR_TIMEOUT;
- au_writel(
(1 << data->blksz_bits)
- 1, HOST_BLKSIZE(host));
+ au_writel(
data->blksz
- 1, HOST_BLKSIZE(host));
if (host->flags & HOST_F_DMA) {
int i;
if (host->flags & HOST_F_DMA) {
int i;
@@
-721,10
+720,6
@@
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",
- host->id, ios->power_mode, ios->clock, ios->vdd,
- ios->bus_mode);
-
if (ios->power_mode == MMC_POWER_OFF)
au1xmmc_set_power(host, 0);
else if (ios->power_mode == MMC_POWER_ON) {
if (ios->power_mode == MMC_POWER_OFF)
au1xmmc_set_power(host, 0);
else if (ios->power_mode == MMC_POWER_ON) {
@@
-740,7
+735,6
@@
static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
static void au1xmmc_dma_callback(int irq, void *dev_id, struct pt_regs *regs)
{
struct au1xmmc_host *host = (struct au1xmmc_host *) dev_id;
static void au1xmmc_dma_callback(int irq, void *dev_id, struct pt_regs *regs)
{
struct au1xmmc_host *host = (struct au1xmmc_host *) dev_id;
- u32 status;
/* Avoid spurious interrupts */
/* Avoid spurious interrupts */
@@
-811,7
+805,7
@@
static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs)
au1xmmc_receive_pio(host);
}
else if (status & 0x203FBC70) {
au1xmmc_receive_pio(host);
}
else if (status & 0x203FBC70) {
- D
EBU
G("Unhandled status %8.8x\n", host->id, status);
+ D
B
G("Unhandled status %8.8x\n", host->id, status);
handled = 0;
}
handled = 0;
}
@@
-840,7
+834,7
@@
static void au1xmmc_poll_event(unsigned long arg)
if (host->mrq != NULL) {
u32 status = au_readl(HOST_STATUS(host));
if (host->mrq != NULL) {
u32 status = au_readl(HOST_STATUS(host));
- D
EBU
G("PENDING - %8.8x\n", host->id, status);
+ D
B
G("PENDING - %8.8x\n", host->id, status);
}
mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT);
}
mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT);
@@
-887,7
+881,7
@@
struct mmc_host_ops au1xmmc_ops = {
.set_ios = au1xmmc_set_ios,
};
.set_ios = au1xmmc_set_ios,
};
-static int
au1xmmc_probe(struct device *
dev)
+static int
__devinit au1xmmc_probe(struct platform_device *p
dev)
{
int i, ret = 0;
{
int i, ret = 0;
@@
-904,7
+898,7
@@
static int au1xmmc_probe(struct device *dev)
disable_irq(AU1100_SD_IRQ);
for(i = 0; i < AU1XMMC_CONTROLLER_COUNT; i++) {
disable_irq(AU1100_SD_IRQ);
for(i = 0; i < AU1XMMC_CONTROLLER_COUNT; i++) {
- struct mmc_host *mmc = mmc_alloc_host(sizeof(struct au1xmmc_host), dev);
+ struct mmc_host *mmc = mmc_alloc_host(sizeof(struct au1xmmc_host),
&pdev->
dev);
struct au1xmmc_host *host = 0;
if (!mmc) {
struct au1xmmc_host *host = 0;
if (!mmc) {
@@
-967,7
+961,7
@@
static int au1xmmc_probe(struct device *dev)
return 0;
}
return 0;
}
-static int
au1xmmc_remove(struct device *
dev)
+static int
__devexit au1xmmc_remove(struct platform_device *p
dev)
{
int i;
{
int i;
@@
-997,23
+991,24
@@
static int au1xmmc_remove(struct device *dev)
return 0;
}
return 0;
}
-static struct device_driver au1xmmc_driver = {
- .name = DRIVER_NAME,
- .bus = &platform_bus_type,
+static struct platform_driver au1xmmc_driver = {
.probe = au1xmmc_probe,
.remove = au1xmmc_remove,
.suspend = NULL,
.probe = au1xmmc_probe,
.remove = au1xmmc_remove,
.suspend = NULL,
- .resume = NULL
+ .resume = NULL,
+ .driver = {
+ .name = DRIVER_NAME,
+ },
};
static int __init au1xmmc_init(void)
{
};
static int __init au1xmmc_init(void)
{
- return driver_register(&au1xmmc_driver);
+ return
platform_
driver_register(&au1xmmc_driver);
}
static void __exit au1xmmc_exit(void)
{
}
static void __exit au1xmmc_exit(void)
{
- driver_unregister(&au1xmmc_driver);
+
platform_
driver_unregister(&au1xmmc_driver);
}
module_init(au1xmmc_init);
}
module_init(au1xmmc_init);