mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: Tegra: Don't return mclk_changed from utils_set_rate
Only the clock programming code needs to know whether the clocks changed, and that is encapsulated within tegra_asoc_utils_set_rate(). The machine driver's call to snd_soc_dai_set_sysclk(codec_dai, ...) is safe irrespective of whether the clocks changed. (Applying Mark's TrimSlice review comments to the existing driver) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
committed by
Sameer Pujar
parent
4f00d6b233
commit
36b45204ee
@@ -28,9 +28,10 @@
|
|||||||
#include "tegra_asoc_utils.h"
|
#include "tegra_asoc_utils.h"
|
||||||
|
|
||||||
int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
|
int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
|
||||||
int mclk, int *mclk_change)
|
int mclk)
|
||||||
{
|
{
|
||||||
int new_baseclock;
|
int new_baseclock;
|
||||||
|
bool clk_change;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (srate) {
|
switch (srate) {
|
||||||
@@ -52,10 +53,10 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*mclk_change = ((new_baseclock != data->set_baseclock) ||
|
clk_change = ((new_baseclock != data->set_baseclock) ||
|
||||||
(mclk != data->set_mclk));
|
(mclk != data->set_mclk));
|
||||||
if (!*mclk_change)
|
if (!clk_change)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
data->set_baseclock = 0;
|
data->set_baseclock = 0;
|
||||||
data->set_mclk = 0;
|
data->set_mclk = 0;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ struct tegra_asoc_utils_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
|
int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
|
||||||
int mclk, int *mclk_change);
|
int mclk);
|
||||||
int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
|
int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
|
||||||
struct device *dev);
|
struct device *dev);
|
||||||
void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data);
|
void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data);
|
||||||
|
|||||||
Reference in New Issue
Block a user