aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2014-05-23 08:05:39 -0400
committerMark Brown <broonie@linaro.org>2014-05-26 12:04:20 -0400
commit88ce1465ec471cfb978744ab2ab40460c6b96b4c (patch)
tree59335459221ef10d11e2af111abdada832581809 /sound
parenta6aba536ab60274e8f46ae3a5966b81c35f845fa (diff)
ASoC: samsung: Use params_width()
commit 8c5178fca4ce ("ALSA: Add params_width() helpers") introduces a helper to get the sample width. Updating Samsung related sound drivers to use this helper. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/i2s.c8
-rw-r--r--sound/soc/samsung/pcm.c4
-rw-r--r--sound/soc/samsung/s3c-i2s-v2.c8
-rw-r--r--sound/soc/samsung/s3c2412-i2s.c6
-rw-r--r--sound/soc/samsung/s3c24xx-i2s.c6
-rw-r--r--sound/soc/samsung/smdk_wm8580.c8
-rw-r--r--sound/soc/samsung/smdk_wm8994.c2
-rw-r--r--sound/soc/samsung/spdif.c4
8 files changed, 22 insertions, 24 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 043d98645a54..2ac76fa3e742 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -676,8 +676,8 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
676 if (is_manager(i2s)) 676 if (is_manager(i2s))
677 mod &= ~MOD_BLC_MASK; 677 mod &= ~MOD_BLC_MASK;
678 678
679 switch (params_format(params)) { 679 switch (params_width(params)) {
680 case SNDRV_PCM_FORMAT_S8: 680 case 8:
681 if (is_secondary(i2s)) 681 if (is_secondary(i2s))
682 mod |= MOD_BLCS_8BIT; 682 mod |= MOD_BLCS_8BIT;
683 else 683 else
@@ -685,7 +685,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
685 if (is_manager(i2s)) 685 if (is_manager(i2s))
686 mod |= MOD_BLC_8BIT; 686 mod |= MOD_BLC_8BIT;
687 break; 687 break;
688 case SNDRV_PCM_FORMAT_S16_LE: 688 case 16:
689 if (is_secondary(i2s)) 689 if (is_secondary(i2s))
690 mod |= MOD_BLCS_16BIT; 690 mod |= MOD_BLCS_16BIT;
691 else 691 else
@@ -693,7 +693,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
693 if (is_manager(i2s)) 693 if (is_manager(i2s))
694 mod |= MOD_BLC_16BIT; 694 mod |= MOD_BLC_16BIT;
695 break; 695 break;
696 case SNDRV_PCM_FORMAT_S24_LE: 696 case 24:
697 if (is_secondary(i2s)) 697 if (is_secondary(i2s))
698 mod |= MOD_BLCS_24BIT; 698 mod |= MOD_BLCS_24BIT;
699 else 699 else
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index a3c9c9cba3b0..4c5f97fe45c8 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -283,8 +283,8 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
283 dev_dbg(pcm->dev, "Entered %s\n", __func__); 283 dev_dbg(pcm->dev, "Entered %s\n", __func__);
284 284
285 /* Strictly check for sample size */ 285 /* Strictly check for sample size */
286 switch (params_format(params)) { 286 switch (params_width(params)) {
287 case SNDRV_PCM_FORMAT_S16_LE: 287 case 16:
288 break; 288 break;
289 default: 289 default:
290 return -EINVAL; 290 return -EINVAL;
diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
index 77a2ae50dc94..0ff4bbe23af3 100644
--- a/sound/soc/samsung/s3c-i2s-v2.c
+++ b/sound/soc/samsung/s3c-i2s-v2.c
@@ -322,13 +322,13 @@ static int s3c_i2sv2_hw_params(struct snd_pcm_substream *substream,
322 322
323 iismod &= ~S3C64XX_IISMOD_BLC_MASK; 323 iismod &= ~S3C64XX_IISMOD_BLC_MASK;
324 /* Sample size */ 324 /* Sample size */
325 switch (params_format(params)) { 325 switch (params_width(params)) {
326 case SNDRV_PCM_FORMAT_S8: 326 case 8:
327 iismod |= S3C64XX_IISMOD_BLC_8BIT; 327 iismod |= S3C64XX_IISMOD_BLC_8BIT;
328 break; 328 break;
329 case SNDRV_PCM_FORMAT_S16_LE: 329 case 16:
330 break; 330 break;
331 case SNDRV_PCM_FORMAT_S24_LE: 331 case 24:
332 iismod |= S3C64XX_IISMOD_BLC_24BIT; 332 iismod |= S3C64XX_IISMOD_BLC_24BIT;
333 break; 333 break;
334 } 334 }
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index 843f315dcb3a..08c059be9104 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -120,11 +120,11 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
120 iismod = readl(i2s->regs + S3C2412_IISMOD); 120 iismod = readl(i2s->regs + S3C2412_IISMOD);
121 pr_debug("%s: r: IISMOD: %x\n", __func__, iismod); 121 pr_debug("%s: r: IISMOD: %x\n", __func__, iismod);
122 122
123 switch (params_format(params)) { 123 switch (params_width(params)) {
124 case SNDRV_PCM_FORMAT_S8: 124 case 8:
125 iismod |= S3C2412_IISMOD_8BIT; 125 iismod |= S3C2412_IISMOD_8BIT;
126 break; 126 break;
127 case SNDRV_PCM_FORMAT_S16_LE: 127 case 16:
128 iismod &= ~S3C2412_IISMOD_8BIT; 128 iismod &= ~S3C2412_IISMOD_8BIT;
129 break; 129 break;
130 } 130 }
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 4a6d206db222..9aba9fb7df0e 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -248,12 +248,12 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
248 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 248 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
249 pr_debug("hw_params r: IISMOD: %x\n", iismod); 249 pr_debug("hw_params r: IISMOD: %x\n", iismod);
250 250
251 switch (params_format(params)) { 251 switch (params_width(params)) {
252 case SNDRV_PCM_FORMAT_S8: 252 case 8:
253 iismod &= ~S3C2410_IISMOD_16BIT; 253 iismod &= ~S3C2410_IISMOD_16BIT;
254 dma_data->dma_size = 1; 254 dma_data->dma_size = 1;
255 break; 255 break;
256 case SNDRV_PCM_FORMAT_S16_LE: 256 case 16:
257 iismod |= S3C2410_IISMOD_16BIT; 257 iismod |= S3C2410_IISMOD_16BIT;
258 dma_data->dma_size = 2; 258 dma_data->dma_size = 2;
259 break; 259 break;
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c
index 7a16b32ed673..b1a519f83b29 100644
--- a/sound/soc/samsung/smdk_wm8580.c
+++ b/sound/soc/samsung/smdk_wm8580.c
@@ -37,13 +37,11 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
37 unsigned int pll_out; 37 unsigned int pll_out;
38 int bfs, rfs, ret; 38 int bfs, rfs, ret;
39 39
40 switch (params_format(params)) { 40 switch (params_width(params)) {
41 case SNDRV_PCM_FORMAT_U8: 41 case 8:
42 case SNDRV_PCM_FORMAT_S8:
43 bfs = 16; 42 bfs = 16;
44 break; 43 break;
45 case SNDRV_PCM_FORMAT_U16_LE: 44 case 16:
46 case SNDRV_PCM_FORMAT_S16_LE:
47 bfs = 32; 45 bfs = 32;
48 break; 46 break;
49 default: 47 default:
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 682eb4f7ba0c..5b544dcf18b4 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -57,7 +57,7 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
57 int ret; 57 int ret;
58 58
59 /* AIF1CLK should be >=3MHz for optimal performance */ 59 /* AIF1CLK should be >=3MHz for optimal performance */
60 if (params_format(params) == SNDRV_PCM_FORMAT_S24_LE) 60 if (params_width(params) == 24)
61 pll_out = params_rate(params) * 384; 61 pll_out = params_rate(params) * 384;
62 else if (params_rate(params) == 8000 || params_rate(params) == 11025) 62 else if (params_rate(params) == 8000 || params_rate(params) == 11025)
63 pll_out = params_rate(params) * 512; 63 pll_out = params_rate(params) * 512;
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index e93a93e296f4..d9ffc48fce5e 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -211,8 +211,8 @@ static int spdif_hw_params(struct snd_pcm_substream *substream,
211 con |= CON_PCM_DATA; 211 con |= CON_PCM_DATA;
212 212
213 con &= ~CON_PCM_MASK; 213 con &= ~CON_PCM_MASK;
214 switch (params_format(params)) { 214 switch (params_width(params)) {
215 case SNDRV_PCM_FORMAT_S16_LE: 215 case 16:
216 con |= CON_PCM_16BIT; 216 con |= CON_PCM_16BIT;
217 break; 217 break;
218 default: 218 default: