Cleanup glamo mmc driver.
SVN-Revision: 16786
This commit is contained in:
parent
a21bf40453
commit
4147b632e9
4 changed files with 324 additions and 584 deletions
|
@ -45,8 +45,6 @@
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
#include <asm/div64.h>
|
#include <asm/div64.h>
|
||||||
|
|
||||||
//#include <mach/regs-irq.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,11 +52,8 @@
|
||||||
#include "glamo-regs.h"
|
#include "glamo-regs.h"
|
||||||
#include "glamo-core.h"
|
#include "glamo-core.h"
|
||||||
|
|
||||||
#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)
|
|
||||||
|
|
||||||
#define GLAMO_MEM_REFRESH_COUNT 0x100
|
#define GLAMO_MEM_REFRESH_COUNT 0x100
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Glamo internal settings
|
* Glamo internal settings
|
||||||
*
|
*
|
||||||
|
@ -151,27 +146,6 @@ static inline void __reg_clear_bit(struct glamo_core *glamo,
|
||||||
__reg_set_bit_mask(glamo, reg, bit, 0);
|
__reg_set_bit_mask(glamo, reg, bit, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void glamo_vmem_write(struct glamo_core *glamo, u_int32_t addr,
|
|
||||||
u_int16_t *src, int len)
|
|
||||||
{
|
|
||||||
if (addr & 0x0001 || (unsigned long)src & 0x0001 || len & 0x0001) {
|
|
||||||
dev_err(&glamo->pdev->dev, "unaligned write(0x%08x, 0x%p, "
|
|
||||||
"0x%x)!!\n", addr, src, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void glamo_vmem_read(struct glamo_core *glamo, u_int16_t *buf,
|
|
||||||
u_int32_t addr, int len)
|
|
||||||
{
|
|
||||||
if (addr & 0x0001 || (unsigned long) buf & 0x0001 || len & 0x0001) {
|
|
||||||
dev_err(&glamo->pdev->dev, "unaligned read(0x%p, 0x08%x, "
|
|
||||||
"0x%x)!!\n", buf, addr, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* resources of sibling devices
|
* resources of sibling devices
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
@ -307,10 +281,10 @@ static struct resource glamo_mmc_resources[] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
struct glamo_mci_pdata glamo_mci_def_pdata = {
|
static struct glamo_mci_pdata glamo_mci_def_pdata = {
|
||||||
.gpio_detect = 0,
|
.gpio_detect = 0,
|
||||||
.glamo_can_set_mci_power = NULL, /* filled in from MFD platform data */
|
.glamo_can_set_mci_power = NULL, /* filled in from MFD platform data */
|
||||||
.ocr_avail = MMC_VDD_20_21 |
|
/* .ocr_avail = MMC_VDD_20_21 |
|
||||||
MMC_VDD_21_22 |
|
MMC_VDD_21_22 |
|
||||||
MMC_VDD_22_23 |
|
MMC_VDD_22_23 |
|
||||||
MMC_VDD_23_24 |
|
MMC_VDD_23_24 |
|
||||||
|
@ -321,14 +295,11 @@ struct glamo_mci_pdata glamo_mci_def_pdata = {
|
||||||
MMC_VDD_28_29 |
|
MMC_VDD_28_29 |
|
||||||
MMC_VDD_29_30 |
|
MMC_VDD_29_30 |
|
||||||
MMC_VDD_30_31 |
|
MMC_VDD_30_31 |
|
||||||
MMC_VDD_32_33,
|
MMC_VDD_32_33,*/
|
||||||
.glamo_irq_is_wired = NULL, /* filled in from MFD platform data */
|
.glamo_irq_is_wired = NULL, /* filled in from MFD platform data */
|
||||||
.mci_suspending = NULL, /* filled in from MFD platform data */
|
.mci_suspending = NULL, /* filled in from MFD platform data */
|
||||||
.mci_all_dependencies_resumed = NULL, /* filled in from MFD platform data */
|
.mci_all_dependencies_resumed = NULL, /* filled in from MFD platform data */
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL_GPL(glamo_mci_def_pdata);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void mangle_mem_resources(struct resource *res, int num_res,
|
static void mangle_mem_resources(struct resource *res, int num_res,
|
||||||
struct resource *parent)
|
struct resource *parent)
|
||||||
|
@ -1378,6 +1349,7 @@ static int __init glamo_probe(struct platform_device *pdev)
|
||||||
glamo_mmc_dev->dev.parent = &pdev->dev;
|
glamo_mmc_dev->dev.parent = &pdev->dev;
|
||||||
glamo_mmc_dev->resource = glamo_mmc_resources;
|
glamo_mmc_dev->resource = glamo_mmc_resources;
|
||||||
glamo_mmc_dev->num_resources = ARRAY_SIZE(glamo_mmc_resources);
|
glamo_mmc_dev->num_resources = ARRAY_SIZE(glamo_mmc_resources);
|
||||||
|
glamo_mmc_dev->dev.platform_data = &glamo_mci_def_pdata;
|
||||||
|
|
||||||
/* we need it later to give to the engine enable and disable */
|
/* we need it later to give to the engine enable and disable */
|
||||||
glamo_mci_def_pdata.pglamo = glamo;
|
glamo_mci_def_pdata.pglamo = glamo;
|
||||||
|
|
|
@ -45,7 +45,6 @@ struct glamo_mci_pdata {
|
||||||
struct glamo_core * pglamo;
|
struct glamo_core * pglamo;
|
||||||
unsigned int gpio_detect;
|
unsigned int gpio_detect;
|
||||||
unsigned int gpio_wprotect;
|
unsigned int gpio_wprotect;
|
||||||
unsigned long ocr_avail;
|
|
||||||
int (*glamo_can_set_mci_power)(void);
|
int (*glamo_can_set_mci_power)(void);
|
||||||
/* glamo-mci asking if it should use the slow clock to card */
|
/* glamo-mci asking if it should use the slow clock to card */
|
||||||
int (*glamo_mci_use_slow)(void);
|
int (*glamo_mci_use_slow)(void);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -12,28 +12,14 @@
|
||||||
|
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
|
|
||||||
enum glamo_mci_waitfor {
|
|
||||||
COMPLETION_NONE,
|
|
||||||
COMPLETION_FINALIZE,
|
|
||||||
COMPLETION_CMDSENT,
|
|
||||||
COMPLETION_RSPFIN,
|
|
||||||
COMPLETION_XFERFINISH,
|
|
||||||
COMPLETION_XFERFINISH_RSPFIN,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct glamo_mci_host {
|
struct glamo_mci_host {
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct glamo_mci_pdata *pdata;
|
struct glamo_mci_pdata *pdata;
|
||||||
struct mmc_host *mmc;
|
struct mmc_host *mmc;
|
||||||
struct resource *mem;
|
struct resource *mmio_mem;
|
||||||
struct resource *mem_data;
|
struct resource *data_mem;
|
||||||
struct clk *clk;
|
void __iomem *mmio_base;
|
||||||
void __iomem *base;
|
u16 __iomem *data_base;
|
||||||
u16 __iomem *base_data;
|
|
||||||
int irq;
|
|
||||||
int irq_cd;
|
|
||||||
int dma;
|
|
||||||
int data_max_size;
|
|
||||||
|
|
||||||
int suspending;
|
int suspending;
|
||||||
|
|
||||||
|
@ -43,42 +29,15 @@ struct glamo_mci_host {
|
||||||
unsigned long clk_rate;
|
unsigned long clk_rate;
|
||||||
unsigned long clk_div;
|
unsigned long clk_div;
|
||||||
unsigned long real_rate;
|
unsigned long real_rate;
|
||||||
u8 prescaler;
|
|
||||||
|
|
||||||
int force_slow_during_powerup;
|
int force_slow_during_powerup;
|
||||||
|
|
||||||
unsigned sdiimsk;
|
|
||||||
int dodma;
|
|
||||||
|
|
||||||
volatile int dmatogo;
|
|
||||||
|
|
||||||
struct mmc_request *mrq;
|
struct mmc_request *mrq;
|
||||||
int cmd_is_stop;
|
|
||||||
struct work_struct irq_work;
|
struct work_struct irq_work;
|
||||||
|
|
||||||
spinlock_t complete_lock;
|
spinlock_t lock;
|
||||||
volatile enum glamo_mci_waitfor
|
|
||||||
complete_what;
|
|
||||||
|
|
||||||
volatile int dma_complete;
|
unsigned int request_counter;
|
||||||
|
|
||||||
volatile u32 pio_sgptr;
|
|
||||||
volatile u32 pio_words;
|
|
||||||
volatile u32 pio_count;
|
|
||||||
volatile u16 *pio_ptr;
|
|
||||||
#define XFER_NONE 0
|
|
||||||
#define XFER_READ 1
|
|
||||||
#define XFER_WRITE 2
|
|
||||||
volatile u32 pio_active;
|
|
||||||
|
|
||||||
int bus_width;
|
|
||||||
|
|
||||||
char dbgmsg_cmd[301];
|
|
||||||
char dbgmsg_dat[301];
|
|
||||||
volatile char *status;
|
|
||||||
|
|
||||||
unsigned int ccnt, dcnt;
|
|
||||||
struct tasklet_struct pio_tasklet;
|
|
||||||
|
|
||||||
struct regulator *regulator;
|
struct regulator *regulator;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue