Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305576
b: refs/heads/master
c: 30d436a
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Warren authored and Mark Brown committed Apr 1, 2012
1 parent 2db2c8e commit 9aeb0aa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 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: c0d5a47ca86047aca1616b744ab3ef31b3448994
refs/heads/master: 30d436a64415e6d01b8696d6288abe7ad0b383b5
14 changes: 4 additions & 10 deletions trunk/sound/soc/tegra/tegra_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,15 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
if (i2sclock % (2 * srate))
reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE;

if (!i2s->clk_refs)
clk_enable(i2s->clk_i2s);
clk_enable(i2s->clk_i2s);

tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg);

tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR,
TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS |
TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS);

if (!i2s->clk_refs)
clk_disable(i2s->clk_i2s);
clk_disable(i2s->clk_i2s);

return 0;
}
Expand Down Expand Up @@ -268,9 +266,7 @@ static int tegra_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
if (!i2s->clk_refs)
clk_enable(i2s->clk_i2s);
i2s->clk_refs++;
clk_enable(i2s->clk_i2s);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
tegra_i2s_start_playback(i2s);
else
Expand All @@ -283,9 +279,7 @@ static int tegra_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
tegra_i2s_stop_playback(i2s);
else
tegra_i2s_stop_capture(i2s);
i2s->clk_refs--;
if (!i2s->clk_refs)
clk_disable(i2s->clk_i2s);
clk_disable(i2s->clk_i2s);
break;
default:
return -EINVAL;
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/tegra/tegra_i2s.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
struct tegra_i2s {
struct snd_soc_dai_driver dai;
struct clk *clk_i2s;
int clk_refs;
struct tegra_pcm_dma_params capture_dma_data;
struct tegra_pcm_dma_params playback_dma_data;
void __iomem *regs;
Expand Down
8 changes: 2 additions & 6 deletions trunk/sound/soc/tegra/tegra_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,14 @@ static int tegra_spdif_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
if (!spdif->clk_refs)
clk_enable(spdif->clk_spdif_out);
spdif->clk_refs++;
clk_enable(spdif->clk_spdif_out);
tegra_spdif_start_playback(spdif);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
tegra_spdif_stop_playback(spdif);
spdif->clk_refs--;
if (!spdif->clk_refs)
clk_disable(spdif->clk_spdif_out);
clk_disable(spdif->clk_spdif_out);
break;
default:
return -EINVAL;
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/tegra/tegra_spdif.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@

struct tegra_spdif {
struct clk *clk_spdif_out;
int clk_refs;
struct tegra_pcm_dma_params capture_dma_data;
struct tegra_pcm_dma_params playback_dma_data;
void __iomem *regs;
Expand Down

0 comments on commit 9aeb0aa

Please sign in to comment.