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

Commit 70bc2b79 authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: sdhci-msm: Store clock scaling frequencies in a dedicated table



Use a separate table to store the platform specific clock-scaling
frequencies.

The generic table where these frequencies used to be stored, would
get updated (in some cases) during clock scaling initialization.
But when a new card is inserted (In the case of a removable card),
the frequencies supported by the card should be compared against the
platform specific frequencies.

By storing these values in a separate table, these values would
remain intact and this table can be used for initializing the
generic table during clock-scaling initialization.

Change-Id: I5729f18a975f849bc2965a946473a9cdbd81e94a
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 28bf2d8b
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1837,12 +1837,12 @@ struct sdhci_msm_pltfm_data *sdhci_msm_populate_pdata(struct device *dev,
	}
	}


	if (sdhci_msm_dt_get_array(dev, "qcom,devfreq,freq-table",
	if (sdhci_msm_dt_get_array(dev, "qcom,devfreq,freq-table",
			&msm_host->mmc->clk_scaling.freq_table,
			&msm_host->mmc->clk_scaling.pltfm_freq_table,
			&msm_host->mmc->clk_scaling.freq_table_sz, 0))
			&msm_host->mmc->clk_scaling.pltfm_freq_table_sz, 0))
		pr_debug("%s: no clock scaling frequencies were supplied\n",
		pr_debug("%s: no clock scaling frequencies were supplied\n",
			dev_name(dev));
			dev_name(dev));
	else if (!msm_host->mmc->clk_scaling.freq_table ||
	else if (!msm_host->mmc->clk_scaling.pltfm_freq_table ||
			!msm_host->mmc->clk_scaling.freq_table_sz)
			!msm_host->mmc->clk_scaling.pltfm_freq_table_sz)
		dev_err(dev, "bad dts clock scaling frequencies\n");
		dev_err(dev, "bad dts clock scaling frequencies\n");


	/*
	/*
+2 −0
Original line number Original line Diff line number Diff line
@@ -330,7 +330,9 @@ struct mmc_devfeq_clk_scaling {
	atomic_t	devfreq_abort;
	atomic_t	devfreq_abort;
	bool		skip_clk_scale_freq_update;
	bool		skip_clk_scale_freq_update;
	int		freq_table_sz;
	int		freq_table_sz;
	int		pltfm_freq_table_sz;
	u32		*freq_table;
	u32		*freq_table;
	u32		*pltfm_freq_table;
	unsigned long	total_busy_time_us;
	unsigned long	total_busy_time_us;
	unsigned long	target_freq;
	unsigned long	target_freq;
	unsigned long	curr_freq;
	unsigned long	curr_freq;