Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  [ALSA] soc - wm9712 - checkpatch fixes
  [ALSA] pcsp - Fix more dependency
  [ALSA] hda - Add support of Medion RIM 2150
  [ALSA] ASoC: Add drivers for the Texas Instruments OMAP processors
  [ALSA] ice1724 - Enable watermarks
  [ALSA] Add MPU401_INFO_NO_ACK bitflag
  • Loading branch information
Linus Torvalds committed Apr 29, 2008
2 parents 1f43c53 + 7e48bf6 commit 25a0258
Show file tree
Hide file tree
Showing 16 changed files with 1,344 additions and 37 deletions.
1 change: 1 addition & 0 deletions Documentation/sound/alsa/ALSA-Configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
lg-lw LG LW20/LW25 laptop
tcl TCL S700
clevo Clevo laptops (m520G, m665n)
medion Medion Rim 2150
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
Expand Down
1 change: 1 addition & 0 deletions include/sound/mpu401.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */
#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */
#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */
#define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */

#define MPU401_MODE_BIT_INPUT 0
#define MPU401_MODE_BIT_OUTPUT 1
Expand Down
2 changes: 2 additions & 0 deletions sound/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ config SND_PCSP
tristate "Internal PC speaker support"
depends on X86_PC && HIGH_RES_TIMERS
depends on INPUT
depends on SND
select SND_PCM
help
If you don't have a sound card in your computer, you can include a
driver for the PC speaker which allows it to act like a primitive
Expand Down
2 changes: 1 addition & 1 deletion sound/drivers/mpu401/mpu401_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static int snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd,
#endif
}
mpu->write(mpu, cmd, MPU401C(mpu));
if (ack) {
if (ack && !(mpu->info_flags & MPU401_INFO_NO_ACK)) {
ok = 0;
timeout = 10000;
while (!ok && timeout-- > 0) {
Expand Down
86 changes: 86 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum {
ALC880_TCL_S700,
ALC880_LG,
ALC880_LG_LW,
ALC880_MEDION_RIM,
#ifdef CONFIG_SND_DEBUG
ALC880_TEST,
#endif
Expand Down Expand Up @@ -2275,6 +2276,75 @@ static void alc880_lg_lw_unsol_event(struct hda_codec *codec, unsigned int res)
alc880_lg_lw_automute(codec);
}

static struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT),
{ } /* end */
};

static struct hda_input_mux alc880_medion_rim_capture_source = {
.num_items = 2,
.items = {
{ "Mic", 0x0 },
{ "Internal Mic", 0x1 },
},
};

static struct hda_verb alc880_medion_rim_init_verbs[] = {
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */

{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},

/* Mic1 (rear panel) pin widget for input and vref at 80% */
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
/* Mic2 (as headphone out) for HP output */
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
/* Internal Speaker */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},

{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},

{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
{ }
};

/* toggle speaker-output according to the hp-jack state */
static void alc880_medion_rim_automute(struct hda_codec *codec)
{
unsigned int present;
unsigned char bits;

present = snd_hda_codec_read(codec, 0x14, 0,
AC_VERB_GET_PIN_SENSE, 0)
& AC_PINSENSE_PRESENCE;
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
HDA_AMP_MUTE, bits);
if (present)
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
else
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
}

static void alc880_medion_rim_unsol_event(struct hda_codec *codec,
unsigned int res)
{
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
if ((res >> 28) == ALC880_HP_EVENT)
alc880_medion_rim_automute(codec);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static struct hda_amp_list alc880_loopbacks[] = {
{ 0x0b, HDA_INPUT, 0 },
Expand Down Expand Up @@ -2882,6 +2952,7 @@ static const char *alc880_models[ALC880_MODEL_LAST] = {
[ALC880_F1734] = "F1734",
[ALC880_LG] = "lg",
[ALC880_LG_LW] = "lg-lw",
[ALC880_MEDION_RIM] = "medion",
#ifdef CONFIG_SND_DEBUG
[ALC880_TEST] = "test",
#endif
Expand Down Expand Up @@ -2933,6 +3004,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = {
SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM),
SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
Expand Down Expand Up @@ -3227,6 +3299,20 @@ static struct alc_config_preset alc880_presets[] = {
.unsol_event = alc880_lg_lw_unsol_event,
.init_hook = alc880_lg_lw_automute,
},
[ALC880_MEDION_RIM] = {
.mixers = { alc880_medion_rim_mixer },
.init_verbs = { alc880_volume_init_verbs,
alc880_medion_rim_init_verbs,
alc_gpio2_init_verbs },
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
.dac_nids = alc880_dac_nids,
.dig_out_nid = ALC880_DIGOUT_NID,
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
.channel_mode = alc880_2_jack_modes,
.input_mux = &alc880_medion_rim_capture_source,
.unsol_event = alc880_medion_rim_unsol_event,
.init_hook = alc880_medion_rim_automute,
},
#ifdef CONFIG_SND_DEBUG
[ALC880_TEST] = {
.mixers = { alc880_test_mixer },
Expand Down
3 changes: 1 addition & 2 deletions sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,7 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
ICEREG1724(ice, MPU_CTRL),
(MPU401_INFO_INTEGRATED |
MPU401_INFO_NO_ACK |
MPU401_INFO_TX_IRQ),
ice->irq, 0,
&ice->rmidi[0])) < 0) {
Expand All @@ -2442,12 +2443,10 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
outb(inb(ICEREG1724(ice, IRQMASK)) &
~(VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX),
ICEREG1724(ice, IRQMASK));
#if 0 /* for testing */
/* set watermarks */
outb(VT1724_MPU_RX_FIFO | 0x1,
ICEREG1724(ice, MPU_FIFO_WM));
outb(0x1, ICEREG1724(ice, MPU_FIFO_WM));
#endif
}
}

