Browse Source

ASoC: tegra: ensure clocks are enabled when touching registers

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>
Stephen Warren 13 years ago
parent
commit
cd1506736f
2 changed files with 8 additions and 0 deletions
  1. 4 0
      sound/soc/tegra/tegra_i2s.c
  2. 4 0
      sound/soc/tegra/tegra_spdif.c

+ 4 - 0
sound/soc/tegra/tegra_i2s.c

@@ -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;
 }
 

+ 4 - 0
sound/soc/tegra/tegra_spdif.c

@@ -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;
 }