Merge branch 'for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6

* 'for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6:
  ASoC: fixup oops in generic AC97 codec glue
  ASoC: fix params_rate() macro use in several codecs
  ASoC: fsi-ak4642: Remove ak4642_add_i2c_device
This commit is contained in:
Linus Torvalds 2010-01-05 15:59:56 -08:00
commit f843b0fcc7
5 changed files with 27 additions and 51 deletions

View File

@ -102,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);
ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) {
printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
goto err;
}
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0)

View File

@ -424,23 +424,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,
/* filter coefficient */
switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
adn |= 0x5 << 1;
break;
case SNDRV_PCM_RATE_11025:
case 11025:
adn |= 0x4 << 1;
break;
case SNDRV_PCM_RATE_16000:
case 16000:
adn |= 0x3 << 1;
break;
case SNDRV_PCM_RATE_22050:
case 22050:
adn |= 0x2 << 1;
break;
case SNDRV_PCM_RATE_32000:
case 32000:
adn |= 0x1 << 1;
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}

View File

@ -378,23 +378,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream,
iface |= (1 << 9);
switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
addcntrl |= (0x5 << 1);
break;
case SNDRV_PCM_RATE_11025:
case 11025:
addcntrl |= (0x4 << 1);
break;
case SNDRV_PCM_RATE_16000:
case 16000:
addcntrl |= (0x3 << 1);
break;
case SNDRV_PCM_RATE_22050:
case 22050:
addcntrl |= (0x2 << 1);
break;
case SNDRV_PCM_RATE_32000:
case 32000:
addcntrl |= (0x1 << 1);
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}
ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl);

View File

@ -482,23 +482,23 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream,
/* filter coefficient */
switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
adn |= 0x5 << 1;
break;
case SNDRV_PCM_RATE_11025:
case 11025:
adn |= 0x4 << 1;
break;
case SNDRV_PCM_RATE_16000:
case 16000:
adn |= 0x3 << 1;
break;
case SNDRV_PCM_RATE_22050:
case 22050:
adn |= 0x2 << 1;
break;
case SNDRV_PCM_RATE_32000:
case 32000:
adn |= 0x1 << 1;
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}

View File

@ -42,42 +42,12 @@ static struct snd_soc_device fsi_snd_devdata = {
.codec_dev = &soc_codec_dev_ak4642,
};
#define AK4642_BUS 0
#define AK4642_ADR 0x12
static int ak4642_add_i2c_device(void)
{
struct i2c_board_info info;
struct i2c_adapter *adapter;
struct i2c_client *client;
memset(&info, 0, sizeof(struct i2c_board_info));
info.addr = AK4642_ADR;
strlcpy(info.type, "ak4642", I2C_NAME_SIZE);
adapter = i2c_get_adapter(AK4642_BUS);
if (!adapter) {
printk(KERN_DEBUG "can't get i2c adapter\n");
return -ENODEV;
}
client = i2c_new_device(adapter, &info);
i2c_put_adapter(adapter);
if (!client) {
printk(KERN_DEBUG "can't add i2c device\n");
return -ENODEV;
}
return 0;
}
static struct platform_device *fsi_snd_device;
static int __init fsi_ak4642_init(void)
{
int ret = -ENOMEM;
ak4642_add_i2c_device();
fsi_snd_device = platform_device_alloc("soc-audio", -1);
if (!fsi_snd_device)
goto out;