Expand Down
1 change: 1 addition & 0 deletions sound/soc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ source "sound/soc/s3c24xx/Kconfig"
source "sound/soc/sh/Kconfig"
source "sound/soc/fsl/Kconfig"
source "sound/soc/davinci/Kconfig"
source "sound/soc/omap/Kconfig"

# Supported codecs
source "sound/soc/codecs/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
snd-soc-core-objs := soc-core.o soc-dapm.o

obj-$(CONFIG_SND_SOC) += snd-soc-core.o
obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ s3c24xx/ sh/ fsl/ davinci/
obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ s3c24xx/ sh/ fsl/ davinci/ omap/
62 changes: 29 additions & 33 deletions sound/soc/codecs/wm9712.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ static int ac97_write(struct snd_soc_codec *codec,
* WM9712 register cache
*/
static const u16 wm9712_reg[] = {
0x6174, 0x8000, 0x8000, 0x8000, // 6
0x0f0f, 0xaaa0, 0xc008, 0x6808, // e
0xe808, 0xaaa0, 0xad00, 0x8000, // 16
0xe808, 0x3000, 0x8000, 0x0000, // 1e
0x0000, 0x0000, 0x0000, 0x000f, // 26
0x0405, 0x0410, 0xbb80, 0xbb80, // 2e
0x0000, 0xbb80, 0x0000, 0x0000, // 36
0x0000, 0x2000, 0x0000, 0x0000, // 3e
0x0000, 0x0000, 0x0000, 0x0000, // 46
0x0000, 0x0000, 0xf83e, 0xffff, // 4e
0x0000, 0x0000, 0x0000, 0xf83e, // 56
0x0008, 0x0000, 0x0000, 0x0000, // 5e
0xb032, 0x3e00, 0x0000, 0x0000, // 66
0x0000, 0x0000, 0x0000, 0x0000, // 6e
0x0000, 0x0000, 0x0000, 0x0006, // 76
0x0001, 0x0000, 0x574d, 0x4c12, // 7e
0x0000, 0x0000 // virtual hp mixers
0x6174, 0x8000, 0x8000, 0x8000, /* 6 */
0x0f0f, 0xaaa0, 0xc008, 0x6808, /* e */
0xe808, 0xaaa0, 0xad00, 0x8000, /* 16 */
0xe808, 0x3000, 0x8000, 0x0000, /* 1e */
0x0000, 0x0000, 0x0000, 0x000f, /* 26 */
0x0405, 0x0410, 0xbb80, 0xbb80, /* 2e */
0x0000, 0xbb80, 0x0000, 0x0000, /* 36 */
0x0000, 0x2000, 0x0000, 0x0000, /* 3e */
0x0000, 0x0000, 0x0000, 0x0000, /* 46 */
0x0000, 0x0000, 0xf83e, 0xffff, /* 4e */
0x0000, 0x0000, 0x0000, 0xf83e, /* 56 */
0x0008, 0x0000, 0x0000, 0x0000, /* 5e */
0xb032, 0x3e00, 0x0000, 0x0000, /* 66 */
0x0000, 0x0000, 0x0000, 0x0000, /* 6e */
0x0000, 0x0000, 0x0000, 0x0006, /* 76 */
0x0001, 0x0000, 0x574d, 0x4c12, /* 7e */
0x0000, 0x0000 /* virtual hp mixers */
};

/* virtual HP mixers regs */
Expand Down Expand Up @@ -94,7 +94,7 @@ static const struct snd_kcontrol_new wm9712_snd_ac97_controls[] = {
SOC_DOUBLE("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1),
SOC_SINGLE("Speaker Playback Switch", AC97_MASTER, 15, 1, 1),
SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1),
SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE,15, 1, 1),
SOC_SINGLE("Headphone Playback Switch", AC97_HEADPHONE, 15, 1, 1),
SOC_DOUBLE("PCM Playback Volume", AC97_PCM, 8, 0, 31, 1),

SOC_SINGLE("Speaker Playback ZC Switch", AC97_MASTER, 7, 1, 0),
Expand Down Expand Up @@ -165,7 +165,8 @@ static int wm9712_add_controls(struct snd_soc_codec *codec)

for (i = 0; i < ARRAY_SIZE(wm9712_snd_ac97_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm9712_snd_ac97_controls[i],codec, NULL));
snd_soc_cnew(&wm9712_snd_ac97_controls[i],
codec, NULL));
if (err < 0)
return err;
}
Expand Down Expand Up @@ -363,7 +364,6 @@ static const char *audio_map[][3] = {
{"Left HP Mixer", "PCM Playback Switch", "Left DAC"},
{"Left HP Mixer", "Mic Sidetone Switch", "Mic PGA"},
{"Left HP Mixer", NULL, "ALC Sidetone Mux"},
//{"Right HP Mixer", NULL, "HP Mixer"},

/* Right HP mixer */
{"Right HP Mixer", "PCBeep Bypass Switch", "PCBEEP"},
Expand Down Expand Up @@ -454,15 +454,13 @@ static int wm9712_add_widgets(struct snd_soc_codec *codec)
{
int i;

for(i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++) {
for (i = 0; i < ARRAY_SIZE(wm9712_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm9712_dapm_widgets[i]);
}

/* set up audio path audio_mapnects */
for(i = 0; audio_map[i][0] != NULL; i++) {
/* set up audio path connects */
for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
}
audio_map[i][1], audio_map[i][2]);

snd_soc_dapm_new_widgets(codec);
return 0;
Expand Down Expand Up @@ -540,7 +538,8 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
}

#define WM9712_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
SNDRV_PCM_RATE_48000)

