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

Commit 0b58c153 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: host: Set max frequency when disabling clock scaling"

parents b65b7cae 34540b28
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -566,11 +566,16 @@ static ssize_t store_enable(struct device *dev,
	if (!host || kstrtoul(buf, 0, &value))
		return -EINVAL;

	mmc_claim_host(host);
	if (!value && host->clk_scaling.enable) {
		/*turnning off clock scaling*/
	mmc_get_card(host->card);

	if (!value) {
		/*turning off clock scaling*/
		mmc_exit_clk_scaling(host);
		host->caps2 &= ~MMC_CAP2_CLK_SCALE;
		host->clk_scaling.state = MMC_LOAD_HIGH;
		/* Set to max. frequency when disabling */
		mmc_clk_update_freq(host, host->card->clk_scaling_highest,
					host->clk_scaling.state);
	} else if (value) {
		/* starting clock scaling, will restart in case started */
		host->caps2 |= MMC_CAP2_CLK_SCALE;
@@ -579,7 +584,7 @@ static ssize_t store_enable(struct device *dev,
		mmc_init_clk_scaling(host);
	}

	mmc_release_host(host);
	mmc_put_card(host->card);

	return count;
}