aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-13 03:50:03 +1000
committerPaul Mackerras <paulus@samba.org>2007-04-13 03:50:03 +1000
commite049d1ca3094f3d1d94617f456a9961202f96e3a (patch)
treea30397ad22f2fbea268bd28fa69c60aad9dfa62a /sound
parentedfac96a92b88d3b0b53e3f8231b74beee9ecd1d (diff)
parent80584ff3b99c36ead7e130e453b3a48b18072d18 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/dmasound/dmasound_core.c20
-rw-r--r--sound/pci/ac97/ac97_patch.c13
-rw-r--r--sound/pci/hda/hda_intel.c17
-rw-r--r--sound/pci/hda/patch_analog.c41
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c30
-rw-r--r--sound/pci/intel8x0.c10
-rw-r--r--sound/soc/Kconfig2
-rw-r--r--sound/soc/at91/Kconfig3
-rw-r--r--sound/soc/pxa/Kconfig3
10 files changed, 114 insertions, 27 deletions
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index a0ec886f2aa..f4056a9c371 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -1346,22 +1346,34 @@ static const struct file_operations sq_fops =
.ioctl = sq_ioctl,
.open = sq_open,
.release = sq_release,
+};
+
#ifdef HAS_RECORD
- .read = NULL /* default to no read for compat mode */
-#endif
+static const struct file_operations sq_fops_record =
+{
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .write = sq_write,
+ .poll = sq_poll,
+ .ioctl = sq_ioctl,
+ .open = sq_open,
+ .release = sq_release,
+ .read = sq_read,
};
+#endif
static int sq_init(void)
{
+ const struct file_operations *fops = &sq_fops;
#ifndef MODULE
int sq_unit;
#endif
#ifdef HAS_RECORD
if (dmasound.mach.record)
- sq_fops.read = sq_read ;
+ fops = &sq_fops_record;
#endif
- sq_unit = register_sound_dsp(&sq_fops, -1);
+ sq_unit = register_sound_dsp(fops, -1);
if (sq_unit < 0) {
printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
return sq_unit ;
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 37fabf75daa..b188a4df58c 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1962,9 +1962,11 @@ static int snd_ac97_ad1888_downmix_put(struct snd_kcontrol *kcontrol, struct snd
static void ad1888_update_jacks(struct snd_ac97 *ac97)
{
unsigned short val = 0;
- if (! is_shared_linein(ac97))
+ /* clear LODIS if shared jack is to be used for Surround out */
+ if (is_shared_linein(ac97))
val |= (1 << 12);
- if (! is_shared_micin(ac97))
+ /* clear CLDIS if shared jack is to be used for C/LFE out */
+ if (is_shared_micin(ac97))
val |= (1 << 11);
/* shared Line-In */
snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val);
@@ -2136,8 +2138,9 @@ static const struct snd_kcontrol_new snd_ac97_ad1985_controls[] = {
static void ad1985_update_jacks(struct snd_ac97 *ac97)
{
ad1888_update_jacks(ac97);
+ /* clear OMS if shared jack is to be used for C/LFE out */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9,
- is_shared_micin(ac97) ? 0 : 1 << 9);
+ is_shared_micin(ac97) ? 1 << 9 : 0);
}
static int patch_ad1985_specific(struct snd_ac97 *ac97)
@@ -2418,9 +2421,9 @@ static void ad1986_update_jacks(struct snd_ac97 *ac97)
unsigned short ser_val;
/* disable SURROUND and CENTER/LFE if not surround mode */
- if (! is_surround_on(ac97))
+ if (!is_surround_on(ac97))
misc_val |= AC97_AD1986_SODIS;
- if (! is_clfe_on(ac97))
+ if (!is_clfe_on(ac97))
misc_val |= AC97_AD1986_CLDIS;
/* select line input (default=LINE_IN, SURROUND or MIC_1/2) */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b9a8e238b0a..1672cace1ae 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
/* STATESTS int mask: SD2,SD1,SD0 */
#define STATESTS_INT_MASK 0x07
-#define AZX_MAX_CODECS 3
/* SD_CTL bits */
#define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
* Codec initialization
*/
+static unsigned int azx_max_codecs[] __devinitdata = {
+ [AZX_DRIVER_ICH] = 3,
+ [AZX_DRIVER_ATI] = 4,
+ [AZX_DRIVER_ATIHDMI] = 4,
+ [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */
+ [AZX_DRIVER_SIS] = 3, /* FIXME: correct? */
+ [AZX_DRIVER_ULI] = 3, /* FIXME: correct? */
+ [AZX_DRIVER_NVIDIA] = 3, /* FIXME: correct? */
+};
+
static int __devinit azx_codec_create(struct azx *chip, const char *model)
{
struct hda_bus_template bus_temp;
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
return err;
codecs = 0;
- for (c = 0; c < AZX_MAX_CODECS; c++) {
+ for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) {
if ((chip->codec_mask & (1 << c)) & probe_mask) {
err = snd_hda_codec_new(chip->bus, c, NULL);
if (err < 0)
@@ -1078,6 +1087,10 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
runtime->hw.rates = hinfo->rates;
snd_pcm_limit_hw_rates(runtime);
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
+ snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ 128);
+ snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ 128);
if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) {
azx_release_device(azx_dev);
mutex_unlock(&chip->open_mutex);
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 00ace59b05c..f94f1f22889 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -833,12 +833,14 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK),
SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
+ SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
+ SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP),
SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD),
SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP),
@@ -1205,7 +1207,7 @@ static struct hda_verb ad1981_init_verbs[] = {
/*
* Patch for HP nx6320
*
- * nx6320 uses EAPD in the reserve way - EAPD-on means the internal
+ * nx6320 uses EAPD in the reverse way - EAPD-on means the internal
* speaker output enabled _and_ mute-LED off.
*/
@@ -1373,6 +1375,21 @@ static int ad1981_hp_init(struct hda_codec *codec)
return 0;
}
+/* configuration for Toshiba Laptops */
+static struct hda_verb ad1981_toshiba_init_verbs[] = {
+ {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */
+ /* pin sensing on HP and Mic jacks */
+ {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT},
+ {0x08, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_MIC_EVENT},
+ {}
+};
+
+static struct snd_kcontrol_new ad1981_toshiba_mixers[] = {
+ HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT),
+ { }
+};
+
/* configuration for Lenovo Thinkpad T60 */
static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
@@ -1418,6 +1435,7 @@ enum {
AD1981_BASIC,
AD1981_HP,
AD1981_THINKPAD,
+ AD1981_TOSHIBA,
AD1981_MODELS
};
@@ -1425,6 +1443,7 @@ static const char *ad1981_models[AD1981_MODELS] = {
[AD1981_HP] = "hp",
[AD1981_THINKPAD] = "thinkpad",
[AD1981_BASIC] = "basic",
+ [AD1981_TOSHIBA] = "toshiba"
};
static struct snd_pci_quirk ad1981_cfg_tbl[] = {
@@ -1435,6 +1454,7 @@ static struct snd_pci_quirk ad1981_cfg_tbl[] = {
/* Lenovo Thinkpad T60/X60/Z6xx */
SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD),
SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
+ SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba U205", AD1981_TOSHIBA),
{}
};
@@ -1485,8 +1505,17 @@ static int patch_ad1981(struct hda_codec *codec)
spec->mixers[0] = ad1981_thinkpad_mixers;
spec->input_mux = &ad1981_thinkpad_capture_source;
break;
+ case AD1981_TOSHIBA:
+ spec->mixers[0] = ad1981_hp_mixers;
+ spec->mixers[1] = ad1981_toshiba_mixers;
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = ad1981_toshiba_init_verbs;
+ spec->multiout.dig_out_nid = 0;
+ spec->input_mux = &ad1981_hp_capture_source;
+ codec->patch_ops.init = ad1981_hp_init;
+ codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
+ break;
}
-
return 0;
}
@@ -2607,6 +2636,12 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = {
[AD1988_AUTO] = "auto",
};
+static struct snd_pci_quirk ad1988_cfg_tbl[] = {
+ SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
+ SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
+ {}
+};
+
static int patch_ad1988(struct hda_codec *codec)
{
struct ad198x_spec *spec;
@@ -2623,7 +2658,7 @@ static int patch_ad1988(struct hda_codec *codec)
snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST,
- ad1988_models, NULL);
+ ad1988_models, ad1988_cfg_tbl);
if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n");
board_config = AD1988_AUTO;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 84d005ef30e..fba3cb11bc2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4186,6 +4186,8 @@ static const char *alc260_models[ALC260_MODEL_LAST] = {
static struct snd_pci_quirk alc260_cfg_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
+ SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
+ SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP),
SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 4c7b03996be..c94291bc536 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -60,7 +60,8 @@ enum {
STAC_D945GTP5,
STAC_MACMINI,
STAC_MACBOOK,
- STAC_MACBOOK_PRO,
+ STAC_MACBOOK_PRO_V1,
+ STAC_MACBOOK_PRO_V2,
STAC_922X_MODELS
};
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
0x400000fc, 0x400000fb,
};
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+ 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
+ 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
+ 0x02a19320, 0x400000fb
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
[STAC_D945GTP5] = d945gtp5_pin_configs,
[STAC_MACMINI] = d945gtp5_pin_configs,
[STAC_MACBOOK] = macbook_pin_configs,
- [STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+ [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+ [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
};
static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
[STAC_D945GTP3] = "3stack",
[STAC_MACMINI] = "macmini",
[STAC_MACBOOK] = "macbook",
- [STAC_MACBOOK_PRO] = "macbook-pro",
+ [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1",
+ [STAC_MACBOOK_PRO_V2] = "macbook-pro",
};
static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1600,6 +1609,11 @@ static int stac92xx_init(struct hda_codec *codec)
for (i = 0; i < cfg->hp_outs; i++)
enable_pin_detect(codec, cfg->hp_pins[i],
STAC_HP_EVENT);
+ /* force to enable the first line-out; the others are set up
+ * in unsol_event
+ */
+ stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
+ AC_PINCTL_OUT_EN);
stac92xx_auto_init_hp_out(codec);
/* fake event to set up pins */
codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
@@ -1889,9 +1903,13 @@ static int patch_stac922x(struct hda_codec *codec)
/* Intel Macs have all same PCI SSID, so we need to check
* codec SSID to distinguish the exact models
*/
+ printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id);
switch (codec->subsystem_id) {
- case 0x106b1e00:
- spec->board_config = STAC_MACBOOK_PRO;
+ case 0x106b0200: /* MacBook Pro first generation */
+ spec->board_config = STAC_MACBOOK_PRO_V1;
+ break;
+ case 0x106b1e00: /* MacBook Pro second generation */
+ spec->board_config = STAC_MACBOOK_PRO_V2;
break;
}
}
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index a289abfc717..7cf2dcb9d8d 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -725,10 +725,11 @@ static void fill_nocache(void *buf, int size, int nocache)
static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev)
{
unsigned long port = ichdev->reg_offset;
+ unsigned long flags;
int status, civ, i, step;
int ack = 0;
- spin_lock(&chip->reg_lock);
+ spin_lock_irqsave(&chip->reg_lock, flags);
status = igetbyte(chip, port + ichdev->roff_sr);
civ = igetbyte(chip, port + ICH_REG_OFF_CIV);
if (!(status & ICH_BCIS)) {
@@ -768,7 +769,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
ack = 1;
}
}
- spin_unlock(&chip->reg_lock);
+ spin_unlock_irqrestore(&chip->reg_lock, flags);
if (ack && ichdev->substream) {
snd_pcm_period_elapsed(ichdev->substream);
}
@@ -2470,7 +2471,10 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state)
}
pci_disable_device(pci);
pci_save_state(pci);
- pci_set_power_state(pci, pci_choose_state(pci, state));
+ /* The call below may disable built-in speaker on some laptops
+ * after S2RAM. So, don't touch it.
+ */
+ /* pci_set_power_state(pci, pci_choose_state(pci, state)); */
return 0;
}
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index ec821a57f84..dccaa4be679 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -10,6 +10,8 @@ config SND_SOC_AC97_BUS
config SND_SOC
tristate "SoC audio support"
+ depends on SND
+ select SND_PCM
---help---
If you want SoC support, you should say Y here and also to the
diff --git a/sound/soc/at91/Kconfig b/sound/soc/at91/Kconfig
index 5bcf08b728b..a5b2558916c 100644
--- a/sound/soc/at91/Kconfig
+++ b/sound/soc/at91/Kconfig
@@ -2,8 +2,7 @@ menu "SoC Audio for the Atmel AT91"
config SND_AT91_SOC
tristate "SoC Audio for the Atmel AT91 System-on-Chip"
- depends on ARCH_AT91 && SND
- select SND_PCM
+ depends on ARCH_AT91 && SND_SOC
help
Say Y or M if you want to add support for codecs attached to
the AT91 SSC interface. You will also need
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 579e1c8d2b2..b9ab3b8e1d3 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -2,8 +2,7 @@ menu "SoC Audio for the Intel PXA2xx"
config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip"
- depends on ARCH_PXA && SND
- select SND_PCM
+ depends on ARCH_PXA && SND_SOC
help
Say Y or M if you want to add support for codecs attached to
the PXA2xx AC97, I2S or SSP interface. You will also need