diff options
Diffstat (limited to 'sound/soc/samsung/i2s.c')
-rw-r--r-- | sound/soc/samsung/i2s.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 87a874dc7a35..6ac7b8281a02 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * ALSA SoC Audio Layer - Samsung I2S Controller driver | 3 | * ALSA SoC Audio Layer - Samsung I2S Controller driver |
4 | * | 4 | * |
5 | * Copyright (c) 2010 Samsung Electronics Co. Ltd. | 5 | * Copyright (c) 2010 Samsung Electronics Co. Ltd. |
6 | * Jaswinder Singh <jassi.brar@samsung.com> | 6 | * Jaswinder Singh <jassisinghbrar@gmail.com> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -559,6 +559,17 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, | |||
559 | mod |= MOD_DC1_EN; | 559 | mod |= MOD_DC1_EN; |
560 | break; | 560 | break; |
561 | case 2: | 561 | case 2: |
562 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
563 | i2s->dma_playback.dma_size = 4; | ||
564 | else | ||
565 | i2s->dma_capture.dma_size = 4; | ||
566 | break; | ||
567 | case 1: | ||
568 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
569 | i2s->dma_playback.dma_size = 2; | ||
570 | else | ||
571 | i2s->dma_capture.dma_size = 2; | ||
572 | |||
562 | break; | 573 | break; |
563 | default: | 574 | default: |
564 | dev_err(&i2s->pdev->dev, "%d channels not supported\n", | 575 | dev_err(&i2s->pdev->dev, "%d channels not supported\n", |
@@ -761,15 +772,13 @@ static int i2s_trigger(struct snd_pcm_substream *substream, | |||
761 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 772 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
762 | local_irq_save(flags); | 773 | local_irq_save(flags); |
763 | 774 | ||
764 | if (capture) | 775 | if (capture) { |
765 | i2s_rxctrl(i2s, 0); | 776 | i2s_rxctrl(i2s, 0); |
766 | else | ||
767 | i2s_txctrl(i2s, 0); | ||
768 | |||
769 | if (capture) | ||
770 | i2s_fifo(i2s, FIC_RXFLUSH); | 777 | i2s_fifo(i2s, FIC_RXFLUSH); |
771 | else | 778 | } else { |
779 | i2s_txctrl(i2s, 0); | ||
772 | i2s_fifo(i2s, FIC_TXFLUSH); | 780 | i2s_fifo(i2s, FIC_TXFLUSH); |
781 | } | ||
773 | 782 | ||
774 | local_irq_restore(flags); | 783 | local_irq_restore(flags); |
775 | break; | 784 | break; |
@@ -965,7 +974,7 @@ struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) | |||
965 | i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS; | 974 | i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS; |
966 | 975 | ||
967 | if (!sec) { | 976 | if (!sec) { |
968 | i2s->i2s_dai_drv.capture.channels_min = 2; | 977 | i2s->i2s_dai_drv.capture.channels_min = 1; |
969 | i2s->i2s_dai_drv.capture.channels_max = 2; | 978 | i2s->i2s_dai_drv.capture.channels_max = 2; |
970 | i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; | 979 | i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; |
971 | i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; | 980 | i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; |
@@ -1143,7 +1152,7 @@ static struct platform_driver samsung_i2s_driver = { | |||
1143 | module_platform_driver(samsung_i2s_driver); | 1152 | module_platform_driver(samsung_i2s_driver); |
1144 | 1153 | ||
1145 | /* Module information */ | 1154 | /* Module information */ |
1146 | MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); | 1155 | MODULE_AUTHOR("Jaswinder Singh, <jassisinghbrar@gmail.com>"); |
1147 | MODULE_DESCRIPTION("Samsung I2S Interface"); | 1156 | MODULE_DESCRIPTION("Samsung I2S Interface"); |
1148 | MODULE_ALIAS("platform:samsung-i2s"); | 1157 | MODULE_ALIAS("platform:samsung-i2s"); |
1149 | MODULE_LICENSE("GPL"); | 1158 | MODULE_LICENSE("GPL"); |