forked from luck/tmp_suning_uos_patched
[MMC] Move set_ios debugging into mmc.c
Rather than having every driver duplicate the set_ios debugging, provide a single version in mmc.c which can be expanded as we add additional functionality. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
fe10c6abea
commit
920e70c5c6
|
@ -621,9 +621,6 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
struct at91mci_host *host = mmc_priv(mmc);
|
||||
unsigned long at91_master_clock = clk_get_rate(mci_clk);
|
||||
|
||||
DBG("Clock %uHz, busmode %u, powermode %u, Vdd %u\n",
|
||||
ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
|
||||
|
||||
if (host)
|
||||
host->bus_mode = ios->bus_mode;
|
||||
else
|
||||
|
|
|
@ -720,10 +720,6 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
|
|||
{
|
||||
struct au1xmmc_host *host = mmc_priv(mmc);
|
||||
|
||||
DBG("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) {
|
||||
|
|
|
@ -807,10 +807,6 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
struct imxmci_host *host = mmc_priv(mmc);
|
||||
int prescaler;
|
||||
|
||||
dev_dbg(mmc_dev(host->mmc), "clock %u power %u vdd %u width %u\n",
|
||||
ios->clock, ios->power_mode, ios->vdd,
|
||||
(ios->bus_width==MMC_BUS_WIDTH_4)?4:1);
|
||||
|
||||
if( ios->bus_width==MMC_BUS_WIDTH_4 ) {
|
||||
host->actual_bus_width = MMC_BUS_WIDTH_4;
|
||||
imx_gpio_mode(PB11_PF_SD_DAT3);
|
||||
|
|
|
@ -69,10 +69,13 @@ static const unsigned int tacc_mant[] = {
|
|||
void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
|
||||
{
|
||||
struct mmc_command *cmd = mrq->cmd;
|
||||
int err = mrq->cmd->error;
|
||||
pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n",
|
||||
cmd->opcode, err, cmd->resp[0], cmd->resp[1],
|
||||
cmd->resp[2], cmd->resp[3]);
|
||||
int err = cmd->error;
|
||||
|
||||
pr_debug("%s: req done (CMD%u): %d/%d/%d: %08x %08x %08x %08x\n",
|
||||
mmc_hostname(host), cmd->opcode, err,
|
||||
mrq->data ? mrq->data->error : 0,
|
||||
mrq->stop ? mrq->stop->error : 0,
|
||||
cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
|
||||
|
||||
if (err && cmd->retries) {
|
||||
cmd->retries--;
|
||||
|
@ -96,8 +99,9 @@ EXPORT_SYMBOL(mmc_request_done);
|
|||
void
|
||||
mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
|
||||
{
|
||||
pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n",
|
||||
mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
|
||||
pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
|
||||
mmc_hostname(host), mrq->cmd->opcode,
|
||||
mrq->cmd->arg, mrq->cmd->flags);
|
||||
|
||||
WARN_ON(host->card_busy == NULL);
|
||||
|
||||
|
@ -311,6 +315,18 @@ void mmc_release_host(struct mmc_host *host)
|
|||
|
||||
EXPORT_SYMBOL(mmc_release_host);
|
||||
|
||||
static inline void mmc_set_ios(struct mmc_host *host)
|
||||
{
|
||||
struct mmc_ios *ios = &host->ios;
|
||||
|
||||
pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
|
||||
mmc_hostname(host), ios->clock, ios->bus_mode,
|
||||
ios->power_mode, ios->chip_select, ios->vdd,
|
||||
ios->bus_width);
|
||||
|
||||
host->ops->set_ios(host, ios);
|
||||
}
|
||||
|
||||
static int mmc_select_card(struct mmc_host *host, struct mmc_card *card)
|
||||
{
|
||||
int err;
|
||||
|
@ -363,7 +379,7 @@ static int mmc_select_card(struct mmc_host *host, struct mmc_card *card)
|
|||
}
|
||||
}
|
||||
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
return MMC_ERR_NONE;
|
||||
}
|
||||
|
@ -414,7 +430,7 @@ static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
|
|||
ocr = 3 << bit;
|
||||
|
||||
host->ios.vdd = bit;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
} else {
|
||||
ocr = 0;
|
||||
}
|
||||
|
@ -667,7 +683,7 @@ static void mmc_idle_cards(struct mmc_host *host)
|
|||
struct mmc_command cmd;
|
||||
|
||||
host->ios.chip_select = MMC_CS_HIGH;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
mmc_delay(1);
|
||||
|
||||
|
@ -680,7 +696,7 @@ static void mmc_idle_cards(struct mmc_host *host)
|
|||
mmc_delay(1);
|
||||
|
||||
host->ios.chip_select = MMC_CS_DONTCARE;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
mmc_delay(1);
|
||||
}
|
||||
|
@ -705,13 +721,13 @@ static void mmc_power_up(struct mmc_host *host)
|
|||
host->ios.chip_select = MMC_CS_DONTCARE;
|
||||
host->ios.power_mode = MMC_POWER_UP;
|
||||
host->ios.bus_width = MMC_BUS_WIDTH_1;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
mmc_delay(1);
|
||||
|
||||
host->ios.clock = host->f_min;
|
||||
host->ios.power_mode = MMC_POWER_ON;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
mmc_delay(2);
|
||||
}
|
||||
|
@ -724,7 +740,7 @@ static void mmc_power_off(struct mmc_host *host)
|
|||
host->ios.chip_select = MMC_CS_DONTCARE;
|
||||
host->ios.power_mode = MMC_POWER_OFF;
|
||||
host->ios.bus_width = MMC_BUS_WIDTH_1;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
}
|
||||
|
||||
static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
||||
|
@ -972,7 +988,8 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host)
|
|||
if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr)
|
||||
max_dtr = card->csd.max_dtr;
|
||||
|
||||
pr_debug("MMC: selected %d.%03dMHz transfer rate\n",
|
||||
pr_debug("%s: selected %d.%03dMHz transfer rate\n",
|
||||
mmc_hostname(host),
|
||||
max_dtr / 1000000, (max_dtr / 1000) % 1000);
|
||||
|
||||
return max_dtr;
|
||||
|
@ -1047,7 +1064,7 @@ static void mmc_setup(struct mmc_host *host)
|
|||
} else {
|
||||
host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
|
||||
host->ios.clock = host->f_min;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
/*
|
||||
* We should remember the OCR mask from the existing
|
||||
|
@ -1083,7 +1100,7 @@ static void mmc_setup(struct mmc_host *host)
|
|||
* Ok, now switch to push-pull mode.
|
||||
*/
|
||||
host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
|
||||
mmc_read_csds(host);
|
||||
|
||||
|
@ -1129,7 +1146,7 @@ static void mmc_rescan(void *data)
|
|||
* attached cards and the host support.
|
||||
*/
|
||||
host->ios.clock = mmc_calculate_clock(host);
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
mmc_set_ios(host);
|
||||
}
|
||||
|
||||
mmc_release_host(host);
|
||||
|
|
|
@ -402,9 +402,6 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
struct mmci_host *host = mmc_priv(mmc);
|
||||
u32 clk = 0, pwr = 0;
|
||||
|
||||
DBG(host, "clock %uHz busmode %u powermode %u Vdd %u\n",
|
||||
ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
|
||||
|
||||
if (ios->clock) {
|
||||
if (ios->clock >= host->mclk) {
|
||||
clk = MCI_CLK_BYPASS;
|
||||
|
|
|
@ -365,10 +365,6 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
{
|
||||
struct pxamci_host *host = mmc_priv(mmc);
|
||||
|
||||
pr_debug("PXAMCI: clock %u power %u vdd %u.%02u\n",
|
||||
ios->clock, ios->power_mode, ios->vdd / 100,
|
||||
ios->vdd % 100);
|
||||
|
||||
if (ios->clock) {
|
||||
unsigned int clk = CLOCKRATE / ios->clock;
|
||||
if (CLOCKRATE / clk > ios->clock)
|
||||
|
|
|
@ -570,10 +570,6 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
|
||||
spin_lock_irqsave(&host->lock, flags);
|
||||
|
||||
DBG("clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
|
||||
ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select,
|
||||
ios->vdd, ios->bus_width);
|
||||
|
||||
/*
|
||||
* Reset the chip on each power off.
|
||||
* Should clear out any weird states.
|
||||
|
|
|
@ -931,10 +931,6 @@ static void wbsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|||
struct wbsd_host *host = mmc_priv(mmc);
|
||||
u8 clk, setup, pwr;
|
||||
|
||||
DBGF("clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
|
||||
ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select,
|
||||
ios->vdd, ios->bus_width);
|
||||
|
||||
spin_lock_bh(&host->lock);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user