static void ak98_mci_send_request(struct mmc_host *mmc) { struct ak98_mci_host *host = mmc_priv(mmc); struct mmc_request *mrq = host->mrq; unsigned long flags; #ifdef CONFIG_CPU_FREQ /* * need not to acquire the freq_lock in interrupt. */ if (!in_interrupt()) { down(&host->freq_lock); } #endif #ifdef CONFIG_MTD_NAND_AK98 /* * need not to acquire the nand_lock in interrupt. */ if (!in_interrupt()) { down(&nand_lock); } #endif ak98_group_pin_config(); /* *when transmit data, alloc the L2 buffer Id. */ if(mrq->data) { l2_mci_bufid = ak98_l2_alloc(ADDR_MMC_SD); if (BUF_NULL == l2_mci_bufid) { printk("L2 buffer malloc fail!\n"); BUG(); } ak98_l2_clr_status(l2_mci_bufid); } spin_lock_irqsave(&host->lock, flags); if (mrq->data && (mrq->data->flags & MMC_DATA_READ)) ak98_mci_start_data(host, mrq->data); ak98_mci_start_command(host, mrq->cmd); spin_unlock_irqrestore(&host->lock, flags); }
static void ak98_sdio_send_request(struct mmc_host *mmc) { struct ak98_mci_host *host = mmc_priv(mmc); struct mmc_request *mrq = host->mrq; unsigned long flags; #ifdef CONFIG_CPU_FREQ /* * need not to acquire the freq_lock in interrupt. */ if (!in_interrupt()) { down(&host->freq_lock); } #endif if(mrq->data || mrq->cmd->data) { l2_sdio_bufid = ak98_l2_alloc(ADDR_SDIO); if (BUF_NULL == l2_sdio_bufid) { printk("L2 buffer malloc fail!\n"); BUG(); } ak98_l2_clr_status(l2_sdio_bufid); } spin_lock_irqsave(&host->lock, flags); if (mrq->data && (mrq->data->flags & MMC_DATA_READ)) ak98_sdio_start_data(host, mrq->data); ak98_sdio_start_command(host, mrq->cmd); spin_unlock_irqrestore(&host->lock, flags); }