diff options
| -rw-r--r-- | sound/soc/samsung/i2s.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 5f9b255a8b38..d2533dbc8399 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
| @@ -68,6 +68,8 @@ struct i2s_dai { | |||
| 68 | #define DAI_OPENED (1 << 0) /* Dai is opened */ | 68 | #define DAI_OPENED (1 << 0) /* Dai is opened */ |
| 69 | #define DAI_MANAGER (1 << 1) /* Dai is the manager */ | 69 | #define DAI_MANAGER (1 << 1) /* Dai is the manager */ |
| 70 | unsigned mode; | 70 | unsigned mode; |
| 71 | /* CDCLK pin direction: 0 - input, 1 - output */ | ||
| 72 | unsigned int cdclk_out:1; | ||
| 71 | /* Driver for this DAI */ | 73 | /* Driver for this DAI */ |
| 72 | struct snd_soc_dai_driver i2s_dai_drv; | 74 | struct snd_soc_dai_driver i2s_dai_drv; |
| 73 | /* DMA parameters */ | 75 | /* DMA parameters */ |
| @@ -737,6 +739,9 @@ static int i2s_startup(struct snd_pcm_substream *substream, | |||
| 737 | 739 | ||
| 738 | spin_unlock_irqrestore(&lock, flags); | 740 | spin_unlock_irqrestore(&lock, flags); |
| 739 | 741 | ||
| 742 | if (!is_opened(other) && i2s->cdclk_out) | ||
| 743 | i2s_set_sysclk(dai, SAMSUNG_I2S_CDCLK, | ||
| 744 | 0, SND_SOC_CLOCK_OUT); | ||
| 740 | return 0; | 745 | return 0; |
| 741 | } | 746 | } |
| 742 | 747 | ||
| @@ -752,9 +757,13 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, | |||
| 752 | i2s->mode &= ~DAI_OPENED; | 757 | i2s->mode &= ~DAI_OPENED; |
| 753 | i2s->mode &= ~DAI_MANAGER; | 758 | i2s->mode &= ~DAI_MANAGER; |
| 754 | 759 | ||
| 755 | if (is_opened(other)) | 760 | if (is_opened(other)) { |
| 756 | other->mode |= DAI_MANAGER; | 761 | other->mode |= DAI_MANAGER; |
| 757 | 762 | } else { | |
| 763 | u32 mod = readl(i2s->addr + I2SMOD); | ||
| 764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); | ||
| 765 | other->cdclk_out = i2s->cdclk_out; | ||
| 766 | } | ||
| 758 | /* Reset any constraint on RFS and BFS */ | 767 | /* Reset any constraint on RFS and BFS */ |
| 759 | i2s->rfs = 0; | 768 | i2s->rfs = 0; |
| 760 | i2s->bfs = 0; | 769 | i2s->bfs = 0; |
