Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c58a8509 authored by Ulf Hansson's avatar Ulf Hansson Committed by Russell King
Browse files

ARM: 7718/1: mmc: mmci: Set actual clock for debug purpose



Update cclk to the acutal used value and copy it to the actual_clock
variable in the mmc host for debug purpose.

Signed-off-by: default avatarFredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 665ba56f
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -196,6 +196,9 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
	struct variant_data *variant = host->variant;
	struct variant_data *variant = host->variant;
	u32 clk = variant->clkreg;
	u32 clk = variant->clkreg;


	/* Make sure cclk reflects the current calculated clock */
	host->cclk = 0;

	if (desired) {
	if (desired) {
		if (desired >= host->mclk) {
		if (desired >= host->mclk) {
			clk = MCI_CLK_BYPASS;
			clk = MCI_CLK_BYPASS;
@@ -230,6 +233,9 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
		/* clk |= MCI_CLK_PWRSAVE; */
		/* clk |= MCI_CLK_PWRSAVE; */
	}
	}


	/* Set actual clock for debug */
	host->mmc->actual_clock = host->cclk;

	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
		clk |= MCI_4BIT_BUS;
		clk |= MCI_4BIT_BUS;
	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)
	if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)