diff options
author | Nikesh Oswal <noswal@nvidia.com> | 2011-10-31 11:32:52 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-23 15:37:02 -0700 |
commit | 4435fa3c09f1dee15bf19284ee73955ec7f8a389 (patch) | |
tree | 41705932380ed7a4935149c931ed88d18e2c2117 | |
parent | 7467b82ab32f5597c1043c71a175b8d385d47bea (diff) |
asoc: tegra: add code to enable/disable clocks
add code to enable/disable pll_a and cdev1 clocks
Bug: 862023
Change-Id: If5b6014f82651e2286802ba6d76f77b1b5419b41
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/61085
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Rddb3206531e76e7ea28df691f6aa86a50f7c66d0
-rw-r--r-- | sound/soc/tegra/tegra_asoc_utils.c | 35 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_asoc_utils.h | 2 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c index 51e6ad09f931..c469214390a0 100644 --- a/sound/soc/tegra/tegra_asoc_utils.c +++ b/sound/soc/tegra/tegra_asoc_utils.c @@ -113,6 +113,41 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate, } EXPORT_SYMBOL_GPL(tegra_asoc_utils_set_rate); +int tegra_asoc_utils_clk_enable(struct tegra_asoc_utils_data *data) +{ + int err; + + err = clk_enable(data->clk_pll_a); + if (err) { + dev_err(data->dev, "Can't enable pll_a: %d\n", err); + return err; + } + + err = clk_enable(data->clk_pll_a_out0); + if (err) { + dev_err(data->dev, "Can't enable pll_a_out0: %d\n", err); + return err; + } + + err = clk_enable(data->clk_cdev1); + if (err) { + dev_err(data->dev, "Can't enable cdev1: %d\n", err); + return err; + } + + return 0; +} +EXPORT_SYMBOL_GPL(tegra_asoc_utils_clk_enable); + +int tegra_asoc_utils_clk_disable(struct tegra_asoc_utils_data *data) +{ + clk_disable(data->clk_cdev1); + clk_disable(data->clk_pll_a_out0); + clk_disable(data->clk_pll_a); + return 0; +} +EXPORT_SYMBOL_GPL(tegra_asoc_utils_clk_disable); + int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data, struct device *dev) { diff --git a/sound/soc/tegra/tegra_asoc_utils.h b/sound/soc/tegra/tegra_asoc_utils.h index 9aae91e0b4a5..9d8471861d6e 100644 --- a/sound/soc/tegra/tegra_asoc_utils.h +++ b/sound/soc/tegra/tegra_asoc_utils.h @@ -41,6 +41,8 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate, int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data, struct device *dev); void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data); +int tegra_asoc_utils_clk_enable(struct tegra_asoc_utils_data *data); +int tegra_asoc_utils_clk_disable(struct tegra_asoc_utils_data *data); #endif |