struct snd_soc_codec_dai wm9712_dai[] = {
{
Expand Down Expand Up @@ -577,8 +576,6 @@ EXPORT_SYMBOL_GPL(wm9712_dai);

static int wm9712_dapm_event(struct snd_soc_codec *codec, int event)
{
u16 reg;

switch (event) {
case SNDRV_CTL_POWER_D0: /* full On */
case SNDRV_CTL_POWER_D1: /* partial On */
Expand Down Expand Up @@ -633,7 +630,7 @@ static int wm9712_soc_resume(struct platform_device *pdev)
u16 *cache = codec->reg_cache;

ret = wm9712_reset(codec, 1);
if (ret < 0){
if (ret < 0) {
printk(KERN_ERR "could not reset AC97 codec\n");
return ret;
}
Expand All @@ -642,9 +639,9 @@ static int wm9712_soc_resume(struct platform_device *pdev)

if (ret == 0) {
/* Sync reg_cache with the hardware after cold reset */
for (i = 2; i < ARRAY_SIZE(wm9712_reg) << 1; i+=2) {
for (i = 2; i < ARRAY_SIZE(wm9712_reg) << 1; i += 2) {
if (i == AC97_INT_PAGING || i == AC97_POWERDOWN ||
(i > 0x58 && i != 0x5c))
(i > 0x58 && i != 0x5c))
continue;
soc_ac97_ops.write(codec->ac97, i, cache[i>>1]);
}
Expand Down Expand Up @@ -757,7 +754,6 @@ struct snd_soc_codec_device soc_codec_dev_wm9712 = {
.suspend = wm9712_soc_suspend,
.resume = wm9712_soc_resume,
};

EXPORT_SYMBOL_GPL(soc_codec_dev_wm9712);

MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver");
Expand Down
19 changes: 19 additions & 0 deletions sound/soc/omap/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
menu "SoC Audio for the Texas Instruments OMAP"

config SND_OMAP_SOC
tristate "SoC Audio for the Texas Instruments OMAP chips"
depends on ARCH_OMAP && SND_SOC

config SND_OMAP_SOC_MCBSP
tristate
select OMAP_MCBSP

config SND_OMAP_SOC_N810
tristate "SoC Audio support for Nokia N810"
depends on SND_OMAP_SOC && MACH_NOKIA_N810
select SND_OMAP_SOC_MCBSP
select SND_SOC_TLV320AIC3X
help
Say Y if you want to add support for SoC audio on Nokia N810.

endmenu
11 changes: 11 additions & 0 deletions sound/soc/omap/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OMAP Platform Support
snd-soc-omap-objs := omap-pcm.o
snd-soc-omap-mcbsp-objs := omap-mcbsp.o

obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o

# OMAP Machine Support
snd-soc-n810-objs := n810.o

obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
Loading

0 comments on commit 25a0258

Please sign in to comment.