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

Commit 44350993 authored by Aapo Vienamo's avatar Aapo Vienamo Committed by Ulf Hansson
Browse files

mmc: tegra: Add and use tegra_sdhci_get_max_clock()



Implement and use tegra_sdhci_get_max_clock() which returns the true
maximum host clock rate. The issue with tegra_sdhci_get_max_clock() is
that it returns the current clock rate of the host instead of the
maximum one, which can lead to unnecessarily small clock rates.

This differs from the previous implementation of
tegra_sdhci_get_max_clock() in that it doesn't divide the result by two.

Signed-off-by: default avatarAapo Vienamo <avienamo@nvidia.com>
Tested-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 8312b97c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -235,6 +235,13 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host,
	sdhci_set_uhs_signaling(host, timing);
}

static unsigned int tegra_sdhci_get_max_clock(struct sdhci_host *host)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);

	return clk_round_rate(pltfm_host->clk, UINT_MAX);
}

static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap)
{
	u32 reg;
@@ -299,7 +306,7 @@ static const struct sdhci_ops tegra_sdhci_ops = {
	.platform_execute_tuning = tegra_sdhci_execute_tuning,
	.set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
	.voltage_switch = tegra_sdhci_voltage_switch,
	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
	.get_max_clock = tegra_sdhci_get_max_clock,
};

static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
@@ -356,7 +363,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
	.platform_execute_tuning = tegra_sdhci_execute_tuning,
	.set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
	.voltage_switch = tegra_sdhci_voltage_switch,
	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
	.get_max_clock = tegra_sdhci_get_max_clock,
};

static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {