aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/drivers/pcsp/pcsp.c1
-rw-r--r--sound/isa/Kconfig2
-rw-r--r--sound/pci/hda/hda_beep.c8
-rw-r--r--sound/pci/hda/hda_beep.h1
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/hda_proc.c2
-rw-r--r--sound/pci/hda/patch_analog.c2
-rw-r--r--sound/pci/hda/patch_realtek.c1
-rw-r--r--sound/pci/hda/patch_sigmatel.c377
-rw-r--r--sound/pci/pcxhr/pcxhr.c5
-rw-r--r--sound/pci/rme9652/hdsp.c27
-rw-r--r--sound/soc/fsl/Kconfig3
-rw-r--r--sound/soc/omap/omap-pcm.c2
-rw-r--r--sound/sound_core.c6
14 files changed, 332 insertions, 109 deletions
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index 1899cf0685bc..8e52b2a8a13a 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -96,7 +96,6 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
96 return -EINVAL; 96 return -EINVAL;
97 97
98 hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 98 hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
99 pcsp_chip.timer.cb_mode = HRTIMER_CB_SOFTIRQ;
100 pcsp_chip.timer.function = pcsp_do_timer; 99 pcsp_chip.timer.function = pcsp_do_timer;
101 100
102 card = snd_card_new(index, id, THIS_MODULE, 0); 101 card = snd_card_new(index, id, THIS_MODULE, 0);
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index 660beb41f767..ce0aa044e274 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -211,7 +211,7 @@ config SND_GUSCLASSIC
211 211
212config SND_GUSEXTREME 212config SND_GUSEXTREME
213 tristate "Gravis UltraSound Extreme" 213 tristate "Gravis UltraSound Extreme"
214 select SND_HWDEP 214 select SND_OPL3_LIB
215 select SND_MPU401_UART 215 select SND_MPU401_UART
216 select SND_PCM 216 select SND_PCM
217 help 217 help
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 9b77b3e0fa98..3ecd7e797dee 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work)
37 container_of(work, struct hda_beep, beep_work); 37 container_of(work, struct hda_beep, beep_work);
38 struct hda_codec *codec = beep->codec; 38 struct hda_codec *codec = beep->codec;
39 39
40 if (!beep->enabled)
41 return;
42
40 /* generate tone */ 43 /* generate tone */
41 snd_hda_codec_write_cache(codec, beep->nid, 0, 44 snd_hda_codec_write_cache(codec, beep->nid, 0,
42 AC_VERB_SET_BEEP_CONTROL, beep->tone); 45 AC_VERB_SET_BEEP_CONTROL, beep->tone);
@@ -85,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
85 snprintf(beep->phys, sizeof(beep->phys), 88 snprintf(beep->phys, sizeof(beep->phys),
86 "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); 89 "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
87 input_dev = input_allocate_device(); 90 input_dev = input_allocate_device();
91 if (!input_dev) {
92 kfree(beep);
93 return -ENOMEM;
94 }
88 95
89 /* setup digital beep device */ 96 /* setup digital beep device */
90 input_dev->name = "HDA Digital PCBeep"; 97 input_dev->name = "HDA Digital PCBeep";
@@ -115,6 +122,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
115 beep->nid = nid; 122 beep->nid = nid;
116 beep->dev = input_dev; 123 beep->dev = input_dev;
117 beep->codec = codec; 124 beep->codec = codec;
125 beep->enabled = 1;
118 codec->beep = beep; 126 codec->beep = beep;
119 127
120 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); 128 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index de4036e6e710..b9679f081cae 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -31,6 +31,7 @@ struct hda_beep {
31 char phys[32]; 31 char phys[32];
32 int tone; 32 int tone;
33 int nid; 33 int nid;
34 int enabled;
34 struct work_struct beep_work; /* scheduled task for beep event */ 35 struct work_struct beep_work; /* scheduled task for beep event */
35}; 36};
36 37
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index ba1ab737b55f..eb9164176dab 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1436,12 +1436,12 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
1436{ 1436{
1437 hda_nid_t *d; 1437 hda_nid_t *d;
1438 1438
1439 snd_hda_codec_write(codec, nid, 0, verb, val); 1439 snd_hda_codec_write_cache(codec, nid, 0, verb, val);
1440 d = codec->slave_dig_outs; 1440 d = codec->slave_dig_outs;
1441 if (!d) 1441 if (!d)
1442 return; 1442 return;
1443 for (; *d; d++) 1443 for (; *d; d++)
1444 snd_hda_codec_write(codec, *d, 0, verb, val); 1444 snd_hda_codec_write_cache(codec, *d, 0, verb, val);
1445} 1445}
1446 1446
1447static inline void set_dig_out_convert(struct hda_codec *codec, hda_nid_t nid, 1447static inline void set_dig_out_convert(struct hda_codec *codec, hda_nid_t nid,
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 743d77922bce..c39af986bff1 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -483,6 +483,8 @@ static void print_gpio(struct snd_info_buffer *buffer,
483 (gpio & AC_GPIO_UNSOLICITED) ? 1 : 0, 483 (gpio & AC_GPIO_UNSOLICITED) ? 1 : 0,
484 (gpio & AC_GPIO_WAKE) ? 1 : 0); 484 (gpio & AC_GPIO_WAKE) ? 1 : 0);
485 max = gpio & AC_GPIO_IO_COUNT; 485 max = gpio & AC_GPIO_IO_COUNT;
486 if (!max || max > 8)
487 return;
486 enable = snd_hda_codec_read(codec, nid, 0, 488 enable = snd_hda_codec_read(codec, nid, 0,
487 AC_VERB_GET_GPIO_MASK, 0); 489 AC_VERB_GET_GPIO_MASK, 0);
488 direction = snd_hda_codec_read(codec, nid, 0, 490 direction = snd_hda_codec_read(codec, nid, 0,
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index d3fd432cb3ea..686c77491dea 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3861,6 +3861,8 @@ static const char *ad1884a_models[AD1884A_MODELS] = {
3861static struct snd_pci_quirk ad1884a_cfg_tbl[] = { 3861static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
3862 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), 3862 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
3863 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), 3863 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
3864 SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP),
3865 SND_PCI_QUIRK(0x103c, 0x3614, "HP 6730s", AD1884A_LAPTOP),
3864 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), 3866 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD),
3865 {} 3867 {}
3866}; 3868};
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a4666c96a44f..a378c0145125 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8469,6 +8469,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8469 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), 8469 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
8470 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), 8470 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY),
8471 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), 8471 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2),
8472 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG),
8472 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), 8473 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
8473 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), 8474 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
8474 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), 8475 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index e6085915d86d..b77f330d2650 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -36,9 +36,11 @@
36#include "hda_beep.h" 36#include "hda_beep.h"
37 37
38#define NUM_CONTROL_ALLOC 32 38#define NUM_CONTROL_ALLOC 32
39
40#define STAC_VREF_EVENT 0x00
41#define STAC_INSERT_EVENT 0x10
39#define STAC_PWR_EVENT 0x20 42#define STAC_PWR_EVENT 0x20
40#define STAC_HP_EVENT 0x30 43#define STAC_HP_EVENT 0x30
41#define STAC_VREF_EVENT 0x40
42 44
43enum { 45enum {
44 STAC_REF, 46 STAC_REF,
@@ -67,8 +69,11 @@ enum {
67}; 69};
68 70
69enum { 71enum {
72 STAC_92HD73XX_NO_JD, /* no jack-detection */
70 STAC_92HD73XX_REF, 73 STAC_92HD73XX_REF,
71 STAC_DELL_M6, 74 STAC_DELL_M6_AMIC,
75 STAC_DELL_M6_DMIC,
76 STAC_DELL_M6_BOTH,
72 STAC_DELL_EQ, 77 STAC_DELL_EQ,
73 STAC_92HD73XX_MODELS 78 STAC_92HD73XX_MODELS
74}; 79};
@@ -82,6 +87,7 @@ enum {
82 STAC_92HD71BXX_REF, 87 STAC_92HD71BXX_REF,
83 STAC_DELL_M4_1, 88 STAC_DELL_M4_1,
84 STAC_DELL_M4_2, 89 STAC_DELL_M4_2,
90 STAC_DELL_M4_3,
85 STAC_HP_M4, 91 STAC_HP_M4,
86 STAC_92HD71BXX_MODELS 92 STAC_92HD71BXX_MODELS
87}; 93};
@@ -122,6 +128,7 @@ enum {
122}; 128};
123 129
124enum { 130enum {
131 STAC_D965_REF_NO_JD, /* no jack-detection */
125 STAC_D965_REF, 132 STAC_D965_REF,
126 STAC_D965_3ST, 133 STAC_D965_3ST,
127 STAC_D965_5ST, 134 STAC_D965_5ST,
@@ -135,6 +142,7 @@ struct sigmatel_spec {
135 unsigned int num_mixers; 142 unsigned int num_mixers;
136 143
137 int board_config; 144 int board_config;
145 unsigned int eapd_switch: 1;
138 unsigned int surr_switch: 1; 146 unsigned int surr_switch: 1;
139 unsigned int line_switch: 1; 147 unsigned int line_switch: 1;
140 unsigned int mic_switch: 1; 148 unsigned int mic_switch: 1;
@@ -212,7 +220,7 @@ struct sigmatel_spec {
212 /* i/o switches */ 220 /* i/o switches */
213 unsigned int io_switch[2]; 221 unsigned int io_switch[2];
214 unsigned int clfe_swap; 222 unsigned int clfe_swap;
215 unsigned int hp_switch; 223 unsigned int hp_switch; /* NID of HP as line-out */
216 unsigned int aloopback; 224 unsigned int aloopback;
217 225
218 struct hda_pcm pcm_rec[2]; /* PCM information */ 226 struct hda_pcm pcm_rec[2]; /* PCM information */
@@ -851,6 +859,7 @@ static struct hda_verb stac92hd83xxx_core_init[] = {
851 859
852 /* power state controls amps */ 860 /* power state controls amps */
853 { 0x01, AC_VERB_SET_EAPD, 1 << 2}, 861 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
862 {}
854}; 863};
855 864
856static struct hda_verb stac92hd71bxx_core_init[] = { 865static struct hda_verb stac92hd71bxx_core_init[] = {
@@ -862,6 +871,7 @@ static struct hda_verb stac92hd71bxx_core_init[] = {
862 { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 871 { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
863 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 872 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
864 { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 873 { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
874 {}
865}; 875};
866 876
867#define HD_DISABLE_PORTF 2 877#define HD_DISABLE_PORTF 2
@@ -1598,13 +1608,18 @@ static unsigned int dell_m6_pin_configs[13] = {
1598 1608
1599static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { 1609static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
1600 [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, 1610 [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs,
1601 [STAC_DELL_M6] = dell_m6_pin_configs, 1611 [STAC_DELL_M6_AMIC] = dell_m6_pin_configs,
1612 [STAC_DELL_M6_DMIC] = dell_m6_pin_configs,
1613 [STAC_DELL_M6_BOTH] = dell_m6_pin_configs,
1602 [STAC_DELL_EQ] = dell_m6_pin_configs, 1614 [STAC_DELL_EQ] = dell_m6_pin_configs,
1603}; 1615};
1604 1616
1605static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { 1617static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
1618 [STAC_92HD73XX_NO_JD] = "no-jd",
1606 [STAC_92HD73XX_REF] = "ref", 1619 [STAC_92HD73XX_REF] = "ref",
1607 [STAC_DELL_M6] = "dell-m6", 1620 [STAC_DELL_M6_AMIC] = "dell-m6-amic",
1621 [STAC_DELL_M6_DMIC] = "dell-m6-dmic",
1622 [STAC_DELL_M6_BOTH] = "dell-m6",
1608 [STAC_DELL_EQ] = "dell-eq", 1623 [STAC_DELL_EQ] = "dell-eq",
1609}; 1624};
1610 1625
@@ -1613,19 +1628,25 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1613 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1628 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1614 "DFI LanParty", STAC_92HD73XX_REF), 1629 "DFI LanParty", STAC_92HD73XX_REF),
1615 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, 1630 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254,
1616 "unknown Dell", STAC_DELL_M6), 1631 "Dell Studio 1535", STAC_DELL_M6_DMIC),
1617 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, 1632 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255,
1618 "unknown Dell", STAC_DELL_M6), 1633 "unknown Dell", STAC_DELL_M6_DMIC),
1619 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256, 1634 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256,
1620 "unknown Dell", STAC_DELL_M6), 1635 "unknown Dell", STAC_DELL_M6_BOTH),
1621 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0257, 1636 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0257,
1622 "unknown Dell", STAC_DELL_M6), 1637 "unknown Dell", STAC_DELL_M6_BOTH),
1623 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025e, 1638 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025e,
1624 "unknown Dell", STAC_DELL_M6), 1639 "unknown Dell", STAC_DELL_M6_AMIC),
1625 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025f, 1640 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x025f,
1626 "unknown Dell", STAC_DELL_M6), 1641 "unknown Dell", STAC_DELL_M6_AMIC),
1627 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271, 1642 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271,
1628 "unknown Dell", STAC_DELL_M6), 1643 "unknown Dell", STAC_DELL_M6_DMIC),
1644 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0272,
1645 "unknown Dell", STAC_DELL_M6_DMIC),
1646 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
1647 "Dell Studio 1537", STAC_DELL_M6_DMIC),
1648 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
1649 "Dell Studio 17", STAC_DELL_M6_DMIC),
1629 {} /* terminator */ 1650 {} /* terminator */
1630}; 1651};
1631 1652
@@ -1648,6 +1669,7 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1648 /* SigmaTel reference board */ 1669 /* SigmaTel reference board */
1649 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1670 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1650 "DFI LanParty", STAC_92HD71BXX_REF), 1671 "DFI LanParty", STAC_92HD71BXX_REF),
1672 {} /* terminator */
1651}; 1673};
1652 1674
1653static unsigned int ref92hd71bxx_pin_configs[11] = { 1675static unsigned int ref92hd71bxx_pin_configs[11] = {
@@ -1668,10 +1690,17 @@ static unsigned int dell_m4_2_pin_configs[11] = {
1668 0x40f000f0, 0x044413b0, 0x044413b0, 1690 0x40f000f0, 0x044413b0, 0x044413b0,
1669}; 1691};
1670 1692
1693static unsigned int dell_m4_3_pin_configs[11] = {
1694 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
1695 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a000f0,
1696 0x40f000f0, 0x044413b0, 0x044413b0,
1697};
1698
1671static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { 1699static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1672 [STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs, 1700 [STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs,
1673 [STAC_DELL_M4_1] = dell_m4_1_pin_configs, 1701 [STAC_DELL_M4_1] = dell_m4_1_pin_configs,
1674 [STAC_DELL_M4_2] = dell_m4_2_pin_configs, 1702 [STAC_DELL_M4_2] = dell_m4_2_pin_configs,
1703 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1675 [STAC_HP_M4] = NULL, 1704 [STAC_HP_M4] = NULL,
1676}; 1705};
1677 1706
@@ -1679,6 +1708,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1679 [STAC_92HD71BXX_REF] = "ref", 1708 [STAC_92HD71BXX_REF] = "ref",
1680 [STAC_DELL_M4_1] = "dell-m4-1", 1709 [STAC_DELL_M4_1] = "dell-m4-1",
1681 [STAC_DELL_M4_2] = "dell-m4-2", 1710 [STAC_DELL_M4_2] = "dell-m4-2",
1711 [STAC_DELL_M4_3] = "dell-m4-3",
1682 [STAC_HP_M4] = "hp-m4", 1712 [STAC_HP_M4] = "hp-m4",
1683}; 1713};
1684 1714
@@ -1686,6 +1716,10 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1686 /* SigmaTel reference board */ 1716 /* SigmaTel reference board */
1687 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1717 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1688 "DFI LanParty", STAC_92HD71BXX_REF), 1718 "DFI LanParty", STAC_92HD71BXX_REF),
1719 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2,
1720 "HP dv5", STAC_HP_M4),
1721 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
1722 "HP dv7", STAC_HP_M4),
1689 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, 1723 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1690 "unknown HP", STAC_HP_M4), 1724 "unknown HP", STAC_HP_M4),
1691 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1725 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -1710,6 +1744,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1710 "unknown Dell", STAC_DELL_M4_2), 1744 "unknown Dell", STAC_DELL_M4_2),
1711 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264, 1745 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264,
1712 "unknown Dell", STAC_DELL_M4_2), 1746 "unknown Dell", STAC_DELL_M4_2),
1747 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02aa,
1748 "unknown Dell", STAC_DELL_M4_3),
1713 {} /* terminator */ 1749 {} /* terminator */
1714}; 1750};
1715 1751
@@ -1999,6 +2035,7 @@ static unsigned int dell_3st_pin_configs[14] = {
1999}; 2035};
2000 2036
2001static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { 2037static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
2038 [STAC_D965_REF_NO_JD] = ref927x_pin_configs,
2002 [STAC_D965_REF] = ref927x_pin_configs, 2039 [STAC_D965_REF] = ref927x_pin_configs,
2003 [STAC_D965_3ST] = d965_3st_pin_configs, 2040 [STAC_D965_3ST] = d965_3st_pin_configs,
2004 [STAC_D965_5ST] = d965_5st_pin_configs, 2041 [STAC_D965_5ST] = d965_5st_pin_configs,
@@ -2007,6 +2044,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
2007}; 2044};
2008 2045
2009static const char *stac927x_models[STAC_927X_MODELS] = { 2046static const char *stac927x_models[STAC_927X_MODELS] = {
2047 [STAC_D965_REF_NO_JD] = "ref-no-jd",
2010 [STAC_D965_REF] = "ref", 2048 [STAC_D965_REF] = "ref",
2011 [STAC_D965_3ST] = "3stack", 2049 [STAC_D965_3ST] = "3stack",
2012 [STAC_D965_5ST] = "5stack", 2050 [STAC_D965_5ST] = "5stack",
@@ -2443,7 +2481,7 @@ static int stac92xx_hp_switch_get(struct snd_kcontrol *kcontrol,
2443 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2444 struct sigmatel_spec *spec = codec->spec; 2482 struct sigmatel_spec *spec = codec->spec;
2445 2483
2446 ucontrol->value.integer.value[0] = spec->hp_switch; 2484 ucontrol->value.integer.value[0] = !!spec->hp_switch;
2447 return 0; 2485 return 0;
2448} 2486}
2449 2487
@@ -2452,8 +2490,9 @@ static int stac92xx_hp_switch_put(struct snd_kcontrol *kcontrol,
2452{ 2490{
2453 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2491 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2454 struct sigmatel_spec *spec = codec->spec; 2492 struct sigmatel_spec *spec = codec->spec;
2455 2493 int nid = kcontrol->private_value;
2456 spec->hp_switch = ucontrol->value.integer.value[0]; 2494
2495 spec->hp_switch = ucontrol->value.integer.value[0] ? nid : 0;
2457 2496
2458 /* check to be sure that the ports are upto date with 2497 /* check to be sure that the ports are upto date with
2459 * switch changes 2498 * switch changes
@@ -2586,8 +2625,10 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
2586}; 2625};
2587 2626
2588/* add dynamic controls */ 2627/* add dynamic controls */
2589static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type, 2628static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
2590 int idx, const char *name, unsigned long val) 2629 struct snd_kcontrol_new *ktemp,
2630 int idx, const char *name,
2631 unsigned long val)
2591{ 2632{
2592 struct snd_kcontrol_new *knew; 2633 struct snd_kcontrol_new *knew;
2593 2634
@@ -2606,20 +2647,29 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
2606 } 2647 }
2607 2648
2608 knew = &spec->kctl_alloc[spec->num_kctl_used]; 2649 knew = &spec->kctl_alloc[spec->num_kctl_used];
2609 *knew = stac92xx_control_templates[type]; 2650 *knew = *ktemp;
2610 knew->index = idx; 2651 knew->index = idx;
2611 knew->name = kstrdup(name, GFP_KERNEL); 2652 knew->name = kstrdup(name, GFP_KERNEL);
2612 if (! knew->name) 2653 if (!knew->name)
2613 return -ENOMEM; 2654 return -ENOMEM;
2614 knew->private_value = val; 2655 knew->private_value = val;
2615 spec->num_kctl_used++; 2656 spec->num_kctl_used++;
2616 return 0; 2657 return 0;
2617} 2658}
2618 2659
2660static inline int stac92xx_add_control_idx(struct sigmatel_spec *spec,
2661 int type, int idx, const char *name,
2662 unsigned long val)
2663{
2664 return stac92xx_add_control_temp(spec,
2665 &stac92xx_control_templates[type],
2666 idx, name, val);
2667}
2668
2619 2669
2620/* add dynamic controls */ 2670/* add dynamic controls */
2621static int stac92xx_add_control(struct sigmatel_spec *spec, int type, 2671static inline int stac92xx_add_control(struct sigmatel_spec *spec, int type,
2622 const char *name, unsigned long val) 2672 const char *name, unsigned long val)
2623{ 2673{
2624 return stac92xx_add_control_idx(spec, type, 0, name, val); 2674 return stac92xx_add_control_idx(spec, type, 0, name, val);
2625} 2675}
@@ -2856,13 +2906,14 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
2856 } 2906 }
2857 2907
2858 if ((spec->multiout.num_dacs - cfg->line_outs) > 0 && 2908 if ((spec->multiout.num_dacs - cfg->line_outs) > 0 &&
2859 cfg->hp_outs && !spec->multiout.hp_nid) 2909 cfg->hp_outs == 1 && !spec->multiout.hp_nid)
2860 spec->multiout.hp_nid = nid; 2910 spec->multiout.hp_nid = nid;
2861 2911
2862 if (cfg->hp_outs > 1) { 2912 if (cfg->hp_outs > 1 && cfg->line_out_type == AUTO_PIN_LINE_OUT) {
2863 err = stac92xx_add_control(spec, 2913 err = stac92xx_add_control(spec,
2864 STAC_CTL_WIDGET_HP_SWITCH, 2914 STAC_CTL_WIDGET_HP_SWITCH,
2865 "Headphone as Line Out Switch", 0); 2915 "Headphone as Line Out Switch",
2916 cfg->hp_pins[cfg->hp_outs - 1]);
2866 if (err < 0) 2917 if (err < 0)
2867 return err; 2918 return err;
2868 } 2919 }
@@ -3060,6 +3111,43 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
3060 return 0; 3111 return 0;
3061} 3112}
3062 3113
3114#ifdef CONFIG_SND_HDA_INPUT_BEEP
3115#define stac92xx_dig_beep_switch_info snd_ctl_boolean_mono_info
3116
3117static int stac92xx_dig_beep_switch_get(struct snd_kcontrol *kcontrol,
3118 struct snd_ctl_elem_value *ucontrol)
3119{
3120 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3121 ucontrol->value.integer.value[0] = codec->beep->enabled;
3122 return 0;
3123}
3124
3125static int stac92xx_dig_beep_switch_put(struct snd_kcontrol *kcontrol,
3126 struct snd_ctl_elem_value *ucontrol)
3127{
3128 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3129 int enabled = !!ucontrol->value.integer.value[0];
3130 if (codec->beep->enabled != enabled) {
3131 codec->beep->enabled = enabled;
3132 return 1;
3133 }
3134 return 0;
3135}
3136
3137static struct snd_kcontrol_new stac92xx_dig_beep_ctrl = {
3138 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3139 .info = stac92xx_dig_beep_switch_info,
3140 .get = stac92xx_dig_beep_switch_get,
3141 .put = stac92xx_dig_beep_switch_put,
3142};
3143
3144static int stac92xx_beep_switch_ctl(struct hda_codec *codec)
3145{
3146 return stac92xx_add_control_temp(codec->spec, &stac92xx_dig_beep_ctrl,
3147 0, "PC Beep Playback Switch", 0);
3148}
3149#endif
3150
3063static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) 3151static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
3064{ 3152{
3065 struct sigmatel_spec *spec = codec->spec; 3153 struct sigmatel_spec *spec = codec->spec;
@@ -3366,6 +3454,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3366#ifdef CONFIG_SND_HDA_INPUT_BEEP 3454#ifdef CONFIG_SND_HDA_INPUT_BEEP
3367 if (spec->digbeep_nid > 0) { 3455 if (spec->digbeep_nid > 0) {
3368 hda_nid_t nid = spec->digbeep_nid; 3456 hda_nid_t nid = spec->digbeep_nid;
3457 unsigned int caps;
3369 3458
3370 err = stac92xx_auto_create_beep_ctls(codec, nid); 3459 err = stac92xx_auto_create_beep_ctls(codec, nid);
3371 if (err < 0) 3460 if (err < 0)
@@ -3373,6 +3462,14 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3373 err = snd_hda_attach_beep_device(codec, nid); 3462 err = snd_hda_attach_beep_device(codec, nid);
3374 if (err < 0) 3463 if (err < 0)
3375 return err; 3464 return err;
3465 /* if no beep switch is available, make its own one */
3466 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
3467 if (codec->beep &&
3468 !((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) {
3469 err = stac92xx_beep_switch_ctl(codec);
3470 if (err < 0)
3471 return err;
3472 }
3376 } 3473 }
3377#endif 3474#endif
3378 3475
@@ -3530,6 +3627,12 @@ static int stac9200_parse_auto_config(struct hda_codec *codec)
3530 if ((err = stac9200_auto_create_lfe_ctls(codec, &spec->autocfg)) < 0) 3627 if ((err = stac9200_auto_create_lfe_ctls(codec, &spec->autocfg)) < 0)
3531 return err; 3628 return err;
3532 3629
3630 if (spec->num_muxes > 0) {
3631 err = stac92xx_auto_create_mux_input_ctls(codec);
3632 if (err < 0)
3633 return err;
3634 }
3635
3533 if (spec->autocfg.dig_out_pin) 3636 if (spec->autocfg.dig_out_pin)
3534 spec->multiout.dig_out_nid = 0x05; 3637 spec->multiout.dig_out_nid = 0x05;
3535 if (spec->autocfg.dig_in_pin) 3638 if (spec->autocfg.dig_in_pin)
@@ -3612,10 +3715,14 @@ static void stac92xx_power_down(struct hda_codec *codec)
3612 AC_VERB_SET_POWER_STATE, AC_PWRST_D3); 3715 AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
3613} 3716}
3614 3717
3718static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
3719 int enable);
3720
3615static int stac92xx_init(struct hda_codec *codec) 3721static int stac92xx_init(struct hda_codec *codec)
3616{ 3722{
3617 struct sigmatel_spec *spec = codec->spec; 3723 struct sigmatel_spec *spec = codec->spec;
3618 struct auto_pin_cfg *cfg = &spec->autocfg; 3724 struct auto_pin_cfg *cfg = &spec->autocfg;
3725 unsigned int gpio;
3619 int i; 3726 int i;
3620 3727
3621 snd_hda_sequence_write(codec, spec->init); 3728 snd_hda_sequence_write(codec, spec->init);
@@ -3626,6 +3733,16 @@ static int stac92xx_init(struct hda_codec *codec)
3626 snd_hda_codec_write_cache(codec, 3733 snd_hda_codec_write_cache(codec,
3627 spec->adc_nids[i], 0, 3734 spec->adc_nids[i], 0,
3628 AC_VERB_SET_POWER_STATE, AC_PWRST_D3); 3735 AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
3736
3737 /* set up GPIO */
3738 gpio = spec->gpio_data;
3739 /* turn on EAPD statically when spec->eapd_switch isn't set.
3740 * otherwise, unsol event will turn it on/off dynamically
3741 */
3742 if (!spec->eapd_switch)
3743 gpio |= spec->eapd_mask;
3744 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, gpio);
3745
3629 /* set up pins */ 3746 /* set up pins */
3630 if (spec->hp_detect) { 3747 if (spec->hp_detect) {
3631 /* Enable unsolicited responses on the HP widget */ 3748 /* Enable unsolicited responses on the HP widget */
@@ -3647,53 +3764,61 @@ static int stac92xx_init(struct hda_codec *codec)
3647 for (i = 0; i < AUTO_PIN_LAST; i++) { 3764 for (i = 0; i < AUTO_PIN_LAST; i++) {
3648 hda_nid_t nid = cfg->input_pins[i]; 3765 hda_nid_t nid = cfg->input_pins[i];
3649 if (nid) { 3766 if (nid) {
3650 unsigned int pinctl = snd_hda_codec_read(codec, nid, 3767 unsigned int pinctl;
3651 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3768 if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) {
3652 /* if PINCTL already set then skip */ 3769 /* for mic pins, force to initialize */
3653 if (pinctl & AC_PINCAP_IN) 3770 pinctl = stac92xx_get_vref(codec, nid);
3654 continue; 3771 } else {
3655 pinctl = AC_PINCTL_IN_EN; 3772 pinctl = snd_hda_codec_read(codec, nid, 0,
3656 if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) 3773 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3657 pinctl |= stac92xx_get_vref(codec, nid); 3774 /* if PINCTL already set then skip */
3775 if (pinctl & AC_PINCTL_IN_EN)
3776 continue;
3777 }
3778 pinctl |= AC_PINCTL_IN_EN;
3658 stac92xx_auto_set_pinctl(codec, nid, pinctl); 3779 stac92xx_auto_set_pinctl(codec, nid, pinctl);
3659 } 3780 }
3660 } 3781 }
3661 for (i = 0; i < spec->num_dmics; i++) 3782 for (i = 0; i < spec->num_dmics; i++)
3662 stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i], 3783 stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i],
3663 AC_PINCTL_IN_EN); 3784 AC_PINCTL_IN_EN);
3785 if (cfg->dig_out_pin)
3786 stac92xx_auto_set_pinctl(codec, cfg->dig_out_pin,
3787 AC_PINCTL_OUT_EN);
3788 if (cfg->dig_in_pin)
3789 stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin,
3790 AC_PINCTL_IN_EN);
3664 for (i = 0; i < spec->num_pwrs; i++) { 3791 for (i = 0; i < spec->num_pwrs; i++) {
3665 int event = is_nid_hp_pin(cfg, spec->pwr_nids[i]) 3792 hda_nid_t nid = spec->pwr_nids[i];
3666 ? STAC_HP_EVENT : STAC_PWR_EVENT; 3793 int pinctl, def_conf;
3667 int pinctl = snd_hda_codec_read(codec, spec->pwr_nids[i], 3794 int event = STAC_PWR_EVENT;
3668 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 3795
3669 int def_conf = snd_hda_codec_read(codec, spec->pwr_nids[i], 3796 if (is_nid_hp_pin(cfg, nid) && spec->hp_detect)
3670 0, AC_VERB_GET_CONFIG_DEFAULT, 0); 3797 continue; /* already has an unsol event */
3671 def_conf = get_defcfg_connect(def_conf); 3798
3799 pinctl = snd_hda_codec_read(codec, nid, 0,
3800 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3672 /* outputs are only ports capable of power management 3801 /* outputs are only ports capable of power management
3673 * any attempts on powering down a input port cause the 3802 * any attempts on powering down a input port cause the
3674 * referenced VREF to act quirky. 3803 * referenced VREF to act quirky.
3675 */ 3804 */
3676 if (pinctl & AC_PINCTL_IN_EN) 3805 if (pinctl & AC_PINCTL_IN_EN)
3677 continue; 3806 continue;
3807 def_conf = snd_hda_codec_read(codec, nid, 0,
3808 AC_VERB_GET_CONFIG_DEFAULT, 0);
3809 def_conf = get_defcfg_connect(def_conf);
3678 /* skip any ports that don't have jacks since presence 3810 /* skip any ports that don't have jacks since presence
3679 * detection is useless */ 3811 * detection is useless */
3680 if (def_conf && def_conf != AC_JACK_PORT_FIXED) 3812 if (def_conf != AC_JACK_PORT_COMPLEX) {
3813 if (def_conf != AC_JACK_PORT_NONE)
3814 stac_toggle_power_map(codec, nid, 1);
3681 continue; 3815 continue;
3816 }
3682 enable_pin_detect(codec, spec->pwr_nids[i], event | i); 3817 enable_pin_detect(codec, spec->pwr_nids[i], event | i);
3683 codec->patch_ops.unsol_event(codec, (event | i) << 26); 3818 codec->patch_ops.unsol_event(codec, (event | i) << 26);
3684 } 3819 }
3685 if (spec->dac_list) 3820 if (spec->dac_list)
3686 stac92xx_power_down(codec); 3821 stac92xx_power_down(codec);
3687 if (cfg->dig_out_pin)
3688 stac92xx_auto_set_pinctl(codec, cfg->dig_out_pin,
3689 AC_PINCTL_OUT_EN);
3690 if (cfg->dig_in_pin)
3691 stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin,
3692 AC_PINCTL_IN_EN);
3693
3694 stac_gpio_set(codec, spec->gpio_mask,
3695 spec->gpio_dir, spec->gpio_data);
3696
3697 return 0; 3822 return 0;
3698} 3823}
3699 3824
@@ -3776,11 +3901,30 @@ static int get_hp_pin_presence(struct hda_codec *codec, hda_nid_t nid)
3776 return 0; 3901 return 0;
3777} 3902}
3778 3903
3904/* return non-zero if the hp-pin of the given array index isn't
3905 * a jack-detection target
3906 */
3907static int no_hp_sensing(struct sigmatel_spec *spec, int i)
3908{
3909 struct auto_pin_cfg *cfg = &spec->autocfg;
3910
3911 /* ignore sensing of shared line and mic jacks */
3912 if (spec->line_switch &&
3913 cfg->hp_pins[i] == cfg->input_pins[AUTO_PIN_LINE])
3914 return 1;
3915 if (spec->mic_switch &&
3916 cfg->hp_pins[i] == cfg->input_pins[AUTO_PIN_MIC])
3917 return 1;
3918 /* ignore if the pin is set as line-out */
3919 if (cfg->hp_pins[i] == spec->hp_switch)
3920 return 1;
3921 return 0;
3922}
3923
3779static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) 3924static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3780{ 3925{
3781 struct sigmatel_spec *spec = codec->spec; 3926 struct sigmatel_spec *spec = codec->spec;
3782 struct auto_pin_cfg *cfg = &spec->autocfg; 3927 struct auto_pin_cfg *cfg = &spec->autocfg;
3783 int nid = cfg->hp_pins[cfg->hp_outs - 1];
3784 int i, presence; 3928 int i, presence;
3785 3929
3786 presence = 0; 3930 presence = 0;
@@ -3791,52 +3935,66 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3791 for (i = 0; i < cfg->hp_outs; i++) { 3935 for (i = 0; i < cfg->hp_outs; i++) {
3792 if (presence) 3936 if (presence)
3793 break; 3937 break;
3794 if (spec->hp_switch && cfg->hp_pins[i] == nid) 3938 if (no_hp_sensing(spec, i))
3795 break; 3939 continue;
3796 presence = get_hp_pin_presence(codec, cfg->hp_pins[i]); 3940 presence = get_hp_pin_presence(codec, cfg->hp_pins[i]);
3797 } 3941 }
3798 3942
3799 if (presence) { 3943 if (presence) {
3800 /* disable lineouts, enable hp */ 3944 /* disable lineouts */
3801 if (spec->hp_switch) 3945 if (spec->hp_switch)
3802 stac92xx_reset_pinctl(codec, nid, AC_PINCTL_OUT_EN); 3946 stac92xx_reset_pinctl(codec, spec->hp_switch,
3947 AC_PINCTL_OUT_EN);
3803 for (i = 0; i < cfg->line_outs; i++) 3948 for (i = 0; i < cfg->line_outs; i++)
3804 stac92xx_reset_pinctl(codec, cfg->line_out_pins[i], 3949 stac92xx_reset_pinctl(codec, cfg->line_out_pins[i],
3805 AC_PINCTL_OUT_EN); 3950 AC_PINCTL_OUT_EN);
3806 for (i = 0; i < cfg->speaker_outs; i++) 3951 for (i = 0; i < cfg->speaker_outs; i++)
3807 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], 3952 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i],
3808 AC_PINCTL_OUT_EN); 3953 AC_PINCTL_OUT_EN);
3809 if (spec->eapd_mask) 3954 if (spec->eapd_mask && spec->eapd_switch)
3810 stac_gpio_set(codec, spec->gpio_mask, 3955 stac_gpio_set(codec, spec->gpio_mask,
3811 spec->gpio_dir, spec->gpio_data & 3956 spec->gpio_dir, spec->gpio_data &
3812 ~spec->eapd_mask); 3957 ~spec->eapd_mask);
3813 } else { 3958 } else {
3814 /* enable lineouts, disable hp */ 3959 /* enable lineouts */
3815 if (spec->hp_switch) 3960 if (spec->hp_switch)
3816 stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN); 3961 stac92xx_set_pinctl(codec, spec->hp_switch,
3962 AC_PINCTL_OUT_EN);
3817 for (i = 0; i < cfg->line_outs; i++) 3963 for (i = 0; i < cfg->line_outs; i++)
3818 stac92xx_set_pinctl(codec, cfg->line_out_pins[i], 3964 stac92xx_set_pinctl(codec, cfg->line_out_pins[i],
3819 AC_PINCTL_OUT_EN); 3965 AC_PINCTL_OUT_EN);
3820 for (i = 0; i < cfg->speaker_outs; i++) 3966 for (i = 0; i < cfg->speaker_outs; i++)
3821 stac92xx_set_pinctl(codec, cfg->speaker_pins[i], 3967 stac92xx_set_pinctl(codec, cfg->speaker_pins[i],
3822 AC_PINCTL_OUT_EN); 3968 AC_PINCTL_OUT_EN);
3823 if (spec->eapd_mask) 3969 if (spec->eapd_mask && spec->eapd_switch)
3824 stac_gpio_set(codec, spec->gpio_mask, 3970 stac_gpio_set(codec, spec->gpio_mask,
3825 spec->gpio_dir, spec->gpio_data | 3971 spec->gpio_dir, spec->gpio_data |
3826 spec->eapd_mask); 3972 spec->eapd_mask);
3827 } 3973 }
3828 if (!spec->hp_switch && cfg->hp_outs > 1 && presence) 3974 /* toggle hp outs */
3829 stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN); 3975 for (i = 0; i < cfg->hp_outs; i++) {
3976 unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN;
3977 if (no_hp_sensing(spec, i))
3978 continue;
3979 if (presence)
3980 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
3981 else
3982 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val);
3983 }
3830} 3984}
3831 3985
3832static void stac92xx_pin_sense(struct hda_codec *codec, int idx) 3986static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
3987 int enable)
3833{ 3988{
3834 struct sigmatel_spec *spec = codec->spec; 3989 struct sigmatel_spec *spec = codec->spec;
3835 hda_nid_t nid = spec->pwr_nids[idx]; 3990 unsigned int idx, val;
3836 int presence, val; 3991
3837 val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) 3992 for (idx = 0; idx < spec->num_pwrs; idx++) {
3838 & 0x000000ff; 3993 if (spec->pwr_nids[idx] == nid)
3839 presence = get_hp_pin_presence(codec, nid); 3994 break;
3995 }
3996 if (idx >= spec->num_pwrs)
3997 return;
3840 3998
3841 /* several codecs have two power down bits */ 3999 /* several codecs have two power down bits */
3842 if (spec->pwr_mapping) 4000 if (spec->pwr_mapping)
@@ -3844,14 +4002,20 @@ static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
3844 else 4002 else
3845 idx = 1 << idx; 4003 idx = 1 << idx;
3846 4004
3847 if (presence) 4005 val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) & 0xff;
4006 if (enable)
3848 val &= ~idx; 4007 val &= ~idx;
3849 else 4008 else
3850 val |= idx; 4009 val |= idx;
3851 4010
3852 /* power down unused output ports */ 4011 /* power down unused output ports */
3853 snd_hda_codec_write(codec, codec->afg, 0, 0x7ec, val); 4012 snd_hda_codec_write(codec, codec->afg, 0, 0x7ec, val);
3854}; 4013}
4014
4015static void stac92xx_pin_sense(struct hda_codec *codec, hda_nid_t nid)
4016{
4017 stac_toggle_power_map(codec, nid, get_hp_pin_presence(codec, nid));
4018}
3855 4019
3856static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) 4020static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
3857{ 4021{
@@ -4100,14 +4264,17 @@ again:
4100 4264
4101 switch (spec->multiout.num_dacs) { 4265 switch (spec->multiout.num_dacs) {
4102 case 0x3: /* 6 Channel */ 4266 case 0x3: /* 6 Channel */
4267 spec->multiout.hp_nid = 0x17;
4103 spec->mixer = stac92hd73xx_6ch_mixer; 4268 spec->mixer = stac92hd73xx_6ch_mixer;
4104 spec->init = stac92hd73xx_6ch_core_init; 4269 spec->init = stac92hd73xx_6ch_core_init;
4105 break; 4270 break;
4106 case 0x4: /* 8 Channel */ 4271 case 0x4: /* 8 Channel */
4272 spec->multiout.hp_nid = 0x18;
4107 spec->mixer = stac92hd73xx_8ch_mixer; 4273 spec->mixer = stac92hd73xx_8ch_mixer;
4108 spec->init = stac92hd73xx_8ch_core_init; 4274 spec->init = stac92hd73xx_8ch_core_init;
4109 break; 4275 break;
4110 case 0x5: /* 10 Channel */ 4276 case 0x5: /* 10 Channel */
4277 spec->multiout.hp_nid = 0x19;
4111 spec->mixer = stac92hd73xx_10ch_mixer; 4278 spec->mixer = stac92hd73xx_10ch_mixer;
4112 spec->init = stac92hd73xx_10ch_core_init; 4279 spec->init = stac92hd73xx_10ch_core_init;
4113 }; 4280 };
@@ -4135,31 +4302,30 @@ again:
4135 case STAC_DELL_EQ: 4302 case STAC_DELL_EQ:
4136 spec->init = dell_eq_core_init; 4303 spec->init = dell_eq_core_init;
4137 /* fallthru */ 4304 /* fallthru */
4138 case STAC_DELL_M6: 4305 case STAC_DELL_M6_AMIC:
4306 case STAC_DELL_M6_DMIC:
4307 case STAC_DELL_M6_BOTH:
4139 spec->num_smuxes = 0; 4308 spec->num_smuxes = 0;
4140 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; 4309 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
4141 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; 4310 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
4311 spec->eapd_switch = 0;
4142 spec->num_amps = 1; 4312 spec->num_amps = 1;
4313 spec->multiout.hp_nid = 0; /* dual HPs */
4143 4314
4144 if (!spec->init) 4315 if (!spec->init)
4145 spec->init = dell_m6_core_init; 4316 spec->init = dell_m6_core_init;
4146 switch (codec->subsystem_id) { 4317 switch (spec->board_config) {
4147 case 0x1028025e: /* Analog Mics */ 4318 case STAC_DELL_M6_AMIC: /* Analog Mics */
4148 case 0x1028025f:
4149 stac92xx_set_config_reg(codec, 0x0b, 0x90A70170); 4319 stac92xx_set_config_reg(codec, 0x0b, 0x90A70170);
4150 spec->num_dmics = 0; 4320 spec->num_dmics = 0;
4151 spec->private_dimux.num_items = 1; 4321 spec->private_dimux.num_items = 1;
4152 break; 4322 break;
4153 case 0x10280271: /* Digital Mics */ 4323 case STAC_DELL_M6_DMIC: /* Digital Mics */
4154 case 0x10280272:
4155 case 0x10280254:
4156 case 0x10280255:
4157 stac92xx_set_config_reg(codec, 0x13, 0x90A60160); 4324 stac92xx_set_config_reg(codec, 0x13, 0x90A60160);
4158 spec->num_dmics = 1; 4325 spec->num_dmics = 1;
4159 spec->private_dimux.num_items = 2; 4326 spec->private_dimux.num_items = 2;
4160 break; 4327 break;
4161 case 0x10280256: /* Both */ 4328 case STAC_DELL_M6_BOTH: /* Both */
4162 case 0x10280057:
4163 stac92xx_set_config_reg(codec, 0x0b, 0x90A70170); 4329 stac92xx_set_config_reg(codec, 0x0b, 0x90A70170);
4164 stac92xx_set_config_reg(codec, 0x13, 0x90A60160); 4330 stac92xx_set_config_reg(codec, 0x13, 0x90A60160);
4165 spec->num_dmics = 1; 4331 spec->num_dmics = 1;
@@ -4170,6 +4336,7 @@ again:
4170 default: 4336 default:
4171 spec->num_dmics = STAC92HD73XX_NUM_DMICS; 4337 spec->num_dmics = STAC92HD73XX_NUM_DMICS;
4172 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); 4338 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
4339 spec->eapd_switch = 1;
4173 } 4340 }
4174 if (spec->board_config > STAC_92HD73XX_REF) { 4341 if (spec->board_config > STAC_92HD73XX_REF) {
4175 /* GPIO0 High = Enable EAPD */ 4342 /* GPIO0 High = Enable EAPD */
@@ -4198,6 +4365,9 @@ again:
4198 return err; 4365 return err;
4199 } 4366 }
4200 4367
4368 if (spec->board_config == STAC_92HD73XX_NO_JD)
4369 spec->hp_detect = 0;
4370
4201 codec->patch_ops = stac92xx_patch_ops; 4371 codec->patch_ops = stac92xx_patch_ops;
4202 4372
4203 return 0; 4373 return 0;
@@ -4315,7 +4485,13 @@ static int stac92hd71xx_resume(struct hda_codec *codec)
4315 4485
4316static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) 4486static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
4317{ 4487{
4488 struct sigmatel_spec *spec = codec->spec;
4489
4318 stac92hd71xx_set_power_state(codec, AC_PWRST_D3); 4490 stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
4491 if (spec->eapd_mask)
4492 stac_gpio_set(codec, spec->gpio_mask,
4493 spec->gpio_dir, spec->gpio_data &
4494 ~spec->eapd_mask);
4319 return 0; 4495 return 0;
4320}; 4496};
4321 4497
@@ -4378,6 +4554,13 @@ again:
4378 stac92xx_set_config_regs(codec); 4554 stac92xx_set_config_regs(codec);
4379 } 4555 }
4380 4556
4557 if (spec->board_config > STAC_92HD71BXX_REF) {
4558 /* GPIO0 = EAPD */
4559 spec->gpio_mask = 0x01;
4560 spec->gpio_dir = 0x01;
4561 spec->gpio_data = 0x01;
4562 }
4563
4381 switch (codec->vendor_id) { 4564 switch (codec->vendor_id) {
4382 case 0x111d76b6: /* 4 Port without Analog Mixer */ 4565 case 0x111d76b6: /* 4 Port without Analog Mixer */
4383 case 0x111d76b7: 4566 case 0x111d76b7:
@@ -4388,10 +4571,10 @@ again:
4388 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 4571 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
4389 break; 4572 break;
4390 case 0x111d7608: /* 5 Port with Analog Mixer */ 4573 case 0x111d7608: /* 5 Port with Analog Mixer */
4391 switch (codec->subsystem_id) { 4574 switch (spec->board_config) {
4392 case 0x103c361a: 4575 case STAC_HP_M4:
4393 /* Enable VREF power saving on GPIO1 detect */ 4576 /* Enable VREF power saving on GPIO1 detect */
4394 snd_hda_codec_write(codec, codec->afg, 0, 4577 snd_hda_codec_write_cache(codec, codec->afg, 0,
4395 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); 4578 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
4396 snd_hda_codec_write_cache(codec, codec->afg, 0, 4579 snd_hda_codec_write_cache(codec, codec->afg, 0,
4397 AC_VERB_SET_UNSOLICITED_ENABLE, 4580 AC_VERB_SET_UNSOLICITED_ENABLE,
@@ -4437,13 +4620,6 @@ again:
4437 spec->aloopback_mask = 0x50; 4620 spec->aloopback_mask = 0x50;
4438 spec->aloopback_shift = 0; 4621 spec->aloopback_shift = 0;
4439 4622
4440 if (spec->board_config > STAC_92HD71BXX_REF) {
4441 /* GPIO0 = EAPD */
4442 spec->gpio_mask = 0x01;
4443 spec->gpio_dir = 0x01;
4444 spec->gpio_data = 0x01;
4445 }
4446
4447 spec->powerdown_adcs = 1; 4623 spec->powerdown_adcs = 1;
4448 spec->digbeep_nid = 0x26; 4624 spec->digbeep_nid = 0x26;
4449 spec->mux_nids = stac92hd71bxx_mux_nids; 4625 spec->mux_nids = stac92hd71bxx_mux_nids;
@@ -4458,14 +4634,21 @@ again:
4458 4634
4459 switch (spec->board_config) { 4635 switch (spec->board_config) {
4460 case STAC_HP_M4: 4636 case STAC_HP_M4:
4461 spec->num_dmics = 0;
4462 spec->num_smuxes = 0;
4463 spec->num_dmuxes = 0;
4464
4465 /* enable internal microphone */ 4637 /* enable internal microphone */
4466 stac92xx_set_config_reg(codec, 0x0e, 0x01813040); 4638 stac92xx_set_config_reg(codec, 0x0e, 0x01813040);
4467 stac92xx_auto_set_pinctl(codec, 0x0e, 4639 stac92xx_auto_set_pinctl(codec, 0x0e,
4468 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80); 4640 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80);
4641 /* fallthru */
4642 case STAC_DELL_M4_2:
4643 spec->num_dmics = 0;
4644 spec->num_smuxes = 0;
4645 spec->num_dmuxes = 0;
4646 break;
4647 case STAC_DELL_M4_1:
4648 case STAC_DELL_M4_3:
4649 spec->num_dmics = 1;
4650 spec->num_smuxes = 0;
4651 spec->num_dmuxes = 0;
4469 break; 4652 break;
4470 default: 4653 default:
4471 spec->num_dmics = STAC92HD71BXX_NUM_DMICS; 4654 spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
@@ -4702,6 +4885,7 @@ static int patch_stac927x(struct hda_codec *codec)
4702 spec->num_pwrs = 0; 4885 spec->num_pwrs = 0;
4703 spec->aloopback_mask = 0x40; 4886 spec->aloopback_mask = 0x40;
4704 spec->aloopback_shift = 0; 4887 spec->aloopback_shift = 0;
4888 spec->eapd_switch = 1;
4705 4889
4706 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); 4890 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20);
4707 if (!err) { 4891 if (!err) {
@@ -4732,6 +4916,10 @@ static int patch_stac927x(struct hda_codec *codec)
4732 */ 4916 */
4733 codec->bus->needs_damn_long_delay = 1; 4917 codec->bus->needs_damn_long_delay = 1;
4734 4918
4919 /* no jack detecion for ref-no-jd model */
4920 if (spec->board_config == STAC_D965_REF_NO_JD)
4921 spec->hp_detect = 0;
4922
4735 return 0; 4923 return 0;
4736} 4924}
4737 4925
@@ -4782,6 +4970,7 @@ static int patch_stac9205(struct hda_codec *codec)
4782 4970
4783 spec->aloopback_mask = 0x40; 4971 spec->aloopback_mask = 0x40;
4784 spec->aloopback_shift = 0; 4972 spec->aloopback_shift = 0;
4973 spec->eapd_switch = 1;
4785 spec->multiout.dac_nids = spec->dac_nids; 4974 spec->multiout.dac_nids = spec->dac_nids;
4786 4975
4787 switch (spec->board_config){ 4976 switch (spec->board_config){
@@ -4791,7 +4980,7 @@ static int patch_stac9205(struct hda_codec *codec)
4791 stac92xx_set_config_reg(codec, 0x20, 0x1c410030); 4980 stac92xx_set_config_reg(codec, 0x20, 0x1c410030);
4792 4981
4793 /* Enable unsol response for GPIO4/Dock HP connection */ 4982 /* Enable unsol response for GPIO4/Dock HP connection */
4794 snd_hda_codec_write(codec, codec->afg, 0, 4983 snd_hda_codec_write_cache(codec, codec->afg, 0,
4795 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); 4984 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
4796 snd_hda_codec_write_cache(codec, codec->afg, 0, 4985 snd_hda_codec_write_cache(codec, codec->afg, 0,
4797 AC_VERB_SET_UNSOLICITED_ENABLE, 4986 AC_VERB_SET_UNSOLICITED_ENABLE,
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 0e06c6c9fcc0..73de6e989b3d 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -1229,8 +1229,11 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
1229 return -ENOMEM; 1229 return -ENOMEM;
1230 } 1230 }
1231 1231
1232 if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) 1232 if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) {
1233 kfree(mgr);
1234 pci_disable_device(pci);
1233 return -ENODEV; 1235 return -ENODEV;
1236 }
1234 card_name = pcxhr_board_params[pci_id->driver_data].board_name; 1237 card_name = pcxhr_board_params[pci_id->driver_data].board_name;
1235 mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips; 1238 mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips;
1236 mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips; 1239 mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips;
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index d723543beadd..736246f98acc 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -4548,11 +4548,20 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
4548{ 4548{
4549 struct hdsp *hdsp = (struct hdsp *)hw->private_data; 4549 struct hdsp *hdsp = (struct hdsp *)hw->private_data;
4550 void __user *argp = (void __user *)arg; 4550 void __user *argp = (void __user *)arg;
4551 int err;
4551 4552
4552 switch (cmd) { 4553 switch (cmd) {
4553 case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { 4554 case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: {
4554 struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; 4555 struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg;
4555 4556
4557 err = hdsp_check_for_iobox(hdsp);
4558 if (err < 0)
4559 return err;
4560
4561 err = hdsp_check_for_firmware(hdsp, 1);
4562 if (err < 0)
4563 return err;
4564
4556 if (!(hdsp->state & HDSP_FirmwareLoaded)) { 4565 if (!(hdsp->state & HDSP_FirmwareLoaded)) {
4557 snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); 4566 snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n");
4558 return -EINVAL; 4567 return -EINVAL;
@@ -4572,10 +4581,14 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
4572 unsigned long flags; 4581 unsigned long flags;
4573 int i; 4582 int i;
4574 4583
4575 if (!(hdsp->state & HDSP_FirmwareLoaded)) { 4584 err = hdsp_check_for_iobox(hdsp);
4576 snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n"); 4585 if (err < 0)
4577 return -EINVAL; 4586 return err;
4578 } 4587
4588 err = hdsp_check_for_firmware(hdsp, 1);
4589 if (err < 0)
4590 return err;
4591
4579 spin_lock_irqsave(&hdsp->lock, flags); 4592 spin_lock_irqsave(&hdsp->lock, flags);
4580 info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); 4593 info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
4581 info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); 4594 info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
@@ -5045,6 +5058,10 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
5045 /* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */ 5058 /* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */
5046 ssleep(2); 5059 ssleep(2);
5047 5060
5061 err = hdsp_check_for_iobox(hdsp);
5062 if (err < 0)
5063 return err;
5064
5048 if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { 5065 if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
5049#ifdef HDSP_FW_LOADER 5066#ifdef HDSP_FW_LOADER
5050 if ((err = hdsp_request_fw_loader(hdsp)) < 0) 5067 if ((err = hdsp_request_fw_loader(hdsp)) < 0)
@@ -5057,7 +5074,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
5057 /* init is complete, we return */ 5074 /* init is complete, we return */
5058 return 0; 5075 return 0;
5059#endif 5076#endif
5060 /* no iobox connected, we defer initialization */ 5077 /* we defer initialization */
5061 snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n"); 5078 snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n");
5062 if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) 5079 if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0)
5063 return err; 5080 return err;
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index bba9546ba5f5..8d73edc56102 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -20,7 +20,8 @@ config SND_SOC_MPC8610_HPCD
20 20
21config SND_SOC_MPC5200_I2S 21config SND_SOC_MPC5200_I2S
22 tristate "Freescale MPC5200 PSC in I2S mode driver" 22 tristate "Freescale MPC5200 PSC in I2S mode driver"
23 depends on SND_SOC && PPC_MPC52xx && PPC_BESTCOMM
23 select SND_SOC_OF_SIMPLE 24 select SND_SOC_OF_SIMPLE
24 depends on SND_SOC && PPC_MPC52xx 25 select PPC_BESTCOMM_GEN_BD
25 help 26 help
26 Say Y here to support the MPC5200 PSCs in I2S mode. 27 Say Y here to support the MPC5200 PSCs in I2S mode.
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index e9084fdd2082..acd68efb2b75 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -233,7 +233,7 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
233 if (ret < 0) 233 if (ret < 0)
234 goto out; 234 goto out;
235 235
236 prtd = kzalloc(sizeof(prtd), GFP_KERNEL); 236 prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
237 if (prtd == NULL) { 237 if (prtd == NULL) {
238 ret = -ENOMEM; 238 ret = -ENOMEM;
239 goto out; 239 goto out;
diff --git a/sound/sound_core.c b/sound/sound_core.c
index a75b289a5d78..10ba4218161b 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -457,7 +457,7 @@ EXPORT_SYMBOL(unregister_sound_mixer);
457 457
458void unregister_sound_midi(int unit) 458void unregister_sound_midi(int unit)
459{ 459{
460 return sound_remove_unit(&chains[2], unit); 460 sound_remove_unit(&chains[2], unit);
461} 461}
462 462
463EXPORT_SYMBOL(unregister_sound_midi); 463EXPORT_SYMBOL(unregister_sound_midi);
@@ -474,7 +474,7 @@ EXPORT_SYMBOL(unregister_sound_midi);
474 474
475void unregister_sound_dsp(int unit) 475void unregister_sound_dsp(int unit)
476{ 476{
477 return sound_remove_unit(&chains[3], unit); 477 sound_remove_unit(&chains[3], unit);
478} 478}
479 479
480 480
@@ -507,7 +507,7 @@ static struct sound_unit *__look_for_unit(int chain, int unit)
507 return NULL; 507 return NULL;
508} 508}
509 509
510int soundcore_open(struct inode *inode, struct file *file) 510static int soundcore_open(struct inode *inode, struct file *file)
511{ 511{
512 int chain; 512 int chain;
513 int unit = iminor(inode); 513 int unit = iminor(inode);