Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371967
b: refs/heads/master
c: a7fc5d2
h: refs/heads/master
i:
  371965: 651226e
  371963: 776f60a
  371959: 9e08fbf
  371951: 3360246
  371935: c113c67
  371903: 8803875
  371839: b3f6dc3
  371711: b6d643f
v: v3
  • Loading branch information
Stephen Warren authored and Mark Brown committed Mar 25, 2013
1 parent 811e505 commit f51e2ca
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95d36075694b0431da22c3aef3d0dccdcc781344
refs/heads/master: a7fc5d256be9fda27bb69e872e6a212542a84230
30 changes: 24 additions & 6 deletions trunk/sound/soc/tegra/tegra_asoc_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
case 88200:
if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20)
new_baseclock = 56448000;
else
else if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA30)
new_baseclock = 564480000;
else
new_baseclock = 282240000;
break;
case 8000:
case 16000:
Expand All @@ -54,8 +56,10 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
case 96000:
if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20)
new_baseclock = 73728000;
else
else if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA30)
new_baseclock = 552960000;
else
new_baseclock = 368640000;
break;
default:
return -EINVAL;
Expand Down Expand Up @@ -169,31 +173,45 @@ int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
struct device *dev)
{
int ret;
bool new_clocks = false;

data->dev = dev;

if (of_machine_is_compatible("nvidia,tegra20"))
data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA20;
else if (of_machine_is_compatible("nvidia,tegra30"))
data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA30;
else
else if (of_machine_is_compatible("nvidia,tegra114")) {
data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA114;
new_clocks = true;
} else {
dev_err(data->dev, "SoC unknown to Tegra ASoC utils\n");
return -EINVAL;
}

data->clk_pll_a = clk_get_sys(NULL, "pll_a");
if (new_clocks)
data->clk_pll_a = clk_get(dev, "pll_a");
else
data->clk_pll_a = clk_get_sys(NULL, "pll_a");
if (IS_ERR(data->clk_pll_a)) {
dev_err(data->dev, "Can't retrieve clk pll_a\n");
ret = PTR_ERR(data->clk_pll_a);
goto err;
}

data->clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0");
if (new_clocks)
data->clk_pll_a_out0 = clk_get(dev, "pll_a_out0");
else
data->clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0");
if (IS_ERR(data->clk_pll_a_out0)) {
dev_err(data->dev, "Can't retrieve clk pll_a_out0\n");
ret = PTR_ERR(data->clk_pll_a_out0);
goto err_put_pll_a;
}

if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20)
if (new_clocks)
data->clk_cdev1 = clk_get(dev, "mclk");
else if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20)
data->clk_cdev1 = clk_get_sys(NULL, "cdev1");
else
data->clk_cdev1 = clk_get_sys("extern1", NULL);
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/soc/tegra/tegra_asoc_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct device;
enum tegra_asoc_utils_soc {
TEGRA_ASOC_UTILS_SOC_TEGRA20,
TEGRA_ASOC_UTILS_SOC_TEGRA30,
TEGRA_ASOC_UTILS_SOC_TEGRA114,
};

struct tegra_asoc_utils_data {
Expand Down

0 comments on commit f51e2ca

Please sign in to comment.