Commit 63a97a70 authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

staging: mt7621-mmc: Fix spacing

Fixes checkpatch errors, warnings, checks:
SPACING, LEADING_SPACE, LINE_SPACING
Signed-off-by: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b21f5195
...@@ -57,7 +57,6 @@ typedef void (*pm_callback_t)(pm_message_t state, void *data); ...@@ -57,7 +57,6 @@ typedef void (*pm_callback_t)(pm_message_t state, void *data);
#define MSDC_UHS1 (1 << 8) /* uhs-1 mode support */ #define MSDC_UHS1 (1 << 8) /* uhs-1 mode support */
#define MSDC_DDR (1 << 9) /* ddr mode support */ #define MSDC_DDR (1 << 9) /* ddr mode support */
#define MSDC_SMPL_RISING (0) #define MSDC_SMPL_RISING (0)
#define MSDC_SMPL_FALLING (1) #define MSDC_SMPL_FALLING (1)
...@@ -118,6 +117,7 @@ struct mt3326_gps_hardware { ...@@ -118,6 +117,7 @@ struct mt3326_gps_hardware {
int (*ext_power_on)(int); int (*ext_power_on)(int);
int (*ext_power_off)(int); int (*ext_power_off)(int);
}; };
extern struct mt3326_gps_hardware mt3326_gps_hw; extern struct mt3326_gps_hardware mt3326_gps_hw;
/* NAND driver */ /* NAND driver */
...@@ -131,6 +131,7 @@ struct mt6575_nand_host_hw { ...@@ -131,6 +131,7 @@ struct mt6575_nand_host_hw {
unsigned int nand_ecc_bytes; unsigned int nand_ecc_bytes;
unsigned int nand_ecc_mode; unsigned int nand_ecc_mode;
}; };
extern struct mt6575_nand_host_hw mt6575_nand_hw; extern struct mt6575_nand_host_hw mt6575_nand_hw;
#endif /* __ARCH_ARM_MACH_BOARD_H */ #endif /* __ARCH_ARM_MACH_BOARD_H */
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
static char cmd_buf[256]; static char cmd_buf[256];
/* for debug zone */ /* for debug zone */
unsigned int sd_debug_zone[4]={ unsigned int sd_debug_zone[4] = {
0, 0,
0, 0,
0, 0,
...@@ -59,20 +59,21 @@ unsigned int sd_debug_zone[4]={ ...@@ -59,20 +59,21 @@ unsigned int sd_debug_zone[4]={
}; };
/* mode select */ /* mode select */
u32 dma_size[4]={ u32 dma_size[4] = {
512, 512,
512, 512,
512, 512,
512 512
}; };
msdc_mode drv_mode[4]={
msdc_mode drv_mode[4] = {
MODE_SIZE_DEP, /* using DMA or not depend on the size */ MODE_SIZE_DEP, /* using DMA or not depend on the size */
MODE_SIZE_DEP, MODE_SIZE_DEP,
MODE_SIZE_DEP, MODE_SIZE_DEP,
MODE_SIZE_DEP MODE_SIZE_DEP
}; };
#if defined (MT6575_SD_DEBUG) #if defined(MT6575_SD_DEBUG)
/* for driver profile */ /* for driver profile */
#define TICKS_ONE_MS (13000) #define TICKS_ONE_MS (13000)
u32 gpt_enable = 0; u32 gpt_enable = 0;
...@@ -90,7 +91,7 @@ void msdc_init_gpt(void) ...@@ -90,7 +91,7 @@ void msdc_init_gpt(void)
config.clkSrc = GPT_CLK_SRC_SYS; config.clkSrc = GPT_CLK_SRC_SYS;
config.clkDiv = GPT_CLK_DIV_1; /* 13MHz GPT6 */ config.clkDiv = GPT_CLK_DIV_1; /* 13MHz GPT6 */
if (GPT_Config(config) == FALSE ) if (GPT_Config(config) == FALSE)
return; return;
GPT_Start(GPT6); GPT_Start(GPT6);
...@@ -103,7 +104,7 @@ u32 msdc_time_calc(u32 old_L32, u32 old_H32, u32 new_L32, u32 new_H32) ...@@ -103,7 +104,7 @@ u32 msdc_time_calc(u32 old_L32, u32 old_H32, u32 new_L32, u32 new_H32)
if (new_H32 == old_H32) { if (new_H32 == old_H32) {
ret = new_L32 - old_L32; ret = new_L32 - old_L32;
} else if(new_H32 == (old_H32 + 1)) { } else if (new_H32 == (old_H32 + 1)) {
if (new_L32 > old_L32) { if (new_L32 > old_L32) {
printk("msdc old_L<0x%x> new_L<0x%x>\n", old_L32, new_L32); printk("msdc old_L<0x%x> new_L<0x%x>\n", old_L32, new_L32);
} }
...@@ -129,44 +130,44 @@ void msdc_sdio_profile(struct sdio_profile* result) ...@@ -129,44 +130,44 @@ void msdc_sdio_profile(struct sdio_profile* result)
/* CMD52 Dump */ /* CMD52 Dump */
cmd = &result->cmd52_rx; cmd = &result->cmd52_rx;
printk("sdio === CMD52 Rx <%d>times tick<%d> Max<%d> Min<%d> Aver<%d>\n", cmd->count, cmd->tot_tc, printk("sdio === CMD52 Rx <%d>times tick<%d> Max<%d> Min<%d> Aver<%d>\n", cmd->count, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count); cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count);
cmd = &result->cmd52_tx; cmd = &result->cmd52_tx;
printk("sdio === CMD52 Tx <%d>times tick<%d> Max<%d> Min<%d> Aver<%d>\n", cmd->count, cmd->tot_tc, printk("sdio === CMD52 Tx <%d>times tick<%d> Max<%d> Min<%d> Aver<%d>\n", cmd->count, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count); cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count);
/* CMD53 Rx bytes + block mode */ /* CMD53 Rx bytes + block mode */
for (i=0; i<512; i++) { for (i = 0; i < 512; i++) {
cmd = &result->cmd53_rx_byte[i]; cmd = &result->cmd53_rx_byte[i];
if (cmd->count) { if (cmd->count) {
printk("sdio<%6d><%3dB>_Rx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc, printk("sdio<%6d><%3dB>_Rx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count, cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count,
cmd->tot_bytes, (cmd->tot_bytes/10)*13 / (cmd->tot_tc/10)); cmd->tot_bytes, (cmd->tot_bytes / 10) * 13 / (cmd->tot_tc / 10));
} }
} }
for (i=0; i<100; i++) { for (i = 0; i < 100; i++) {
cmd = &result->cmd53_rx_blk[i]; cmd = &result->cmd53_rx_blk[i];
if (cmd->count) { if (cmd->count) {
printk("sdio<%6d><%3d>B_Rx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc, printk("sdio<%6d><%3d>B_Rx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count, cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count,
cmd->tot_bytes, (cmd->tot_bytes/10)*13 / (cmd->tot_tc/10)); cmd->tot_bytes, (cmd->tot_bytes / 10) * 13 / (cmd->tot_tc / 10));
} }
} }
/* CMD53 Tx bytes + block mode */ /* CMD53 Tx bytes + block mode */
for (i=0; i<512; i++) { for (i = 0; i < 512; i++) {
cmd = &result->cmd53_tx_byte[i]; cmd = &result->cmd53_tx_byte[i];
if (cmd->count) { if (cmd->count) {
printk("sdio<%6d><%3dB>_Tx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc, printk("sdio<%6d><%3dB>_Tx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count, cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count,
cmd->tot_bytes, (cmd->tot_bytes/10)*13 / (cmd->tot_tc/10)); cmd->tot_bytes, (cmd->tot_bytes / 10) * 13 / (cmd->tot_tc / 10));
} }
} }
for (i=0; i<100; i++) { for (i = 0; i < 100; i++) {
cmd = &result->cmd53_tx_blk[i]; cmd = &result->cmd53_tx_blk[i];
if (cmd->count) { if (cmd->count) {
printk("sdio<%6d><%3d>B_Tx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc, printk("sdio<%6d><%3d>B_Tx_<%9d><%9d><%6d><%6d>_<%9dB><%2dM>\n", cmd->count, i, cmd->tot_tc,
cmd->max_tc, cmd->min_tc, cmd->tot_tc/cmd->count, cmd->max_tc, cmd->min_tc, cmd->tot_tc / cmd->count,
cmd->tot_bytes, (cmd->tot_bytes/10)*13 / (cmd->tot_tc/10)); cmd->tot_bytes, (cmd->tot_bytes / 10) * 13 / (cmd->tot_tc / 10));
} }
} }
...@@ -193,7 +194,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks) ...@@ -193,7 +194,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks)
block = sizes / 512; block = sizes / 512;
if (block >= 99) { if (block >= 99) {
printk("cmd53 error blocks\n"); printk("cmd53 error blocks\n");
while(1); while (1);
} }
cmd = bRx ? &result->cmd53_rx_blk[block] : &result->cmd53_tx_blk[block]; cmd = bRx ? &result->cmd53_rx_blk[block] : &result->cmd53_tx_blk[block];
} }
...@@ -202,7 +203,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks) ...@@ -202,7 +203,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks)
} }
/* update the members */ /* update the members */
if (ticks > cmd->max_tc){ if (ticks > cmd->max_tc) {
cmd->max_tc = ticks; cmd->max_tc = ticks;
} }
if (cmd->min_tc == 0 || ticks < cmd->min_tc) { if (cmd->min_tc == 0 || ticks < cmd->min_tc) {
...@@ -210,7 +211,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks) ...@@ -210,7 +211,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks)
} }
cmd->tot_tc += ticks; cmd->tot_tc += ticks;
cmd->tot_bytes += sizes; cmd->tot_bytes += sizes;
cmd->count ++; cmd->count++;
if (bRx) { if (bRx) {
result->total_rx_bytes += sizes; result->total_rx_bytes += sizes;
...@@ -222,7 +223,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks) ...@@ -222,7 +223,7 @@ void msdc_performance(u32 opcode, u32 sizes, u32 bRx, u32 ticks)
/* dump when total_tc > 30s */ /* dump when total_tc > 30s */
if (result->total_tc >= sdio_pro_time * TICKS_ONE_MS * 1000) { if (result->total_tc >= sdio_pro_time * TICKS_ONE_MS * 1000) {
msdc_sdio_profile(result); msdc_sdio_profile(result);
memset(result, 0 , sizeof(struct sdio_profile)); memset(result, 0, sizeof(struct sdio_profile));
} }
} }
...@@ -264,7 +265,7 @@ static ssize_t msdc_debug_proc_write(struct file *file, ...@@ -264,7 +265,7 @@ static ssize_t msdc_debug_proc_write(struct file *file,
int mode, size; int mode, size;
if (count == 0)return -1; if (count == 0)return -1;
if(count > 255)count = 255; if (count > 255)count = 255;
ret = copy_from_user(cmd_buf, buf, count); ret = copy_from_user(cmd_buf, buf, count);
if (ret < 0)return -1; if (ret < 0)return -1;
...@@ -274,13 +275,13 @@ static ssize_t msdc_debug_proc_write(struct file *file, ...@@ -274,13 +275,13 @@ static ssize_t msdc_debug_proc_write(struct file *file,
sscanf(cmd_buf, "%x %x %x", &cmd, &p1, &p2); sscanf(cmd_buf, "%x %x %x", &cmd, &p1, &p2);
if(cmd == SD_TOOL_ZONE) { if (cmd == SD_TOOL_ZONE) {
id = p1; zone = p2; zone &= 0x3ff; id = p1; zone = p2; zone &= 0x3ff;
printk("msdc host_id<%d> zone<0x%.8x>\n", id, zone); printk("msdc host_id<%d> zone<0x%.8x>\n", id, zone);
if(id >=0 && id<=3){ if (id >= 0 && id <= 3) {
sd_debug_zone[id] = zone; sd_debug_zone[id] = zone;
} }
else if(id == 4){ else if (id == 4) {
sd_debug_zone[0] = sd_debug_zone[1] = zone; sd_debug_zone[0] = sd_debug_zone[1] = zone;
sd_debug_zone[2] = sd_debug_zone[3] = zone; sd_debug_zone[2] = sd_debug_zone[3] = zone;
} }
...@@ -288,12 +289,12 @@ static ssize_t msdc_debug_proc_write(struct file *file, ...@@ -288,12 +289,12 @@ static ssize_t msdc_debug_proc_write(struct file *file,
printk("msdc host_id error when set debug zone\n"); printk("msdc host_id error when set debug zone\n");
} }
} else if (cmd == SD_TOOL_DMA_SIZE) { } else if (cmd == SD_TOOL_DMA_SIZE) {
id = p1>>4; mode = (p1&0xf); size = p2; id = p1 >> 4; mode = (p1 & 0xf); size = p2;
if(id >=0 && id<=3){ if (id >= 0 && id <= 3) {
drv_mode[id] = mode; drv_mode[id] = mode;
dma_size[id] = p2; dma_size[id] = p2;
} }
else if(id == 4){ else if (id == 4) {
drv_mode[0] = drv_mode[1] = mode; drv_mode[0] = drv_mode[1] = mode;
drv_mode[2] = drv_mode[3] = mode; drv_mode[2] = drv_mode[3] = mode;
dma_size[0] = dma_size[1] = p2; dma_size[0] = dma_size[1] = p2;
...@@ -310,7 +311,7 @@ static ssize_t msdc_debug_proc_write(struct file *file, ...@@ -310,7 +311,7 @@ static ssize_t msdc_debug_proc_write(struct file *file,
} }
sdio_pro_enable = 1; sdio_pro_enable = 1;
if (p2 == 0) p2 = 1; if (p2 >= 30) p2 = 30; if (p2 == 0) p2 = 1; if (p2 >= 30) p2 = 30;
sdio_pro_time = p2 ; sdio_pro_time = p2;
} else if (p1 == 0) { } else if (p1 == 0) {
/* todo */ /* todo */
sdio_pro_enable = 0; sdio_pro_enable = 0;
...@@ -341,7 +342,7 @@ int msdc_debug_proc_init(void) ...@@ -341,7 +342,7 @@ int msdc_debug_proc_init(void)
if (!de || IS_ERR(de)) if (!de || IS_ERR(de))
printk("!! Create MSDC debug PROC fail !!\n"); printk("!! Create MSDC debug PROC fail !!\n");
return 0 ; return 0;
} }
EXPORT_SYMBOL_GPL(msdc_debug_proc_init); EXPORT_SYMBOL_GPL(msdc_debug_proc_init);
#endif #endif
...@@ -104,9 +104,9 @@ extern unsigned int sd_debug_zone[4]; ...@@ -104,9 +104,9 @@ extern unsigned int sd_debug_zone[4];
do { \ do { \
if (x) { \ if (x) { \
printk("[BUG] %s LINE:%d FILE:%s\n", #x, __LINE__, __FILE__); \ printk("[BUG] %s LINE:%d FILE:%s\n", #x, __LINE__, __FILE__); \
while(1); \ while (1); \
} \ } \
}while(0) } while (0)
#endif /* end of +++ */ #endif /* end of +++ */
#define N_MSG(evt, fmt, args...) #define N_MSG(evt, fmt, args...)
...@@ -122,8 +122,8 @@ do { \ ...@@ -122,8 +122,8 @@ do { \
#define ERR_MSG(fmt, args...) \ #define ERR_MSG(fmt, args...) \
do { \ do { \
printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \
host->id, ##args , __FUNCTION__, __LINE__, current->comm, current->pid); \ host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \
} while(0); } while (0);
#if 1 #if 1
//defined CONFIG_MTK_MMC_CD_POLL //defined CONFIG_MTK_MMC_CD_POLL
...@@ -133,15 +133,15 @@ do { \ ...@@ -133,15 +133,15 @@ do { \
#define INIT_MSG(fmt, args...) \ #define INIT_MSG(fmt, args...) \
do { \ do { \
printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \
host->id, ##args , __FUNCTION__, __LINE__, current->comm, current->pid); \ host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \
} while(0); } while (0);
/* PID in ISR in not corrent */ /* PID in ISR in not corrent */
#define IRQ_MSG(fmt, args...) \ #define IRQ_MSG(fmt, args...) \
do { \ do { \
printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \
host->id, ##args , __FUNCTION__, __LINE__); \ host->id, ##args, __FUNCTION__, __LINE__); \
} while(0); } while (0);
#endif #endif
int msdc_debug_proc_init(void); int msdc_debug_proc_init(void);
......
...@@ -253,7 +253,7 @@ enum { ...@@ -253,7 +253,7 @@ enum {
#define MSDC_PS_CDDEBOUNCE (0xf << 12) /* RW */ #define MSDC_PS_CDDEBOUNCE (0xf << 12) /* RW */
#define MSDC_PS_DAT (0xff << 16) /* R */ #define MSDC_PS_DAT (0xff << 16) /* R */
#define MSDC_PS_CMD (0x1 << 24) /* R */ #define MSDC_PS_CMD (0x1 << 24) /* R */
#define MSDC_PS_WP (0x1UL<< 31) /* R */ #define MSDC_PS_WP (0x1UL << 31) /* R */
/* MSDC_INT mask */ /* MSDC_INT mask */
#define MSDC_INT_MMCIRQ (0x1 << 0) /* W1C */ #define MSDC_INT_MMCIRQ (0x1 << 0) /* W1C */
...@@ -294,7 +294,7 @@ enum { ...@@ -294,7 +294,7 @@ enum {
/* MSDC_FIFOCS mask */ /* MSDC_FIFOCS mask */
#define MSDC_FIFOCS_RXCNT (0xff << 0) /* R */ #define MSDC_FIFOCS_RXCNT (0xff << 0) /* R */
#define MSDC_FIFOCS_TXCNT (0xff << 16) /* R */ #define MSDC_FIFOCS_TXCNT (0xff << 16) /* R */
#define MSDC_FIFOCS_CLR (0x1UL<< 31) /* RW */ #define MSDC_FIFOCS_CLR (0x1UL << 31) /* RW */
/* SDC_CFG mask */ /* SDC_CFG mask */
#define SDC_CFG_SDIOINTWKUP (0x1 << 0) /* RW */ #define SDC_CFG_SDIOINTWKUP (0x1 << 0) /* RW */
...@@ -314,7 +314,7 @@ enum { ...@@ -314,7 +314,7 @@ enum {
#define SDC_CMD_RW (0x1 << 13) /* RW */ #define SDC_CMD_RW (0x1 << 13) /* RW */
#define SDC_CMD_STOP (0x1 << 14) /* RW */ #define SDC_CMD_STOP (0x1 << 14) /* RW */
#define SDC_CMD_GOIRQ (0x1 << 15) /* RW */ #define SDC_CMD_GOIRQ (0x1 << 15) /* RW */
#define SDC_CMD_BLKLEN (0xfff<< 16) /* RW */ #define SDC_CMD_BLKLEN (0xfff << 16) /* RW */
#define SDC_CMD_AUTOCMD (0x3 << 28) /* RW */ #define SDC_CMD_AUTOCMD (0x3 << 28) /* RW */
#define SDC_CMD_VOLSWTH (0x1 << 30) /* RW */ #define SDC_CMD_VOLSWTH (0x1 << 30) /* RW */
...@@ -396,7 +396,7 @@ enum { ...@@ -396,7 +396,7 @@ enum {
#define MSDC_PAD_CTL0_CLKSMT (0x1 << 18) /* RW */ #define MSDC_PAD_CTL0_CLKSMT (0x1 << 18) /* RW */
#define MSDC_PAD_CTL0_CLKIES (0x1 << 19) /* RW */ #define MSDC_PAD_CTL0_CLKIES (0x1 << 19) /* RW */
#define MSDC_PAD_CTL0_CLKTDSEL (0xf << 20) /* RW */ #define MSDC_PAD_CTL0_CLKTDSEL (0xf << 20) /* RW */
#define MSDC_PAD_CTL0_CLKRDSEL (0xffUL<< 24) /* RW */ #define MSDC_PAD_CTL0_CLKRDSEL (0xffUL << 24) /* RW */
/* MSDC_PAD_CTL1 mask */ /* MSDC_PAD_CTL1 mask */
#define MSDC_PAD_CTL1_CMDDRVN (0x7 << 0) /* RW */ #define MSDC_PAD_CTL1_CMDDRVN (0x7 << 0) /* RW */
...@@ -407,7 +407,7 @@ enum { ...@@ -407,7 +407,7 @@ enum {
#define MSDC_PAD_CTL1_CMDSMT (0x1 << 18) /* RW */ #define MSDC_PAD_CTL1_CMDSMT (0x1 << 18) /* RW */
#define MSDC_PAD_CTL1_CMDIES (0x1 << 19) /* RW */ #define MSDC_PAD_CTL1_CMDIES (0x1 << 19) /* RW */
#define MSDC_PAD_CTL1_CMDTDSEL (0xf << 20) /* RW */ #define MSDC_PAD_CTL1_CMDTDSEL (0xf << 20) /* RW */
#define MSDC_PAD_CTL1_CMDRDSEL (0xffUL<< 24) /* RW */ #define MSDC_PAD_CTL1_CMDRDSEL (0xffUL << 24) /* RW */
/* MSDC_PAD_CTL2 mask */ /* MSDC_PAD_CTL2 mask */
#define MSDC_PAD_CTL2_DATDRVN (0x7 << 0) /* RW */ #define MSDC_PAD_CTL2_DATDRVN (0x7 << 0) /* RW */
...@@ -418,7 +418,7 @@ enum { ...@@ -418,7 +418,7 @@ enum {
#define MSDC_PAD_CTL2_DATIES (0x1 << 19) /* RW */ #define MSDC_PAD_CTL2_DATIES (0x1 << 19) /* RW */
#define MSDC_PAD_CTL2_DATSMT (0x1 << 18) /* RW */ #define MSDC_PAD_CTL2_DATSMT (0x1 << 18) /* RW */
#define MSDC_PAD_CTL2_DATTDSEL (0xf << 20) /* RW */ #define MSDC_PAD_CTL2_DATTDSEL (0xf << 20) /* RW */
#define MSDC_PAD_CTL2_DATRDSEL (0xffUL<< 24) /* RW */ #define MSDC_PAD_CTL2_DATRDSEL (0xffUL << 24) /* RW */
/* MSDC_PAD_TUNE mask */ /* MSDC_PAD_TUNE mask */
#define MSDC_PAD_TUNE_DATWRDLY (0x1F << 0) /* RW */ #define MSDC_PAD_TUNE_DATWRDLY (0x1F << 0) /* RW */
...@@ -438,11 +438,11 @@ enum { ...@@ -438,11 +438,11 @@ enum {
#define MSDC_DAT_RDDLY1_D6 (0x1F << 16) /* RW */ #define MSDC_DAT_RDDLY1_D6 (0x1F << 16) /* RW */
#define MSDC_DAT_RDDLY1_D7 (0x1F << 24) /* RW */ #define MSDC_DAT_RDDLY1_D7 (0x1F << 24) /* RW */
#define MSDC_CKGEN_MSDC_DLY_SEL (0x1F<<10) #define MSDC_CKGEN_MSDC_DLY_SEL (0x1F << 10)
#define MSDC_INT_DAT_LATCH_CK_SEL (0x7<<7) #define MSDC_INT_DAT_LATCH_CK_SEL (0x7 << 7)
#define MSDC_CKGEN_MSDC_CK_SEL (0x1<<6) #define MSDC_CKGEN_MSDC_CK_SEL (0x1 << 6)
#define CARD_READY_FOR_DATA (1<<8) #define CARD_READY_FOR_DATA (1 << 8)
#define CARD_CURRENT_STATE(x) ((x&0x00001E00)>>9) #define CARD_CURRENT_STATE(x) ((x & 0x00001E00) >> 9)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* Descriptor Structure */ /* Descriptor Structure */
...@@ -974,27 +974,28 @@ static inline unsigned int uffs(unsigned int x) ...@@ -974,27 +974,28 @@ static inline unsigned int uffs(unsigned int x)
} }
return r; return r;
} }
#define sdr_read8(reg) __raw_readb(reg) #define sdr_read8(reg) __raw_readb(reg)
#define sdr_read16(reg) __raw_readw(reg) #define sdr_read16(reg) __raw_readw(reg)
#define sdr_read32(reg) __raw_readl(reg) #define sdr_read32(reg) __raw_readl(reg)
#define sdr_write8(reg,val) __raw_writeb(val,reg) #define sdr_write8(reg, val) __raw_writeb(val, reg)
#define sdr_write16(reg,val) __raw_writew(val,reg) #define sdr_write16(reg, val) __raw_writew(val, reg)
#define sdr_write32(reg,val) __raw_writel(val,reg) #define sdr_write32(reg, val) __raw_writel(val, reg)
#define sdr_set_bits(reg,bs) ((*(volatile u32*)(reg)) |= (u32)(bs)) #define sdr_set_bits(reg, bs) ((*(volatile u32*)(reg)) |= (u32)(bs))
#define sdr_clr_bits(reg,bs) ((*(volatile u32*)(reg)) &= ~((u32)(bs))) #define sdr_clr_bits(reg, bs) ((*(volatile u32*)(reg)) &= ~((u32)(bs)))
#define sdr_set_field(reg,field,val) \ #define sdr_set_field(reg, field, val) \
do { \ do { \
volatile unsigned int tv = sdr_read32(reg); \ volatile unsigned int tv = sdr_read32(reg); \
tv &= ~(field); \ tv &= ~(field); \
tv |= ((val) << (uffs((unsigned int)field) - 1)); \ tv |= ((val) << (uffs((unsigned int)field) - 1)); \
sdr_write32(reg,tv); \ sdr_write32(reg, tv); \
} while(0) } while (0)
#define sdr_get_field(reg,field,val) \ #define sdr_get_field(reg, field, val) \
do { \ do { \
volatile unsigned int tv = sdr_read32(reg); \ volatile unsigned int tv = sdr_read32(reg); \
val = ((tv & (field)) >> (uffs((unsigned int)field) - 1)); \ val = ((tv & (field)) >> (uffs((unsigned int)field) - 1)); \
} while(0) } while (0)
#endif #endif
This diff is collapsed.
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