aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 12:22:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 12:22:27 -0400
commitccf2779544eecfcc5447e2028d1029b6d4ff7bb6 (patch)
tree0270d2486ed1e2d1a8be9953adb8005f8dbd8ab7
parent7cece14acd063dd1c4e8933461d44ec6a5a5517b (diff)
parentfd403dc84f29aee613d13bde5656ba74cdee1e7b (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: [ALSA] soc - neo1973_wm8753.c add suspend and shutdown hooks for lm4857 chip [ALSA] soc - neo1973_wm8753.c change maintainer contact info [ALSA] soc - neo1973_wm8753.c cleanup checkpatch issues [ALSA] soc - ln2440sbc_alc650 - Fix checkpatch warnings [ALSA] soc - s3c24xx-pcm - Fix checkpatch warnings [ALSA] soc - s3c2443-ac97 - Fix checkpatch warnings [ALSA] soc - wm8753 - Clean up checkpatch warnings
-rw-r--r--sound/soc/codecs/wm8753.c34
-rw-r--r--sound/soc/s3c24xx/ln2440sbc_alc650.c4
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c58
-rw-r--r--sound/soc/s3c24xx/s3c2443-ac97.c9
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c33
5 files changed, 85 insertions, 53 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 76a5c7b05dfb..fb41826c4c4c 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -150,7 +150,7 @@ static int wm8753_write(struct snd_soc_codec *codec, unsigned int reg,
150 data[0] = (reg << 1) | ((value >> 8) & 0x0001); 150 data[0] = (reg << 1) | ((value >> 8) & 0x0001);
151 data[1] = value & 0x00ff; 151 data[1] = value & 0x00ff;
152 152
153 wm8753_write_reg_cache (codec, reg, value); 153 wm8753_write_reg_cache(codec, reg, value);
154 if (codec->hw_write(codec->control_data, data, 2) == 2) 154 if (codec->hw_write(codec->control_data, data, 2) == 2)
155 return 0; 155 return 0;
156 else 156 else
@@ -249,7 +249,7 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
249 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 249 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
250 int mode = wm8753_read_reg_cache(codec, WM8753_IOCTL); 250 int mode = wm8753_read_reg_cache(codec, WM8753_IOCTL);
251 251
252 if (((mode &0xc) >> 2) == ucontrol->value.integer.value[0]) 252 if (((mode & 0xc) >> 2) == ucontrol->value.integer.value[0])
253 return 0; 253 return 0;
254 254
255 mode &= 0xfff3; 255 mode &= 0xfff3;
@@ -342,7 +342,8 @@ static int wm8753_add_controls(struct snd_soc_codec *codec)
342 342
343 for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) { 343 for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) {
344 err = snd_ctl_add(codec->card, 344 err = snd_ctl_add(codec->card,
345 snd_soc_cnew(&wm8753_snd_controls[i],codec, NULL)); 345 snd_soc_cnew(&wm8753_snd_controls[i],
346 codec, NULL));
346 if (err < 0) 347 if (err < 0)
347 return err; 348 return err;
348 } 349 }
@@ -722,7 +723,7 @@ static void pll_factors(struct _pll_div *pll_div, unsigned int target,
722 723
723 if ((Ndiv < 6) || (Ndiv > 12)) 724 if ((Ndiv < 6) || (Ndiv > 12))
724 printk(KERN_WARNING 725 printk(KERN_WARNING
725 "WM8753 N value outwith recommended range! N = %d\n",Ndiv); 726 "wm8753: unsupported N = %d\n", Ndiv);
726 727
727 pll_div->n = Ndiv; 728 pll_div->n = Ndiv;
728 Nmod = target % source; 729 Nmod = target % source;
@@ -1300,8 +1301,9 @@ static int wm8753_dapm_event(struct snd_soc_codec *codec, int event)
1300} 1301}
1301 1302
1302#define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 1303#define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
1303 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 1304 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
1304 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 1305 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
1306 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
1305 1307
1306#define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1308#define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
1307 SNDRV_PCM_FMTBIT_S24_LE) 1309 SNDRV_PCM_FMTBIT_S24_LE)
@@ -1507,9 +1509,9 @@ static int wm8753_suspend(struct platform_device *pdev, pm_message_t state)
1507 struct snd_soc_codec *codec = socdev->codec; 1509 struct snd_soc_codec *codec = socdev->codec;
1508 1510
1509 /* we only need to suspend if we are a valid card */ 1511 /* we only need to suspend if we are a valid card */
1510 if(!codec->card) 1512 if (!codec->card)
1511 return 0; 1513 return 0;
1512 1514
1513 wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold); 1515 wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold);
1514 return 0; 1516 return 0;
1515} 1517}
@@ -1523,7 +1525,7 @@ static int wm8753_resume(struct platform_device *pdev)
1523 u16 *cache = codec->reg_cache; 1525 u16 *cache = codec->reg_cache;
1524 1526
1525 /* we only need to resume if we are a valid card */ 1527 /* we only need to resume if we are a valid card */
1526 if(!codec->card) 1528 if (!codec->card)
1527 return 0; 1529 return 0;
1528 1530
1529 /* Sync reg_cache with the hardware */ 1531 /* Sync reg_cache with the hardware */
@@ -1613,9 +1615,10 @@ static int wm8753_init(struct snd_soc_device *socdev)
1613 wm8753_add_widgets(codec); 1615 wm8753_add_widgets(codec);
1614 ret = snd_soc_register_card(socdev); 1616 ret = snd_soc_register_card(socdev);
1615 if (ret < 0) { 1617 if (ret < 0) {
1616 printk(KERN_ERR "wm8753: failed to register card\n"); 1618 printk(KERN_ERR "wm8753: failed to register card\n");
1617 goto card_err; 1619 goto card_err;
1618 } 1620 }
1621
1619 return ret; 1622 return ret;
1620 1623
1621card_err: 1624card_err:
@@ -1630,7 +1633,7 @@ pcm_err:
1630 around */ 1633 around */
1631static struct snd_soc_device *wm8753_socdev; 1634static struct snd_soc_device *wm8753_socdev;
1632 1635
1633#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1636#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
1634 1637
1635/* 1638/*
1636 * WM8753 2 wire address is determined by GPIO5 1639 * WM8753 2 wire address is determined by GPIO5
@@ -1661,7 +1664,7 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
1661 client_template.addr = addr; 1664 client_template.addr = addr;
1662 1665
1663 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 1666 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
1664 if (i2c == NULL){ 1667 if (!i2c) {
1665 kfree(codec); 1668 kfree(codec);
1666 return -ENOMEM; 1669 return -ENOMEM;
1667 } 1670 }
@@ -1749,7 +1752,7 @@ static int wm8753_probe(struct platform_device *pdev)
1749 wm8753_socdev = socdev; 1752 wm8753_socdev = socdev;
1750 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work); 1753 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
1751 1754
1752#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1755#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
1753 if (setup->i2c_address) { 1756 if (setup->i2c_address) {
1754 normal_i2c[0] = setup->i2c_address; 1757 normal_i2c[0] = setup->i2c_address;
1755 codec->hw_write = (hw_write_t)i2c_master_send; 1758 codec->hw_write = (hw_write_t)i2c_master_send;
@@ -1793,7 +1796,7 @@ static int wm8753_remove(struct platform_device *pdev)
1793 run_delayed_work(&codec->delayed_work); 1796 run_delayed_work(&codec->delayed_work);
1794 snd_soc_free_pcms(socdev); 1797 snd_soc_free_pcms(socdev);
1795 snd_soc_dapm_free(socdev); 1798 snd_soc_dapm_free(socdev);
1796#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1799#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
1797 i2c_del_driver(&wm8753_i2c_driver); 1800 i2c_del_driver(&wm8753_i2c_driver);
1798#endif 1801#endif
1799 kfree(codec->private_data); 1802 kfree(codec->private_data);
@@ -1808,7 +1811,6 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = {
1808 .suspend = wm8753_suspend, 1811 .suspend = wm8753_suspend,
1809 .resume = wm8753_resume, 1812 .resume = wm8753_resume,
1810}; 1813};
1811
1812EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753); 1814EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
1813 1815
1814MODULE_DESCRIPTION("ASoC WM8753 driver"); 1816MODULE_DESCRIPTION("ASoC WM8753 driver");
diff --git a/sound/soc/s3c24xx/ln2440sbc_alc650.c b/sound/soc/s3c24xx/ln2440sbc_alc650.c
index 9ed8f2e8da10..4eab2c19c454 100644
--- a/sound/soc/s3c24xx/ln2440sbc_alc650.c
+++ b/sound/soc/s3c24xx/ln2440sbc_alc650.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * SoC audio for ln2440sbc 2 * SoC audio for ln2440sbc
3 * 3 *
4 * Copyright 2007 KonekTel, a.s. 4 * Copyright 2007 KonekTel, a.s.
5 * Author: Ivan Kuten 5 * Author: Ivan Kuten
6 * ivan.kuten@promwad.com 6 * ivan.kuten@promwad.com
7 * 7 *
8 * Heavily based on smdk2443_wm9710.c 8 * Heavily based on smdk2443_wm9710.c
9 * Copyright 2007 Wolfson Microelectronics PLC. 9 * Copyright 2007 Wolfson Microelectronics PLC.
10 * Author: Graeme Gregory 10 * Author: Graeme Gregory
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 962cc20b1af5..0e9d1c5f2484 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -33,7 +33,7 @@
33#include <asm/arch/regs-gpio.h> 33#include <asm/arch/regs-gpio.h>
34#include <asm/hardware.h> 34#include <asm/hardware.h>
35#include <asm/arch/audio.h> 35#include <asm/arch/audio.h>
36#include <asm/io.h> 36#include <linux/io.h>
37#include <asm/arch/spi-gpio.h> 37#include <asm/arch/spi-gpio.h>
38 38
39#include <asm/plat-s3c24xx/regs-iis.h> 39#include <asm/plat-s3c24xx/regs-iis.h>
@@ -122,7 +122,7 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
122 122
123 /* set MCLK division for sample rate */ 123 /* set MCLK division for sample rate */
124 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, 124 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK,
125 S3C2410_IISMOD_32FS ); 125 S3C2410_IISMOD_32FS);
126 if (ret < 0) 126 if (ret < 0)
127 return ret; 127 return ret;
128 128
@@ -133,7 +133,7 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
133 133
134 /* set prescaler division for sample rate */ 134 /* set prescaler division for sample rate */
135 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, 135 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
136 S3C24XX_PRESCALE(4,4)); 136 S3C24XX_PRESCALE(4, 4));
137 if (ret < 0) 137 if (ret < 0)
138 return ret; 138 return ret;
139 139
@@ -222,7 +222,7 @@ static struct snd_soc_ops neo1973_voice_ops = {
222 .hw_free = neo1973_voice_hw_free, 222 .hw_free = neo1973_voice_hw_free,
223}; 223};
224 224
225static int neo1973_scenario = 0; 225static int neo1973_scenario;
226 226
227static int neo1973_get_scenario(struct snd_kcontrol *kcontrol, 227static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
228 struct snd_ctl_elem_value *ucontrol) 228 struct snd_ctl_elem_value *ucontrol)
@@ -233,7 +233,7 @@ static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
233 233
234static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) 234static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario)
235{ 235{
236 switch(neo1973_scenario) { 236 switch (neo1973_scenario) {
237 case NEO_AUDIO_OFF: 237 case NEO_AUDIO_OFF:
238 snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); 238 snd_soc_dapm_set_endpoint(codec, "Audio Out", 0);
239 snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); 239 snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0);
@@ -334,7 +334,7 @@ static void lm4857_write_regs(void)
334static int lm4857_get_reg(struct snd_kcontrol *kcontrol, 334static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
335 struct snd_ctl_elem_value *ucontrol) 335 struct snd_ctl_elem_value *ucontrol)
336{ 336{
337 int reg=kcontrol->private_value & 0xFF; 337 int reg = kcontrol->private_value & 0xFF;
338 int shift = (kcontrol->private_value >> 8) & 0x0F; 338 int shift = (kcontrol->private_value >> 8) & 0x0F;
339 int mask = (kcontrol->private_value >> 16) & 0xFF; 339 int mask = (kcontrol->private_value >> 16) & 0xFF;
340 340
@@ -349,11 +349,11 @@ static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
349 int shift = (kcontrol->private_value >> 8) & 0x0F; 349 int shift = (kcontrol->private_value >> 8) & 0x0F;
350 int mask = (kcontrol->private_value >> 16) & 0xFF; 350 int mask = (kcontrol->private_value >> 16) & 0xFF;
351 351
352 if (((lm4857_regs[reg] >> shift ) & mask) == 352 if (((lm4857_regs[reg] >> shift) & mask) ==
353 ucontrol->value.integer.value[0]) 353 ucontrol->value.integer.value[0])
354 return 0; 354 return 0;
355 355
356 lm4857_regs[reg] &= ~ (mask << shift); 356 lm4857_regs[reg] &= ~(mask << shift);
357 lm4857_regs[reg] |= ucontrol->value.integer.value[0] << shift; 357 lm4857_regs[reg] |= ucontrol->value.integer.value[0] << shift;
358 lm4857_write_regs(); 358 lm4857_write_regs();
359 return 1; 359 return 1;
@@ -398,7 +398,7 @@ static const struct snd_soc_dapm_widget wm8753_dapm_widgets[] = {
398 398
399 399
400/* example machine audio_mapnections */ 400/* example machine audio_mapnections */
401static const char* audio_map[][3] = { 401static const char *audio_map[][3] = {
402 402
403 /* Connections to the lm4857 amp */ 403 /* Connections to the lm4857 amp */
404 {"Audio Out", NULL, "LOUT1"}, 404 {"Audio Out", NULL, "LOUT1"},
@@ -450,7 +450,7 @@ static const char *neo_scenarios[] = {
450}; 450};
451 451
452static const struct soc_enum neo_scenario_enum[] = { 452static const struct soc_enum neo_scenario_enum[] = {
453 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(neo_scenarios),neo_scenarios), 453 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(neo_scenarios), neo_scenarios),
454}; 454};
455 455
456static const struct snd_kcontrol_new wm8753_neo1973_controls[] = { 456static const struct snd_kcontrol_new wm8753_neo1973_controls[] = {
@@ -521,8 +521,8 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
521/* 521/*
522 * BT Codec DAI 522 * BT Codec DAI
523 */ 523 */
524static struct snd_soc_cpu_dai bt_dai = 524static struct snd_soc_cpu_dai bt_dai = {
525{ .name = "Bluetooth", 525 .name = "Bluetooth",
526 .id = 0, 526 .id = 0,
527 .type = SND_SOC_DAI_PCM, 527 .type = SND_SOC_DAI_PCM,
528 .playback = { 528 .playback = {
@@ -616,6 +616,35 @@ static int lm4857_i2c_attach(struct i2c_adapter *adap)
616 return i2c_probe(adap, &addr_data, lm4857_amp_probe); 616 return i2c_probe(adap, &addr_data, lm4857_amp_probe);
617} 617}
618 618
619static u8 lm4857_state;
620
621static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
622{
623 dev_dbg(&dev->dev, "lm4857_suspend\n");
624 lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
625 if (lm4857_state) {
626 lm4857_regs[LM4857_CTRL] &= 0xf0;
627 lm4857_write_regs();
628 }
629 return 0;
630}
631
632static int lm4857_resume(struct i2c_client *dev)
633{
634 if (lm4857_state) {
635 lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
636 lm4857_write_regs();
637 }
638 return 0;
639}
640
641static void lm4857_shutdown(struct i2c_client *dev)
642{
643 dev_dbg(&dev->dev, "lm4857_shutdown\n");
644 lm4857_regs[LM4857_CTRL] &= 0xf0;
645 lm4857_write_regs();
646}
647
619/* corgi i2c codec control layer */ 648/* corgi i2c codec control layer */
620static struct i2c_driver lm4857_i2c_driver = { 649static struct i2c_driver lm4857_i2c_driver = {
621 .driver = { 650 .driver = {
@@ -623,6 +652,9 @@ static struct i2c_driver lm4857_i2c_driver = {
623 .owner = THIS_MODULE, 652 .owner = THIS_MODULE,
624 }, 653 },
625 .id = I2C_DRIVERID_LM4857, 654 .id = I2C_DRIVERID_LM4857,
655 .suspend = lm4857_suspend,
656 .resume = lm4857_resume,
657 .shutdown = lm4857_shutdown,
626 .attach_adapter = lm4857_i2c_attach, 658 .attach_adapter = lm4857_i2c_attach,
627 .detach_client = lm4857_i2c_detach, 659 .detach_client = lm4857_i2c_detach,
628 .command = NULL, 660 .command = NULL,
@@ -667,6 +699,6 @@ module_init(neo1973_init);
667module_exit(neo1973_exit); 699module_exit(neo1973_exit);
668 700
669/* Module information */ 701/* Module information */
670MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); 702MODULE_AUTHOR("Graeme Gregory, graeme@openmoko.org, www.openmoko.org");
671MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973"); 703MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973");
672MODULE_LICENSE("GPL"); 704MODULE_LICENSE("GPL");
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c
index 1c1ddbf7f3c0..e81d9a6c83da 100644
--- a/sound/soc/s3c24xx/s3c2443-ac97.c
+++ b/sound/soc/s3c24xx/s3c2443-ac97.c
@@ -19,6 +19,7 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/io.h>
22#include <linux/wait.h> 23#include <linux/wait.h>
23#include <linux/delay.h> 24#include <linux/delay.h>
24#include <linux/clk.h> 25#include <linux/clk.h>
@@ -30,7 +31,6 @@
30#include <sound/soc.h> 31#include <sound/soc.h>
31 32
32#include <asm/hardware.h> 33#include <asm/hardware.h>
33#include <asm/io.h>
34#include <asm/plat-s3c/regs-ac97.h> 34#include <asm/plat-s3c/regs-ac97.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-clock.h> 36#include <asm/arch/regs-clock.h>
@@ -47,7 +47,7 @@ struct s3c24xx_ac97_info {
47}; 47};
48static struct s3c24xx_ac97_info s3c24xx_ac97; 48static struct s3c24xx_ac97_info s3c24xx_ac97;
49 49
50DECLARE_COMPLETION(ac97_completion); 50static DECLARE_COMPLETION(ac97_completion);
51static u32 codec_ready; 51static u32 codec_ready;
52static DECLARE_MUTEX(ac97_mutex); 52static DECLARE_MUTEX(ac97_mutex);
53 53
@@ -290,7 +290,7 @@ static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd)
290 u32 ac_glbctrl; 290 u32 ac_glbctrl;
291 291
292 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); 292 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
293 switch(cmd) { 293 switch (cmd) {
294 case SNDRV_PCM_TRIGGER_START: 294 case SNDRV_PCM_TRIGGER_START:
295 case SNDRV_PCM_TRIGGER_RESUME: 295 case SNDRV_PCM_TRIGGER_RESUME:
296 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 296 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
@@ -333,7 +333,7 @@ static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream,
333 u32 ac_glbctrl; 333 u32 ac_glbctrl;
334 334
335 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); 335 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
336 switch(cmd) { 336 switch (cmd) {
337 case SNDRV_PCM_TRIGGER_START: 337 case SNDRV_PCM_TRIGGER_START:
338 case SNDRV_PCM_TRIGGER_RESUME: 338 case SNDRV_PCM_TRIGGER_RESUME:
339 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 339 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
@@ -391,7 +391,6 @@ struct snd_soc_cpu_dai s3c2443_ac97_dai[] = {
391 .trigger = s3c2443_ac97_mic_trigger,}, 391 .trigger = s3c2443_ac97_mic_trigger,},
392}, 392},
393}; 393};
394
395EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); 394EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
396EXPORT_SYMBOL_GPL(soc_ac97_ops); 395EXPORT_SYMBOL_GPL(soc_ac97_ops);
397 396
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 49580fb481d5..6c70a81c730c 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/io.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
25#include <linux/dma-mapping.h> 26#include <linux/dma-mapping.h>
@@ -30,7 +31,6 @@
30#include <sound/soc.h> 31#include <sound/soc.h>
31 32
32#include <asm/dma.h> 33#include <asm/dma.h>
33#include <asm/io.h>
34#include <asm/hardware.h> 34#include <asm/hardware.h>
35#include <asm/arch/dma.h> 35#include <asm/arch/dma.h>
36#include <asm/arch/audio.h> 36#include <asm/arch/audio.h>
@@ -93,7 +93,7 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
93 while (prtd->dma_loaded < prtd->dma_limit) { 93 while (prtd->dma_loaded < prtd->dma_limit) {
94 unsigned long len = prtd->dma_period; 94 unsigned long len = prtd->dma_period;
95 95
96 DBG("dma_loaded: %d\n",prtd->dma_loaded); 96 DBG("dma_loaded: %d\n", prtd->dma_loaded);
97 97
98 if ((pos + len) > prtd->dma_end) { 98 if ((pos + len) > prtd->dma_end) {
99 len = prtd->dma_end - pos; 99 len = prtd->dma_end - pos;
@@ -101,7 +101,7 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
101 __func__, len); 101 __func__, len);
102 } 102 }
103 103
104 ret = s3c2410_dma_enqueue(prtd->params->channel, 104 ret = s3c2410_dma_enqueue(prtd->params->channel,
105 substream, pos, len); 105 substream, pos, len);
106 106
107 if (ret == 0) { 107 if (ret == 0) {
@@ -129,7 +129,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
129 return; 129 return;
130 130
131 prtd = substream->runtime->private_data; 131 prtd = substream->runtime->private_data;
132 132
133 if (substream) 133 if (substream)
134 snd_pcm_period_elapsed(substream); 134 snd_pcm_period_elapsed(substream);
135 135
@@ -150,7 +150,7 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
150 struct snd_soc_pcm_runtime *rtd = substream->private_data; 150 struct snd_soc_pcm_runtime *rtd = substream->private_data;
151 struct s3c24xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; 151 struct s3c24xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data;
152 unsigned long totbytes = params_buffer_bytes(params); 152 unsigned long totbytes = params_buffer_bytes(params);
153 int ret=0; 153 int ret = 0;
154 154
155 DBG("Entered %s\n", __func__); 155 DBG("Entered %s\n", __func__);
156 156
@@ -223,7 +223,7 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
223 /* return if this is a bufferless transfer e.g. 223 /* return if this is a bufferless transfer e.g.
224 * codec <--> BT codec or GSM modem -- lg FIXME */ 224 * codec <--> BT codec or GSM modem -- lg FIXME */
225 if (!prtd->params) 225 if (!prtd->params)
226 return 0; 226 return 0;
227 227
228 /* channel needs configuring for mem=>device, increment memory addr, 228 /* channel needs configuring for mem=>device, increment memory addr,
229 * sync to pclk, half-word transfers to the IIS-FIFO. */ 229 * sync to pclk, half-word transfers to the IIS-FIFO. */
@@ -293,8 +293,8 @@ static int s3c24xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
293 return ret; 293 return ret;
294} 294}
295 295
296static snd_pcm_uframes_t 296static snd_pcm_uframes_t
297 s3c24xx_pcm_pointer(struct snd_pcm_substream *substream) 297s3c24xx_pcm_pointer(struct snd_pcm_substream *substream)
298{ 298{
299 struct snd_pcm_runtime *runtime = substream->runtime; 299 struct snd_pcm_runtime *runtime = substream->runtime;
300 struct s3c24xx_runtime_data *prtd = runtime->private_data; 300 struct s3c24xx_runtime_data *prtd = runtime->private_data;
@@ -313,7 +313,7 @@ static snd_pcm_uframes_t
313 313
314 spin_unlock(&prtd->lock); 314 spin_unlock(&prtd->lock);
315 315
316 DBG("Pointer %x %x\n",src,dst); 316 DBG("Pointer %x %x\n", src, dst);
317 317
318 /* we seem to be getting the odd error from the pcm library due 318 /* we seem to be getting the odd error from the pcm library due
319 * to out-of-bounds pointers. this is maybe due to the dma engine 319 * to out-of-bounds pointers. this is maybe due to the dma engine
@@ -355,11 +355,11 @@ static int s3c24xx_pcm_close(struct snd_pcm_substream *substream)
355 355
356 DBG("Entered %s\n", __func__); 356 DBG("Entered %s\n", __func__);
357 357
358 if (prtd) 358 if (!prtd)
359 kfree(prtd);
360 else
361 DBG("s3c24xx_pcm_close called with prtd == NULL\n"); 359 DBG("s3c24xx_pcm_close called with prtd == NULL\n");
362 360
361 kfree(prtd);
362
363 return 0; 363 return 0;
364} 364}
365 365
@@ -371,9 +371,9 @@ static int s3c24xx_pcm_mmap(struct snd_pcm_substream *substream,
371 DBG("Entered %s\n", __func__); 371 DBG("Entered %s\n", __func__);
372 372
373 return dma_mmap_writecombine(substream->pcm->card->dev, vma, 373 return dma_mmap_writecombine(substream->pcm->card->dev, vma,
374 runtime->dma_area, 374 runtime->dma_area,
375 runtime->dma_addr, 375 runtime->dma_addr,
376 runtime->dma_bytes); 376 runtime->dma_bytes);
377} 377}
378 378
379static struct snd_pcm_ops s3c24xx_pcm_ops = { 379static struct snd_pcm_ops s3c24xx_pcm_ops = {
@@ -432,7 +432,7 @@ static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
432 432
433static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK; 433static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK;
434 434
435static int s3c24xx_pcm_new(struct snd_card *card, 435static int s3c24xx_pcm_new(struct snd_card *card,
436 struct snd_soc_codec_dai *dai, struct snd_pcm *pcm) 436 struct snd_soc_codec_dai *dai, struct snd_pcm *pcm)
437{ 437{
438 int ret = 0; 438 int ret = 0;
@@ -467,7 +467,6 @@ struct snd_soc_platform s3c24xx_soc_platform = {
467 .pcm_new = s3c24xx_pcm_new, 467 .pcm_new = s3c24xx_pcm_new,
468 .pcm_free = s3c24xx_pcm_free_dma_buffers, 468 .pcm_free = s3c24xx_pcm_free_dma_buffers,
469}; 469};
470
471EXPORT_SYMBOL_GPL(s3c24xx_soc_platform); 470EXPORT_SYMBOL_GPL(s3c24xx_soc_platform);
472 471
473MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); 472MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");