} while (0)
// do we need sync object or not
-void msdc_clk_status(int * status)
+void msdc_clk_status(int *status)
{
*status = g_clk_gate;
}
/* For Inhanced DMA */
#define msdc_init_gpd_ex(gpd, extlen, cmd, arg, blknum) \
do { \
- ((gpd_t*)gpd)->extlen = extlen; \
- ((gpd_t*)gpd)->cmd = cmd; \
- ((gpd_t*)gpd)->arg = arg; \
- ((gpd_t*)gpd)->blknum = blknum; \
+ ((gpd_t *)gpd)->extlen = extlen; \
+ ((gpd_t *)gpd)->cmd = cmd; \
+ ((gpd_t *)gpd)->arg = arg; \
+ ((gpd_t *)gpd)->blknum = blknum; \
} while (0)
#define msdc_init_bd(bd, blkpad, dwpad, dptr, dlen) \
do { \
BUG_ON(dlen > 0xFFFFUL); \
- ((bd_t*)bd)->blkpad = blkpad; \
- ((bd_t*)bd)->dwpad = dwpad; \
- ((bd_t*)bd)->ptr = (void*)dptr; \
- ((bd_t*)bd)->buflen = dlen; \
+ ((bd_t *)bd)->blkpad = blkpad; \
+ ((bd_t *)bd)->dwpad = dwpad; \
+ ((bd_t *)bd)->ptr = (void *)dptr; \
+ ((bd_t *)bd)->buflen = dlen; \
} while (0)
#define msdc_txfifocnt() ((sdr_read32(MSDC_FIFOCS) & MSDC_FIFOCS_TXCNT) >> 16)
// can modify to read h/w register.
//#define is_card_present(h) ((sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 0 : 1);
-#define is_card_present(h) (((struct msdc_host*)(h))->card_inserted)
+#define is_card_present(h) (((struct msdc_host *)(h))->card_inserted)
/* +++ by chhung */
#ifndef __ASSEMBLY__
int tune,
unsigned long timeout);
-static int msdc_tune_cmdrsp(struct msdc_host*host, struct mmc_command *cmd);
+static int msdc_tune_cmdrsp(struct msdc_host *host, struct mmc_command *cmd);
#ifdef MT6575_SD_DEBUG
static void msdc_dump_card_status(struct msdc_host *host, u32 status)
0, 3, 5, 7
};
-static void msdc_select_clksrc(struct msdc_host* host, unsigned char clksrc)
+static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
{
u32 val;
u32 base = host->base;
which means, memory card block read/write won't using pio
then don't need to handle the CMD12 when data error.
*/
-static int msdc_pio_write(struct msdc_host* host, struct mmc_data *data)
+static int msdc_pio_write(struct msdc_host *host, struct mmc_data *data)
{
u32 base = host->base;
struct scatterlist *sg = data->sg;
left -= 4;
}
- u8ptr = (u8*)ptr;
+ u8ptr = (u8 *)ptr;
while (left) {
msdc_fifo_write8(*u8ptr); u8ptr++;
left--;
sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_XFERSZ, sg_dma_len(sg));
//#elif defined (CONFIG_RALINK_MT7621) || defined (CONFIG_RALINK_MT7628)
else
- sdr_write32((volatile u32*)(RALINK_MSDC_BASE + 0xa8), sg_dma_len(sg));
+ sdr_write32((volatile u32 *)(RALINK_MSDC_BASE + 0xa8), sg_dma_len(sg));
//#endif
sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_BRUSTSZ, dma->burstsz);
sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_MODE, 0);
sdr_write32(SDC_BLK_NUM, blknum);
}
-static int msdc_do_request(struct mmc_host*mmc, struct mmc_request*mrq)
+static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
{
struct msdc_host *host = mmc_priv(mmc);
struct mmc_command *cmd;
return err;
}
-static int msdc_tune_cmdrsp(struct msdc_host*host, struct mmc_command *cmd)
+static int msdc_tune_cmdrsp(struct msdc_host *host, struct mmc_command *cmd)
{
int result = -1;
u32 base = host->base;
mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);
if (!mmc) return -ENOMEM;
- hw = (struct msdc_hw*)pdev->dev.platform_data;
+ hw = (struct msdc_hw *)pdev->dev.platform_data;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
if (hw->flags & MSDC_CD_PIN_EN) { /* not set for sdio */
if (hw->request_cd_eirq) { /* not set for MT6575 */
- hw->request_cd_eirq(msdc_eirq_cd, (void*)host); /* msdc_eirq_cd will not be used! */
+ hw->request_cd_eirq(msdc_eirq_cd, (void *)host); /* msdc_eirq_cd will not be used! */
}
}
if (hw->request_sdio_eirq) /* set to combo_sdio_request_eirq() for WIFI */
- hw->request_sdio_eirq(msdc_eirq_sdio, (void*)host); /* msdc_eirq_sdio() will be called when EIRQ */
+ hw->request_sdio_eirq(msdc_eirq_sdio, (void *)host); /* msdc_eirq_sdio() will be called when EIRQ */
if (hw->register_pm) {/* yes for sdio */
#ifdef CONFIG_PM
- hw->register_pm(msdc_pm, (void*)host); /* combo_sdio_register_pm() */
+ hw->register_pm(msdc_pm, (void *)host); /* combo_sdio_register_pm() */
#endif
if (hw->flags & MSDC_SYS_SUSPEND) { /* will not set for WIFI */
ERR_MSG("MSDC_SYS_SUSPEND and register_pm both set");
struct msdc_host *host = mmc_priv(mmc);
if (mmc && state.event == PM_EVENT_SUSPEND && (host->hw->flags & MSDC_SYS_SUSPEND)) { /* will set for card */
- msdc_pm(state, (void*)host);
+ msdc_pm(state, (void *)host);
}
return ret;
state.event = PM_EVENT_RESUME;
if (mmc && (host->hw->flags & MSDC_SYS_SUSPEND)) {/* will set for card */
- msdc_pm(state, (void*)host);
+ msdc_pm(state, (void *)host);
}
/* This mean WIFI not controller by PM */
mtk_sd_device.dev.platform_data = &msdc0_hw;
if (ralink_soc == MT762X_SOC_MT7620A || ralink_soc == MT762X_SOC_MT7621AT) {
//#if defined (CONFIG_RALINK_MT7620) || defined (CONFIG_RALINK_MT7621)
- reg = sdr_read32((volatile u32*)(RALINK_SYSCTL_BASE + 0x60)) & ~(0x3 << 18);
+ reg = sdr_read32((volatile u32 *)(RALINK_SYSCTL_BASE + 0x60)) & ~(0x3 << 18);
//#if defined (CONFIG_RALINK_MT7620)
if (ralink_soc == MT762X_SOC_MT7620A)
reg |= 0x1 << 18;
} else {
//#elif defined (CONFIG_RALINK_MT7628)
/* TODO: maybe omitted when RAether already toggle AGPIO_CFG */
- reg = sdr_read32((volatile u32*)(RALINK_SYSCTL_BASE + 0x3c));
+ reg = sdr_read32((volatile u32 *)(RALINK_SYSCTL_BASE + 0x3c));
reg |= 0x1e << 16;
- sdr_write32((volatile u32*)(RALINK_SYSCTL_BASE + 0x3c), reg);
+ sdr_write32((volatile u32 *)(RALINK_SYSCTL_BASE + 0x3c), reg);
- reg = sdr_read32((volatile u32*)(RALINK_SYSCTL_BASE + 0x60)) & ~(0x3 << 10);
+ reg = sdr_read32((volatile u32 *)(RALINK_SYSCTL_BASE + 0x60)) & ~(0x3 << 10);
#if defined(CONFIG_MTK_MMC_EMMC_8BIT)
reg |= 0x3 << 26 | 0x3 << 28 | 0x3 << 30;
msdc0_hw.data_pins = 8,
#endif
//#endif
}
- sdr_write32((volatile u32*)(RALINK_SYSCTL_BASE + 0x60), reg);
+ sdr_write32((volatile u32 *)(RALINK_SYSCTL_BASE + 0x60), reg);
//platform_device_register(&mtk_sd_device);
/* end of +++ */