Skip to content

Commit

Permalink
ASoC: tegra: ensure clocks are enabled when touching registers
Browse files Browse the repository at this point in the history
Debugfs files could be accessed any time, so explicitly enable clocks
when reading registers to generate debugfs file content.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Apr 2, 2012
1 parent f0cdcf3 commit cd15067
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/tegra/tegra_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ static int tegra_i2s_show(struct seq_file *s, void *unused)
struct tegra_i2s *i2s = s->private;
int i;

clk_enable(i2s->clk_i2s);

for (i = 0; i < ARRAY_SIZE(regs); i++) {
u32 val = tegra_i2s_read(i2s, regs[i].offset);
seq_printf(s, "%s = %08x\n", regs[i].name, val);
}

clk_disable(i2s->clk_i2s);

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/tegra/tegra_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ static int tegra_spdif_show(struct seq_file *s, void *unused)
struct tegra_spdif *spdif = s->private;
int i;

clk_enable(spdif->clk_spdif_out);

for (i = 0; i < ARRAY_SIZE(regs); i++) {
u32 val = tegra_spdif_read(spdif, regs[i].offset);
seq_printf(s, "%s = %08x\n", regs[i].name, val);
}

clk_disable(spdif->clk_spdif_out);

return 0;
}

Expand Down

0 comments on commit cd15067

Please sign in to comment.