Skip to content

Commit

Permalink
Merge branch 'for-2.6.33' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  • Loading branch information
Linus Torvalds committed Jan 5, 2010
2 parents c5974b8 + ecbec24 commit f843b0f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 51 deletions.
6 changes: 6 additions & 0 deletions sound/soc/codecs/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions sound/soc/codecs/wm8510.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
14 changes: 7 additions & 7 deletions sound/soc/codecs/wm8940.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions sound/soc/codecs/wm8974.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
30 changes: 0 additions & 30 deletions sound/soc/sh/fsi-ak4642.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f843b0f

Please sign in to comment.