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
This commit is contained in:
Linus Torvalds 2008-04-30 09:22:27 -07:00
commit ccf2779544
5 changed files with 85 additions and 53 deletions

View File

@ -342,7 +342,8 @@ static int wm8753_add_controls(struct snd_soc_codec *codec)
for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8753_snd_controls[i],codec, NULL));
snd_soc_cnew(&wm8753_snd_controls[i],
codec, NULL));
if (err < 0)
return err;
}
@ -722,7 +723,7 @@ static void pll_factors(struct _pll_div *pll_div, unsigned int target,
if ((Ndiv < 6) || (Ndiv > 12))
printk(KERN_WARNING
"WM8753 N value outwith recommended range! N = %d\n",Ndiv);
"wm8753: unsupported N = %d\n", Ndiv);
pll_div->n = Ndiv;
Nmod = target % source;
@ -1300,8 +1301,9 @@ static int wm8753_dapm_event(struct snd_soc_codec *codec, int event)
}
#define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
#define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE)
@ -1616,6 +1618,7 @@ static int wm8753_init(struct snd_soc_device *socdev)
printk(KERN_ERR "wm8753: failed to register card\n");
goto card_err;
}
return ret;
card_err:
@ -1661,7 +1664,7 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
if (i2c == NULL){
if (!i2c) {
kfree(codec);
return -ENOMEM;
}
@ -1808,7 +1811,6 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = {
.suspend = wm8753_suspend,
.resume = wm8753_resume,
};
EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
MODULE_DESCRIPTION("ASoC WM8753 driver");

View File

@ -33,7 +33,7 @@
#include <asm/arch/regs-gpio.h>
#include <asm/hardware.h>
#include <asm/arch/audio.h>
#include <asm/io.h>
#include <linux/io.h>
#include <asm/arch/spi-gpio.h>
#include <asm/plat-s3c24xx/regs-iis.h>
@ -222,7 +222,7 @@ static struct snd_soc_ops neo1973_voice_ops = {
.hw_free = neo1973_voice_hw_free,
};
static int neo1973_scenario = 0;
static int neo1973_scenario;
static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
@ -521,8 +521,8 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
/*
* BT Codec DAI
*/
static struct snd_soc_cpu_dai bt_dai =
{ .name = "Bluetooth",
static struct snd_soc_cpu_dai bt_dai = {
.name = "Bluetooth",
.id = 0,
.type = SND_SOC_DAI_PCM,
.playback = {
@ -616,6 +616,35 @@ static int lm4857_i2c_attach(struct i2c_adapter *adap)
return i2c_probe(adap, &addr_data, lm4857_amp_probe);
}
static u8 lm4857_state;
static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
{
dev_dbg(&dev->dev, "lm4857_suspend\n");
lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
if (lm4857_state) {
lm4857_regs[LM4857_CTRL] &= 0xf0;
lm4857_write_regs();
}
return 0;
}
static int lm4857_resume(struct i2c_client *dev)
{
if (lm4857_state) {
lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
lm4857_write_regs();
}
return 0;
}
static void lm4857_shutdown(struct i2c_client *dev)
{
dev_dbg(&dev->dev, "lm4857_shutdown\n");
lm4857_regs[LM4857_CTRL] &= 0xf0;
lm4857_write_regs();
}
/* corgi i2c codec control layer */
static struct i2c_driver lm4857_i2c_driver = {
.driver = {
@ -623,6 +652,9 @@ static struct i2c_driver lm4857_i2c_driver = {
.owner = THIS_MODULE,
},
.id = I2C_DRIVERID_LM4857,
.suspend = lm4857_suspend,
.resume = lm4857_resume,
.shutdown = lm4857_shutdown,
.attach_adapter = lm4857_i2c_attach,
.detach_client = lm4857_i2c_detach,
.command = NULL,
@ -667,6 +699,6 @@ module_init(neo1973_init);
module_exit(neo1973_exit);
/* Module information */
MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com");
MODULE_AUTHOR("Graeme Gregory, graeme@openmoko.org, www.openmoko.org");
MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973");
MODULE_LICENSE("GPL");

View File

@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/wait.h>
#include <linux/delay.h>
#include <linux/clk.h>
@ -30,7 +31,6 @@
#include <sound/soc.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/plat-s3c/regs-ac97.h>
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-clock.h>
@ -47,7 +47,7 @@ struct s3c24xx_ac97_info {
};
static struct s3c24xx_ac97_info s3c24xx_ac97;
DECLARE_COMPLETION(ac97_completion);
static DECLARE_COMPLETION(ac97_completion);
static u32 codec_ready;
static DECLARE_MUTEX(ac97_mutex);
@ -391,7 +391,6 @@ struct snd_soc_cpu_dai s3c2443_ac97_dai[] = {
.trigger = s3c2443_ac97_mic_trigger,},
},
};
EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
EXPORT_SYMBOL_GPL(soc_ac97_ops);

View File

@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
@ -30,7 +31,6 @@
#include <sound/soc.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/arch/dma.h>
#include <asm/arch/audio.h>
@ -355,11 +355,11 @@ static int s3c24xx_pcm_close(struct snd_pcm_substream *substream)
DBG("Entered %s\n", __func__);
if (prtd)
kfree(prtd);
else
if (!prtd)
DBG("s3c24xx_pcm_close called with prtd == NULL\n");
kfree(prtd);
return 0;
}
@ -467,7 +467,6 @@ struct snd_soc_platform s3c24xx_soc_platform = {
.pcm_new = s3c24xx_pcm_new,
.pcm_free = s3c24xx_pcm_free_dma_buffers,
};
EXPORT_SYMBOL_GPL(s3c24xx_soc_platform);
MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");