diff options
Diffstat (limited to 'sound/pci')
41 files changed, 672 insertions, 356 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 71515ddb4593..d6752dff2a44 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -287,10 +287,10 @@ struct atiixp { | |||
287 | /* | 287 | /* |
288 | */ | 288 | */ |
289 | static struct pci_device_id snd_atiixp_ids[] = { | 289 | static struct pci_device_id snd_atiixp_ids[] = { |
290 | { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ | 290 | { PCI_VDEVICE(ATI, 0x4341), 0 }, /* SB200 */ |
291 | { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */ | 291 | { PCI_VDEVICE(ATI, 0x4361), 0 }, /* SB300 */ |
292 | { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ | 292 | { PCI_VDEVICE(ATI, 0x4370), 0 }, /* SB400 */ |
293 | { 0x1002, 0x4382, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB600 */ | 293 | { PCI_VDEVICE(ATI, 0x4382), 0 }, /* SB600 */ |
294 | { 0, } | 294 | { 0, } |
295 | }; | 295 | }; |
296 | 296 | ||
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index c3136cccc559..e7e147bf8eb2 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -262,8 +262,8 @@ struct atiixp_modem { | |||
262 | /* | 262 | /* |
263 | */ | 263 | */ |
264 | static struct pci_device_id snd_atiixp_ids[] = { | 264 | static struct pci_device_id snd_atiixp_ids[] = { |
265 | { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ | 265 | { PCI_VDEVICE(ATI, 0x434d), 0 }, /* SB200 */ |
266 | { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ | 266 | { PCI_VDEVICE(ATI, 0x4378), 0 }, /* SB400 */ |
267 | { 0, } | 267 | { 0, } |
268 | }; | 268 | }; |
269 | 269 | ||
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c index fce22c7af0ea..c0e8c6b295cb 100644 --- a/sound/pci/au88x0/au8810.c +++ b/sound/pci/au88x0/au8810.c | |||
@@ -1,8 +1,7 @@ | |||
1 | #include "au8810.h" | 1 | #include "au8810.h" |
2 | #include "au88x0.h" | 2 | #include "au88x0.h" |
3 | static struct pci_device_id snd_vortex_ids[] = { | 3 | static struct pci_device_id snd_vortex_ids[] = { |
4 | {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, | 4 | {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE), 1,}, |
5 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, | ||
6 | {0,} | 5 | {0,} |
7 | }; | 6 | }; |
8 | 7 | ||
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c index d1fbcce07257..a6527330df58 100644 --- a/sound/pci/au88x0/au8820.c +++ b/sound/pci/au88x0/au8820.c | |||
@@ -1,8 +1,7 @@ | |||
1 | #include "au8820.h" | 1 | #include "au8820.h" |
2 | #include "au88x0.h" | 2 | #include "au88x0.h" |
3 | static struct pci_device_id snd_vortex_ids[] = { | 3 | static struct pci_device_id snd_vortex_ids[] = { |
4 | {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1, | 4 | {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1), 0,}, |
5 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | ||
6 | {0,} | 5 | {0,} |
7 | }; | 6 | }; |
8 | 7 | ||
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c index d4f2717c14fb..6c702ad4352a 100644 --- a/sound/pci/au88x0/au8830.c +++ b/sound/pci/au88x0/au8830.c | |||
@@ -1,8 +1,7 @@ | |||
1 | #include "au8830.h" | 1 | #include "au8830.h" |
2 | #include "au88x0.h" | 2 | #include "au88x0.h" |
3 | static struct pci_device_id snd_vortex_ids[] = { | 3 | static struct pci_device_id snd_vortex_ids[] = { |
4 | {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2, | 4 | {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2), 0,}, |
5 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | ||
6 | {0,} | 5 | {0,} |
7 | }; | 6 | }; |
8 | 7 | ||
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 57b992a5c057..f24bf1ecb36d 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -1876,7 +1876,7 @@ static int snd_ca0106_resume(struct pci_dev *pci) | |||
1876 | 1876 | ||
1877 | // PCI IDs | 1877 | // PCI IDs |
1878 | static struct pci_device_id snd_ca0106_ids[] = { | 1878 | static struct pci_device_id snd_ca0106_ids[] = { |
1879 | { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */ | 1879 | { PCI_VDEVICE(CREATIVE, 0x0007), 0 }, /* Audigy LS or Live 24bit */ |
1880 | { 0, } | 1880 | { 0, } |
1881 | }; | 1881 | }; |
1882 | MODULE_DEVICE_TABLE(pci, snd_ca0106_ids); | 1882 | MODULE_DEVICE_TABLE(pci, snd_ca0106_ids); |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 449fe02f666e..ddcd4a9fd7e6 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -2797,11 +2797,11 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {} | |||
2797 | 2797 | ||
2798 | 2798 | ||
2799 | static struct pci_device_id snd_cmipci_ids[] = { | 2799 | static struct pci_device_id snd_cmipci_ids[] = { |
2800 | {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 2800 | {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A), 0}, |
2801 | {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 2801 | {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B), 0}, |
2802 | {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 2802 | {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738), 0}, |
2803 | {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 2803 | {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738B), 0}, |
2804 | {PCI_VENDOR_ID_AL, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 2804 | {PCI_VDEVICE(AL, PCI_DEVICE_ID_CMEDIA_CM8738), 0}, |
2805 | {0,}, | 2805 | {0,}, |
2806 | }; | 2806 | }; |
2807 | 2807 | ||
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index f6286f84a221..e2e0359bb056 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c | |||
@@ -495,7 +495,7 @@ struct cs4281 { | |||
495 | static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id); | 495 | static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id); |
496 | 496 | ||
497 | static struct pci_device_id snd_cs4281_ids[] = { | 497 | static struct pci_device_id snd_cs4281_ids[] = { |
498 | { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ | 498 | { PCI_VDEVICE(CIRRUS, 0x6005), 0, }, /* CS4281 */ |
499 | { 0, } | 499 | { 0, } |
500 | }; | 500 | }; |
501 | 501 | ||
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c index c9b3e3d48cbc..033aec430117 100644 --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c | |||
@@ -65,9 +65,9 @@ module_param_array(mmap_valid, bool, NULL, 0444); | |||
65 | MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); | 65 | MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); |
66 | 66 | ||
67 | static struct pci_device_id snd_cs46xx_ids[] = { | 67 | static struct pci_device_id snd_cs46xx_ids[] = { |
68 | { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ | 68 | { PCI_VDEVICE(CIRRUS, 0x6001), 0, }, /* CS4280 */ |
69 | { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */ | 69 | { PCI_VDEVICE(CIRRUS, 0x6003), 0, }, /* CS4612 */ |
70 | { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */ | 70 | { PCI_VDEVICE(CIRRUS, 0x6004), 0, }, /* CS4615 */ |
71 | { 0, } | 71 | { 0, } |
72 | }; | 72 | }; |
73 | 73 | ||
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index b0adc8094009..a49c76647307 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -46,8 +46,6 @@ static struct snd_pci_quirk __devinitdata subsys_20k1_list[] = { | |||
46 | SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, 0x0031, "SB073x", CTSB073X), | 46 | SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, 0x0031, "SB073x", CTSB073X), |
47 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_CREATIVE, 0xf000, 0x6000, | 47 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_CREATIVE, 0xf000, 0x6000, |
48 | "UAA", CTUAA), | 48 | "UAA", CTUAA), |
49 | SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_CREATIVE, | ||
50 | "Unknown", CT20K1_UNKNOWN), | ||
51 | { } /* terminator */ | 49 | { } /* terminator */ |
52 | }; | 50 | }; |
53 | 51 | ||
@@ -67,13 +65,16 @@ static struct snd_pci_quirk __devinitdata subsys_20k2_list[] = { | |||
67 | }; | 65 | }; |
68 | 66 | ||
69 | static const char *ct_subsys_name[NUM_CTCARDS] = { | 67 | static const char *ct_subsys_name[NUM_CTCARDS] = { |
68 | /* 20k1 models */ | ||
70 | [CTSB055X] = "SB055x", | 69 | [CTSB055X] = "SB055x", |
71 | [CTSB073X] = "SB073x", | 70 | [CTSB073X] = "SB073x", |
72 | [CTSB0760] = "SB076x", | ||
73 | [CTUAA] = "UAA", | 71 | [CTUAA] = "UAA", |
74 | [CT20K1_UNKNOWN] = "Unknown", | 72 | [CT20K1_UNKNOWN] = "Unknown", |
73 | /* 20k2 models */ | ||
74 | [CTSB0760] = "SB076x", | ||
75 | [CTHENDRIX] = "Hendrix", | 75 | [CTHENDRIX] = "Hendrix", |
76 | [CTSB0880] = "SB0880", | 76 | [CTSB0880] = "SB0880", |
77 | [CT20K2_UNKNOWN] = "Unknown", | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | static struct { | 80 | static struct { |
@@ -260,13 +261,8 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
260 | int device = apcm->substream->pcm->device; | 261 | int device = apcm->substream->pcm->device; |
261 | unsigned int pitch; | 262 | unsigned int pitch; |
262 | 263 | ||
263 | if (NULL != apcm->src) { | ||
264 | /* Prepared pcm playback */ | ||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | /* first release old resources */ | 264 | /* first release old resources */ |
269 | atc->pcm_release_resources(atc, apcm); | 265 | atc_pcm_release_resources(atc, apcm); |
270 | 266 | ||
271 | /* Get SRC resource */ | 267 | /* Get SRC resource */ |
272 | desc.multi = apcm->substream->runtime->channels; | 268 | desc.multi = apcm->substream->runtime->channels; |
@@ -660,10 +656,7 @@ static int atc_pcm_capture_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
660 | unsigned int pitch; | 656 | unsigned int pitch; |
661 | int mix_base = 0, imp_base = 0; | 657 | int mix_base = 0, imp_base = 0; |
662 | 658 | ||
663 | if (NULL != apcm->src) { | 659 | atc_pcm_release_resources(atc, apcm); |
664 | /* Prepared pcm capture */ | ||
665 | return 0; | ||
666 | } | ||
667 | 660 | ||
668 | /* Get needed resources. */ | 661 | /* Get needed resources. */ |
669 | err = atc_pcm_capture_get_resources(atc, apcm); | 662 | err = atc_pcm_capture_get_resources(atc, apcm); |
@@ -866,7 +859,7 @@ spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
866 | struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio); | 859 | struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio); |
867 | unsigned int rate = apcm->substream->runtime->rate; | 860 | unsigned int rate = apcm->substream->runtime->rate; |
868 | unsigned int status; | 861 | unsigned int status; |
869 | int err; | 862 | int err = 0; |
870 | unsigned char iec958_con_fs; | 863 | unsigned char iec958_con_fs; |
871 | 864 | ||
872 | switch (rate) { | 865 | switch (rate) { |
@@ -907,8 +900,7 @@ spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
907 | int err; | 900 | int err; |
908 | int i; | 901 | int i; |
909 | 902 | ||
910 | if (NULL != apcm->src) | 903 | atc_pcm_release_resources(atc, apcm); |
911 | return 0; | ||
912 | 904 | ||
913 | /* Configure SPDIFOO and PLL to passthrough mode; | 905 | /* Configure SPDIFOO and PLL to passthrough mode; |
914 | * determine pll_rate. */ | 906 | * determine pll_rate. */ |
@@ -1115,32 +1107,20 @@ static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state) | |||
1115 | return err; | 1107 | return err; |
1116 | } | 1108 | } |
1117 | 1109 | ||
1118 | static int ct_atc_destroy(struct ct_atc *atc) | 1110 | static int atc_release_resources(struct ct_atc *atc) |
1119 | { | 1111 | { |
1120 | struct daio_mgr *daio_mgr; | 1112 | int i; |
1121 | struct dao *dao; | 1113 | struct daio_mgr *daio_mgr = NULL; |
1122 | struct dai *dai; | 1114 | struct dao *dao = NULL; |
1123 | struct daio *daio; | 1115 | struct dai *dai = NULL; |
1124 | struct sum_mgr *sum_mgr; | 1116 | struct daio *daio = NULL; |
1125 | struct src_mgr *src_mgr; | 1117 | struct sum_mgr *sum_mgr = NULL; |
1126 | struct srcimp_mgr *srcimp_mgr; | 1118 | struct src_mgr *src_mgr = NULL; |
1127 | struct srcimp *srcimp; | 1119 | struct srcimp_mgr *srcimp_mgr = NULL; |
1128 | struct ct_mixer *mixer; | 1120 | struct srcimp *srcimp = NULL; |
1129 | int i = 0; | 1121 | struct ct_mixer *mixer = NULL; |
1130 | 1122 | ||
1131 | if (NULL == atc) | 1123 | /* disconnect internal mixer objects */ |
1132 | return 0; | ||
1133 | |||
1134 | if (atc->timer) { | ||
1135 | ct_timer_free(atc->timer); | ||
1136 | atc->timer = NULL; | ||
1137 | } | ||
1138 | |||
1139 | /* Stop hardware and disable all interrupts */ | ||
1140 | if (NULL != atc->hw) | ||
1141 | ((struct hw *)atc->hw)->card_stop(atc->hw); | ||
1142 | |||
1143 | /* Destroy internal mixer objects */ | ||
1144 | if (NULL != atc->mixer) { | 1124 | if (NULL != atc->mixer) { |
1145 | mixer = atc->mixer; | 1125 | mixer = atc->mixer; |
1146 | mixer->set_input_left(mixer, MIX_LINE_IN, NULL); | 1126 | mixer->set_input_left(mixer, MIX_LINE_IN, NULL); |
@@ -1149,7 +1129,6 @@ static int ct_atc_destroy(struct ct_atc *atc) | |||
1149 | mixer->set_input_right(mixer, MIX_MIC_IN, NULL); | 1129 | mixer->set_input_right(mixer, MIX_MIC_IN, NULL); |
1150 | mixer->set_input_left(mixer, MIX_SPDIF_IN, NULL); | 1130 | mixer->set_input_left(mixer, MIX_SPDIF_IN, NULL); |
1151 | mixer->set_input_right(mixer, MIX_SPDIF_IN, NULL); | 1131 | mixer->set_input_right(mixer, MIX_SPDIF_IN, NULL); |
1152 | ct_mixer_destroy(atc->mixer); | ||
1153 | } | 1132 | } |
1154 | 1133 | ||
1155 | if (NULL != atc->daios) { | 1134 | if (NULL != atc->daios) { |
@@ -1167,6 +1146,7 @@ static int ct_atc_destroy(struct ct_atc *atc) | |||
1167 | daio_mgr->put_daio(daio_mgr, daio); | 1146 | daio_mgr->put_daio(daio_mgr, daio); |
1168 | } | 1147 | } |
1169 | kfree(atc->daios); | 1148 | kfree(atc->daios); |
1149 | atc->daios = NULL; | ||
1170 | } | 1150 | } |
1171 | 1151 | ||
1172 | if (NULL != atc->pcm) { | 1152 | if (NULL != atc->pcm) { |
@@ -1175,6 +1155,7 @@ static int ct_atc_destroy(struct ct_atc *atc) | |||
1175 | sum_mgr->put_sum(sum_mgr, atc->pcm[i]); | 1155 | sum_mgr->put_sum(sum_mgr, atc->pcm[i]); |
1176 | 1156 | ||
1177 | kfree(atc->pcm); | 1157 | kfree(atc->pcm); |
1158 | atc->pcm = NULL; | ||
1178 | } | 1159 | } |
1179 | 1160 | ||
1180 | if (NULL != atc->srcs) { | 1161 | if (NULL != atc->srcs) { |
@@ -1183,6 +1164,7 @@ static int ct_atc_destroy(struct ct_atc *atc) | |||
1183 | src_mgr->put_src(src_mgr, atc->srcs[i]); | 1164 | src_mgr->put_src(src_mgr, atc->srcs[i]); |
1184 | 1165 | ||
1185 | kfree(atc->srcs); | 1166 | kfree(atc->srcs); |
1167 | atc->srcs = NULL; | ||
1186 | } | 1168 | } |
1187 | 1169 | ||
1188 | if (NULL != atc->srcimps) { | 1170 | if (NULL != atc->srcimps) { |
@@ -1193,8 +1175,30 @@ static int ct_atc_destroy(struct ct_atc *atc) | |||
1193 | srcimp_mgr->put_srcimp(srcimp_mgr, atc->srcimps[i]); | 1175 | srcimp_mgr->put_srcimp(srcimp_mgr, atc->srcimps[i]); |
1194 | } | 1176 | } |
1195 | kfree(atc->srcimps); | 1177 | kfree(atc->srcimps); |
1178 | atc->srcimps = NULL; | ||
1179 | } | ||
1180 | |||
1181 | return 0; | ||
1182 | } | ||
1183 | |||
1184 | static int ct_atc_destroy(struct ct_atc *atc) | ||
1185 | { | ||
1186 | int i = 0; | ||
1187 | |||
1188 | if (NULL == atc) | ||
1189 | return 0; | ||
1190 | |||
1191 | if (atc->timer) { | ||
1192 | ct_timer_free(atc->timer); | ||
1193 | atc->timer = NULL; | ||
1196 | } | 1194 | } |
1197 | 1195 | ||
1196 | atc_release_resources(atc); | ||
1197 | |||
1198 | /* Destroy internal mixer objects */ | ||
1199 | if (NULL != atc->mixer) | ||
1200 | ct_mixer_destroy(atc->mixer); | ||
1201 | |||
1198 | for (i = 0; i < NUM_RSCTYP; i++) { | 1202 | for (i = 0; i < NUM_RSCTYP; i++) { |
1199 | if ((NULL != rsc_mgr_funcs[i].destroy) && | 1203 | if ((NULL != rsc_mgr_funcs[i].destroy) && |
1200 | (NULL != atc->rsc_mgrs[i])) | 1204 | (NULL != atc->rsc_mgrs[i])) |
@@ -1240,9 +1244,21 @@ static int __devinit atc_identify_card(struct ct_atc *atc) | |||
1240 | return -ENOENT; | 1244 | return -ENOENT; |
1241 | } | 1245 | } |
1242 | p = snd_pci_quirk_lookup(atc->pci, list); | 1246 | p = snd_pci_quirk_lookup(atc->pci, list); |
1243 | if (!p) | 1247 | if (p) { |
1244 | return -ENOENT; | 1248 | if (p->value < 0) { |
1245 | atc->model = p->value; | 1249 | printk(KERN_ERR "ctxfi: " |
1250 | "Device %04x:%04x is black-listed\n", | ||
1251 | atc->pci->subsystem_vendor, | ||
1252 | atc->pci->subsystem_device); | ||
1253 | return -ENOENT; | ||
1254 | } | ||
1255 | atc->model = p->value; | ||
1256 | } else { | ||
1257 | if (atc->chip_type == ATC20K1) | ||
1258 | atc->model = CT20K1_UNKNOWN; | ||
1259 | else | ||
1260 | atc->model = CT20K2_UNKNOWN; | ||
1261 | } | ||
1246 | atc->model_name = ct_subsys_name[atc->model]; | 1262 | atc->model_name = ct_subsys_name[atc->model]; |
1247 | snd_printd("ctxfi: chip %s model %s (%04x:%04x) is found\n", | 1263 | snd_printd("ctxfi: chip %s model %s (%04x:%04x) is found\n", |
1248 | atc->chip_name, atc->model_name, | 1264 | atc->chip_name, atc->model_name, |
@@ -1310,7 +1326,7 @@ static int __devinit atc_create_hw_devs(struct ct_atc *atc) | |||
1310 | return 0; | 1326 | return 0; |
1311 | } | 1327 | } |
1312 | 1328 | ||
1313 | static int __devinit atc_get_resources(struct ct_atc *atc) | 1329 | static int atc_get_resources(struct ct_atc *atc) |
1314 | { | 1330 | { |
1315 | struct daio_desc da_desc = {0}; | 1331 | struct daio_desc da_desc = {0}; |
1316 | struct daio_mgr *daio_mgr; | 1332 | struct daio_mgr *daio_mgr; |
@@ -1407,16 +1423,10 @@ static int __devinit atc_get_resources(struct ct_atc *atc) | |||
1407 | atc->n_pcm++; | 1423 | atc->n_pcm++; |
1408 | } | 1424 | } |
1409 | 1425 | ||
1410 | err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer); | ||
1411 | if (err) { | ||
1412 | printk(KERN_ERR "ctxfi: Failed to create mixer obj!!!\n"); | ||
1413 | return err; | ||
1414 | } | ||
1415 | |||
1416 | return 0; | 1426 | return 0; |
1417 | } | 1427 | } |
1418 | 1428 | ||
1419 | static void __devinit | 1429 | static void |
1420 | atc_connect_dai(struct src_mgr *src_mgr, struct dai *dai, | 1430 | atc_connect_dai(struct src_mgr *src_mgr, struct dai *dai, |
1421 | struct src **srcs, struct srcimp **srcimps) | 1431 | struct src **srcs, struct srcimp **srcimps) |
1422 | { | 1432 | { |
@@ -1455,7 +1465,7 @@ atc_connect_dai(struct src_mgr *src_mgr, struct dai *dai, | |||
1455 | src_mgr->commit_write(src_mgr); /* Synchronously enable SRCs */ | 1465 | src_mgr->commit_write(src_mgr); /* Synchronously enable SRCs */ |
1456 | } | 1466 | } |
1457 | 1467 | ||
1458 | static void __devinit atc_connect_resources(struct ct_atc *atc) | 1468 | static void atc_connect_resources(struct ct_atc *atc) |
1459 | { | 1469 | { |
1460 | struct dai *dai; | 1470 | struct dai *dai; |
1461 | struct dao *dao; | 1471 | struct dao *dao; |
@@ -1501,6 +1511,84 @@ static void __devinit atc_connect_resources(struct ct_atc *atc) | |||
1501 | } | 1511 | } |
1502 | } | 1512 | } |
1503 | 1513 | ||
1514 | #ifdef CONFIG_PM | ||
1515 | static int atc_suspend(struct ct_atc *atc, pm_message_t state) | ||
1516 | { | ||
1517 | int i; | ||
1518 | struct hw *hw = atc->hw; | ||
1519 | |||
1520 | snd_power_change_state(atc->card, SNDRV_CTL_POWER_D3hot); | ||
1521 | |||
1522 | for (i = FRONT; i < NUM_PCMS; i++) { | ||
1523 | if (!atc->pcms[i]) | ||
1524 | continue; | ||
1525 | |||
1526 | snd_pcm_suspend_all(atc->pcms[i]); | ||
1527 | } | ||
1528 | |||
1529 | atc_release_resources(atc); | ||
1530 | |||
1531 | hw->suspend(hw, state); | ||
1532 | |||
1533 | return 0; | ||
1534 | } | ||
1535 | |||
1536 | static int atc_hw_resume(struct ct_atc *atc) | ||
1537 | { | ||
1538 | struct hw *hw = atc->hw; | ||
1539 | struct card_conf info = {0}; | ||
1540 | |||
1541 | /* Re-initialize card hardware. */ | ||
1542 | info.rsr = atc->rsr; | ||
1543 | info.msr = atc->msr; | ||
1544 | info.vm_pgt_phys = atc_get_ptp_phys(atc, 0); | ||
1545 | return hw->resume(hw, &info); | ||
1546 | } | ||
1547 | |||
1548 | static int atc_resources_resume(struct ct_atc *atc) | ||
1549 | { | ||
1550 | struct ct_mixer *mixer; | ||
1551 | int err = 0; | ||
1552 | |||
1553 | /* Get resources */ | ||
1554 | err = atc_get_resources(atc); | ||
1555 | if (err < 0) { | ||
1556 | atc_release_resources(atc); | ||
1557 | return err; | ||
1558 | } | ||
1559 | |||
1560 | /* Build topology */ | ||
1561 | atc_connect_resources(atc); | ||
1562 | |||
1563 | mixer = atc->mixer; | ||
1564 | mixer->resume(mixer); | ||
1565 | |||
1566 | return 0; | ||
1567 | } | ||
1568 | |||
1569 | static int atc_resume(struct ct_atc *atc) | ||
1570 | { | ||
1571 | int err = 0; | ||
1572 | |||
1573 | /* Do hardware resume. */ | ||
1574 | err = atc_hw_resume(atc); | ||
1575 | if (err < 0) { | ||
1576 | printk(KERN_ERR "ctxfi: pci_enable_device failed, " | ||
1577 | "disabling device\n"); | ||
1578 | snd_card_disconnect(atc->card); | ||
1579 | return err; | ||
1580 | } | ||
1581 | |||
1582 | err = atc_resources_resume(atc); | ||
1583 | if (err < 0) | ||
1584 | return err; | ||
1585 | |||
1586 | snd_power_change_state(atc->card, SNDRV_CTL_POWER_D0); | ||
1587 | |||
1588 | return 0; | ||
1589 | } | ||
1590 | #endif | ||
1591 | |||
1504 | static struct ct_atc atc_preset __devinitdata = { | 1592 | static struct ct_atc atc_preset __devinitdata = { |
1505 | .map_audio_buffer = ct_map_audio_buffer, | 1593 | .map_audio_buffer = ct_map_audio_buffer, |
1506 | .unmap_audio_buffer = ct_unmap_audio_buffer, | 1594 | .unmap_audio_buffer = ct_unmap_audio_buffer, |
@@ -1529,6 +1617,10 @@ static struct ct_atc atc_preset __devinitdata = { | |||
1529 | .spdif_out_set_status = atc_spdif_out_set_status, | 1617 | .spdif_out_set_status = atc_spdif_out_set_status, |
1530 | .spdif_out_passthru = atc_spdif_out_passthru, | 1618 | .spdif_out_passthru = atc_spdif_out_passthru, |
1531 | .have_digit_io_switch = atc_have_digit_io_switch, | 1619 | .have_digit_io_switch = atc_have_digit_io_switch, |
1620 | #ifdef CONFIG_PM | ||
1621 | .suspend = atc_suspend, | ||
1622 | .resume = atc_resume, | ||
1623 | #endif | ||
1532 | }; | 1624 | }; |
1533 | 1625 | ||
1534 | /** | 1626 | /** |
@@ -1587,6 +1679,12 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci, | |||
1587 | if (err < 0) | 1679 | if (err < 0) |
1588 | goto error1; | 1680 | goto error1; |
1589 | 1681 | ||
1682 | err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer); | ||
1683 | if (err) { | ||
1684 | printk(KERN_ERR "ctxfi: Failed to create mixer obj!!!\n"); | ||
1685 | goto error1; | ||
1686 | } | ||
1687 | |||
1590 | /* Get resources */ | 1688 | /* Get resources */ |
1591 | err = atc_get_resources(atc); | 1689 | err = atc_get_resources(atc); |
1592 | if (err < 0) | 1690 | if (err < 0) |
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h index 9fe620ea5f3f..9fd8a5708943 100644 --- a/sound/pci/ctxfi/ctatc.h +++ b/sound/pci/ctxfi/ctatc.h | |||
@@ -136,6 +136,13 @@ struct ct_atc { | |||
136 | unsigned char n_pcm; | 136 | unsigned char n_pcm; |
137 | 137 | ||
138 | struct ct_timer *timer; | 138 | struct ct_timer *timer; |
139 | |||
140 | #ifdef CONFIG_PM | ||
141 | int (*suspend)(struct ct_atc *atc, pm_message_t state); | ||
142 | int (*resume)(struct ct_atc *atc); | ||
143 | #define NUM_PCMS (NUM_CTALSADEVS - 1) | ||
144 | struct snd_pcm *pcms[NUM_PCMS]; | ||
145 | #endif | ||
139 | }; | 146 | }; |
140 | 147 | ||
141 | 148 | ||
diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h index 4a8e04f090a4..af55405f5dec 100644 --- a/sound/pci/ctxfi/cthardware.h +++ b/sound/pci/ctxfi/cthardware.h | |||
@@ -30,13 +30,16 @@ enum CHIPTYP { | |||
30 | enum CTCARDS { | 30 | enum CTCARDS { |
31 | /* 20k1 models */ | 31 | /* 20k1 models */ |
32 | CTSB055X, | 32 | CTSB055X, |
33 | CT20K1_MODEL_FIRST = CTSB055X, | ||
33 | CTSB073X, | 34 | CTSB073X, |
34 | CTUAA, | 35 | CTUAA, |
35 | CT20K1_UNKNOWN, | 36 | CT20K1_UNKNOWN, |
36 | /* 20k2 models */ | 37 | /* 20k2 models */ |
37 | CTSB0760, | 38 | CTSB0760, |
39 | CT20K2_MODEL_FIRST = CTSB0760, | ||
38 | CTHENDRIX, | 40 | CTHENDRIX, |
39 | CTSB0880, | 41 | CTSB0880, |
42 | CT20K2_UNKNOWN, | ||
40 | NUM_CTCARDS /* This should always be the last */ | 43 | NUM_CTCARDS /* This should always be the last */ |
41 | }; | 44 | }; |
42 | 45 | ||
@@ -61,6 +64,10 @@ struct hw { | |||
61 | int (*card_init)(struct hw *hw, struct card_conf *info); | 64 | int (*card_init)(struct hw *hw, struct card_conf *info); |
62 | int (*card_stop)(struct hw *hw); | 65 | int (*card_stop)(struct hw *hw); |
63 | int (*pll_init)(struct hw *hw, unsigned int rsr); | 66 | int (*pll_init)(struct hw *hw, unsigned int rsr); |
67 | #ifdef CONFIG_PM | ||
68 | int (*suspend)(struct hw *hw, pm_message_t state); | ||
69 | int (*resume)(struct hw *hw, struct card_conf *info); | ||
70 | #endif | ||
64 | int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source); | 71 | int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source); |
65 | int (*select_adc_source)(struct hw *hw, enum ADCSRC source); | 72 | int (*select_adc_source)(struct hw *hw, enum ADCSRC source); |
66 | int (*have_digit_io_switch)(struct hw *hw); | 73 | int (*have_digit_io_switch)(struct hw *hw); |
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index cb69d9ddfbe3..ad3e1d144464 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -1911,9 +1911,17 @@ static int hw_card_start(struct hw *hw) | |||
1911 | goto error1; | 1911 | goto error1; |
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | err = pci_request_regions(pci, "XFi"); | 1914 | if (!hw->io_base) { |
1915 | if (err < 0) | 1915 | err = pci_request_regions(pci, "XFi"); |
1916 | goto error1; | 1916 | if (err < 0) |
1917 | goto error1; | ||
1918 | |||
1919 | if (hw->model == CTUAA) | ||
1920 | hw->io_base = pci_resource_start(pci, 5); | ||
1921 | else | ||
1922 | hw->io_base = pci_resource_start(pci, 0); | ||
1923 | |||
1924 | } | ||
1917 | 1925 | ||
1918 | /* Switch to X-Fi mode from UAA mode if neeeded */ | 1926 | /* Switch to X-Fi mode from UAA mode if neeeded */ |
1919 | if (hw->model == CTUAA) { | 1927 | if (hw->model == CTUAA) { |
@@ -1921,18 +1929,17 @@ static int hw_card_start(struct hw *hw) | |||
1921 | if (err) | 1929 | if (err) |
1922 | goto error2; | 1930 | goto error2; |
1923 | 1931 | ||
1924 | hw->io_base = pci_resource_start(pci, 5); | ||
1925 | } else { | ||
1926 | hw->io_base = pci_resource_start(pci, 0); | ||
1927 | } | 1932 | } |
1928 | 1933 | ||
1929 | err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED, | 1934 | if (hw->irq < 0) { |
1930 | "ctxfi", hw); | 1935 | err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED, |
1931 | if (err < 0) { | 1936 | "ctxfi", hw); |
1932 | printk(KERN_ERR "XFi: Cannot get irq %d\n", pci->irq); | 1937 | if (err < 0) { |
1933 | goto error2; | 1938 | printk(KERN_ERR "XFi: Cannot get irq %d\n", pci->irq); |
1939 | goto error2; | ||
1940 | } | ||
1941 | hw->irq = pci->irq; | ||
1934 | } | 1942 | } |
1935 | hw->irq = pci->irq; | ||
1936 | 1943 | ||
1937 | pci_set_master(pci); | 1944 | pci_set_master(pci); |
1938 | 1945 | ||
@@ -1948,6 +1955,15 @@ error1: | |||
1948 | 1955 | ||
1949 | static int hw_card_stop(struct hw *hw) | 1956 | static int hw_card_stop(struct hw *hw) |
1950 | { | 1957 | { |
1958 | unsigned int data; | ||
1959 | |||
1960 | /* disable transport bus master and queueing of request */ | ||
1961 | hw_write_20kx(hw, TRNCTL, 0x00); | ||
1962 | |||
1963 | /* disable pll */ | ||
1964 | data = hw_read_20kx(hw, PLLCTL); | ||
1965 | hw_write_20kx(hw, PLLCTL, (data & (~(0x0F<<12)))); | ||
1966 | |||
1951 | /* TODO: Disable interrupt and so on... */ | 1967 | /* TODO: Disable interrupt and so on... */ |
1952 | if (hw->irq >= 0) | 1968 | if (hw->irq >= 0) |
1953 | synchronize_irq(hw->irq); | 1969 | synchronize_irq(hw->irq); |
@@ -1987,11 +2003,9 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
1987 | struct trn_conf trn_info = {0}; | 2003 | struct trn_conf trn_info = {0}; |
1988 | 2004 | ||
1989 | /* Get PCI io port base address and do Hendrix switch if needed. */ | 2005 | /* Get PCI io port base address and do Hendrix switch if needed. */ |
1990 | if (!hw->io_base) { | 2006 | err = hw_card_start(hw); |
1991 | err = hw_card_start(hw); | 2007 | if (err) |
1992 | if (err) | 2008 | return err; |
1993 | return err; | ||
1994 | } | ||
1995 | 2009 | ||
1996 | /* PLL init */ | 2010 | /* PLL init */ |
1997 | err = hw_pll_init(hw, info->rsr); | 2011 | err = hw_pll_init(hw, info->rsr); |
@@ -2064,6 +2078,37 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2064 | return 0; | 2078 | return 0; |
2065 | } | 2079 | } |
2066 | 2080 | ||
2081 | #ifdef CONFIG_PM | ||
2082 | static int hw_suspend(struct hw *hw, pm_message_t state) | ||
2083 | { | ||
2084 | struct pci_dev *pci = hw->pci; | ||
2085 | |||
2086 | hw_card_stop(hw); | ||
2087 | |||
2088 | if (hw->model == CTUAA) { | ||
2089 | /* Switch to UAA config space. */ | ||
2090 | pci_write_config_dword(pci, UAA_CFG_SPACE_FLAG, 0x0); | ||
2091 | } | ||
2092 | |||
2093 | pci_disable_device(pci); | ||
2094 | pci_save_state(pci); | ||
2095 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2096 | |||
2097 | return 0; | ||
2098 | } | ||
2099 | |||
2100 | static int hw_resume(struct hw *hw, struct card_conf *info) | ||
2101 | { | ||
2102 | struct pci_dev *pci = hw->pci; | ||
2103 | |||
2104 | pci_set_power_state(pci, PCI_D0); | ||
2105 | pci_restore_state(pci); | ||
2106 | |||
2107 | /* Re-initialize card hardware. */ | ||
2108 | return hw_card_init(hw, info); | ||
2109 | } | ||
2110 | #endif | ||
2111 | |||
2067 | static u32 hw_read_20kx(struct hw *hw, u32 reg) | 2112 | static u32 hw_read_20kx(struct hw *hw, u32 reg) |
2068 | { | 2113 | { |
2069 | u32 value; | 2114 | u32 value; |
@@ -2128,6 +2173,10 @@ static struct hw ct20k1_preset __devinitdata = { | |||
2128 | .is_adc_source_selected = hw_is_adc_input_selected, | 2173 | .is_adc_source_selected = hw_is_adc_input_selected, |
2129 | .select_adc_source = hw_adc_input_select, | 2174 | .select_adc_source = hw_adc_input_select, |
2130 | .have_digit_io_switch = hw_have_digit_io_switch, | 2175 | .have_digit_io_switch = hw_have_digit_io_switch, |
2176 | #ifdef CONFIG_PM | ||
2177 | .suspend = hw_suspend, | ||
2178 | .resume = hw_resume, | ||
2179 | #endif | ||
2131 | 2180 | ||
2132 | .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk, | 2181 | .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk, |
2133 | .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk, | 2182 | .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk, |
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 4493a51c6b01..dec46d04b041 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c | |||
@@ -1860,16 +1860,18 @@ static int hw_card_start(struct hw *hw) | |||
1860 | goto error1; | 1860 | goto error1; |
1861 | } | 1861 | } |
1862 | 1862 | ||
1863 | err = pci_request_regions(pci, "XFi"); | 1863 | if (!hw->io_base) { |
1864 | if (err < 0) | 1864 | err = pci_request_regions(pci, "XFi"); |
1865 | goto error1; | 1865 | if (err < 0) |
1866 | goto error1; | ||
1866 | 1867 | ||
1867 | hw->io_base = pci_resource_start(hw->pci, 2); | 1868 | hw->io_base = pci_resource_start(hw->pci, 2); |
1868 | hw->mem_base = (unsigned long)ioremap(hw->io_base, | 1869 | hw->mem_base = (unsigned long)ioremap(hw->io_base, |
1869 | pci_resource_len(hw->pci, 2)); | 1870 | pci_resource_len(hw->pci, 2)); |
1870 | if (NULL == (void *)hw->mem_base) { | 1871 | if (NULL == (void *)hw->mem_base) { |
1871 | err = -ENOENT; | 1872 | err = -ENOENT; |
1872 | goto error2; | 1873 | goto error2; |
1874 | } | ||
1873 | } | 1875 | } |
1874 | 1876 | ||
1875 | /* Switch to 20k2 mode from UAA mode. */ | 1877 | /* Switch to 20k2 mode from UAA mode. */ |
@@ -1901,6 +1903,15 @@ error1: | |||
1901 | 1903 | ||
1902 | static int hw_card_stop(struct hw *hw) | 1904 | static int hw_card_stop(struct hw *hw) |
1903 | { | 1905 | { |
1906 | unsigned int data; | ||
1907 | |||
1908 | /* disable transport bus master and queueing of request */ | ||
1909 | hw_write_20kx(hw, TRANSPORT_CTL, 0x00); | ||
1910 | |||
1911 | /* disable pll */ | ||
1912 | data = hw_read_20kx(hw, PLL_ENB); | ||
1913 | hw_write_20kx(hw, PLL_ENB, (data & (~0x07))); | ||
1914 | |||
1904 | /* TODO: Disable interrupt and so on... */ | 1915 | /* TODO: Disable interrupt and so on... */ |
1905 | return 0; | 1916 | return 0; |
1906 | } | 1917 | } |
@@ -1939,11 +1950,9 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
1939 | 1950 | ||
1940 | /* Get PCI io port/memory base address and | 1951 | /* Get PCI io port/memory base address and |
1941 | * do 20kx core switch if needed. */ | 1952 | * do 20kx core switch if needed. */ |
1942 | if (!hw->io_base) { | 1953 | err = hw_card_start(hw); |
1943 | err = hw_card_start(hw); | 1954 | if (err) |
1944 | if (err) | 1955 | return err; |
1945 | return err; | ||
1946 | } | ||
1947 | 1956 | ||
1948 | /* PLL init */ | 1957 | /* PLL init */ |
1949 | err = hw_pll_init(hw, info->rsr); | 1958 | err = hw_pll_init(hw, info->rsr); |
@@ -2006,6 +2015,32 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2006 | return 0; | 2015 | return 0; |
2007 | } | 2016 | } |
2008 | 2017 | ||
2018 | #ifdef CONFIG_PM | ||
2019 | static int hw_suspend(struct hw *hw, pm_message_t state) | ||
2020 | { | ||
2021 | struct pci_dev *pci = hw->pci; | ||
2022 | |||
2023 | hw_card_stop(hw); | ||
2024 | |||
2025 | pci_disable_device(pci); | ||
2026 | pci_save_state(pci); | ||
2027 | pci_set_power_state(pci, pci_choose_state(pci, state)); | ||
2028 | |||
2029 | return 0; | ||
2030 | } | ||
2031 | |||
2032 | static int hw_resume(struct hw *hw, struct card_conf *info) | ||
2033 | { | ||
2034 | struct pci_dev *pci = hw->pci; | ||
2035 | |||
2036 | pci_set_power_state(pci, PCI_D0); | ||
2037 | pci_restore_state(pci); | ||
2038 | |||
2039 | /* Re-initialize card hardware. */ | ||
2040 | return hw_card_init(hw, info); | ||
2041 | } | ||
2042 | #endif | ||
2043 | |||
2009 | static u32 hw_read_20kx(struct hw *hw, u32 reg) | 2044 | static u32 hw_read_20kx(struct hw *hw, u32 reg) |
2010 | { | 2045 | { |
2011 | return readl((void *)(hw->mem_base + reg)); | 2046 | return readl((void *)(hw->mem_base + reg)); |
@@ -2025,6 +2060,10 @@ static struct hw ct20k2_preset __devinitdata = { | |||
2025 | .is_adc_source_selected = hw_is_adc_input_selected, | 2060 | .is_adc_source_selected = hw_is_adc_input_selected, |
2026 | .select_adc_source = hw_adc_input_select, | 2061 | .select_adc_source = hw_adc_input_select, |
2027 | .have_digit_io_switch = hw_have_digit_io_switch, | 2062 | .have_digit_io_switch = hw_have_digit_io_switch, |
2063 | #ifdef CONFIG_PM | ||
2064 | .suspend = hw_suspend, | ||
2065 | .resume = hw_resume, | ||
2066 | #endif | ||
2028 | 2067 | ||
2029 | .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk, | 2068 | .src_rsc_get_ctrl_blk = src_get_rsc_ctrl_blk, |
2030 | .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk, | 2069 | .src_rsc_put_ctrl_blk = src_put_rsc_ctrl_blk, |
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c index 666722d9de41..f26d7cd9db9f 100644 --- a/sound/pci/ctxfi/ctmixer.c +++ b/sound/pci/ctxfi/ctmixer.c | |||
@@ -462,6 +462,43 @@ do_digit_io_switch(struct ct_atc *atc, int state) | |||
462 | return; | 462 | return; |
463 | } | 463 | } |
464 | 464 | ||
465 | static void do_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type, int state) | ||
466 | { | ||
467 | struct ct_mixer *mixer = atc->mixer; | ||
468 | |||
469 | /* Do changes in mixer. */ | ||
470 | if ((SWH_CAPTURE_START <= type) && (SWH_CAPTURE_END >= type)) { | ||
471 | if (state) { | ||
472 | ct_mixer_recording_select(mixer, | ||
473 | get_amixer_index(type)); | ||
474 | } else { | ||
475 | ct_mixer_recording_unselect(mixer, | ||
476 | get_amixer_index(type)); | ||
477 | } | ||
478 | } | ||
479 | /* Do changes out of mixer. */ | ||
480 | if (state && (MIXER_LINEIN_C_S == type || MIXER_MIC_C_S == type)) | ||
481 | do_line_mic_switch(atc, type); | ||
482 | else if (MIXER_WAVEF_P_S == type) | ||
483 | atc->line_front_unmute(atc, state); | ||
484 | else if (MIXER_WAVES_P_S == type) | ||
485 | atc->line_surround_unmute(atc, state); | ||
486 | else if (MIXER_WAVEC_P_S == type) | ||
487 | atc->line_clfe_unmute(atc, state); | ||
488 | else if (MIXER_WAVER_P_S == type) | ||
489 | atc->line_rear_unmute(atc, state); | ||
490 | else if (MIXER_LINEIN_P_S == type) | ||
491 | atc->line_in_unmute(atc, state); | ||
492 | else if (MIXER_SPDIFO_P_S == type) | ||
493 | atc->spdif_out_unmute(atc, state); | ||
494 | else if (MIXER_SPDIFI_P_S == type) | ||
495 | atc->spdif_in_unmute(atc, state); | ||
496 | else if (MIXER_DIGITAL_IO_S == type) | ||
497 | do_digit_io_switch(atc, state); | ||
498 | |||
499 | return; | ||
500 | } | ||
501 | |||
465 | static int ct_alsa_mix_switch_info(struct snd_kcontrol *kcontrol, | 502 | static int ct_alsa_mix_switch_info(struct snd_kcontrol *kcontrol, |
466 | struct snd_ctl_elem_info *uinfo) | 503 | struct snd_ctl_elem_info *uinfo) |
467 | { | 504 | { |
@@ -498,35 +535,7 @@ static int ct_alsa_mix_switch_put(struct snd_kcontrol *kcontrol, | |||
498 | return 0; | 535 | return 0; |
499 | 536 | ||
500 | set_switch_state(mixer, type, state); | 537 | set_switch_state(mixer, type, state); |
501 | /* Do changes in mixer. */ | 538 | do_switch(atc, type, state); |
502 | if ((SWH_CAPTURE_START <= type) && (SWH_CAPTURE_END >= type)) { | ||
503 | if (state) { | ||
504 | ct_mixer_recording_select(mixer, | ||
505 | get_amixer_index(type)); | ||
506 | } else { | ||
507 | ct_mixer_recording_unselect(mixer, | ||
508 | get_amixer_index(type)); | ||
509 | } | ||
510 | } | ||
511 | /* Do changes out of mixer. */ | ||
512 | if (state && (MIXER_LINEIN_C_S == type || MIXER_MIC_C_S == type)) | ||
513 | do_line_mic_switch(atc, type); | ||
514 | else if (MIXER_WAVEF_P_S == type) | ||
515 | atc->line_front_unmute(atc, state); | ||
516 | else if (MIXER_WAVES_P_S == type) | ||
517 | atc->line_surround_unmute(atc, state); | ||
518 | else if (MIXER_WAVEC_P_S == type) | ||
519 | atc->line_clfe_unmute(atc, state); | ||
520 | else if (MIXER_WAVER_P_S == type) | ||
521 | atc->line_rear_unmute(atc, state); | ||
522 | else if (MIXER_LINEIN_P_S == type) | ||
523 | atc->line_in_unmute(atc, state); | ||
524 | else if (MIXER_SPDIFO_P_S == type) | ||
525 | atc->spdif_out_unmute(atc, state); | ||
526 | else if (MIXER_SPDIFI_P_S == type) | ||
527 | atc->spdif_in_unmute(atc, state); | ||
528 | else if (MIXER_DIGITAL_IO_S == type) | ||
529 | do_digit_io_switch(atc, state); | ||
530 | 539 | ||
531 | return 1; | 540 | return 1; |
532 | } | 541 | } |
@@ -1039,6 +1048,28 @@ mixer_set_input_right(struct ct_mixer *mixer, | |||
1039 | return 0; | 1048 | return 0; |
1040 | } | 1049 | } |
1041 | 1050 | ||
1051 | #ifdef CONFIG_PM | ||
1052 | static int mixer_resume(struct ct_mixer *mixer) | ||
1053 | { | ||
1054 | int i, state; | ||
1055 | struct amixer *amixer; | ||
1056 | |||
1057 | /* resume topology and volume gain. */ | ||
1058 | for (i = 0; i < NUM_CT_AMIXERS*CHN_NUM; i++) { | ||
1059 | amixer = mixer->amixers[i]; | ||
1060 | amixer->ops->commit_write(amixer); | ||
1061 | } | ||
1062 | |||
1063 | /* resume switch state. */ | ||
1064 | for (i = SWH_MIXER_START; i <= SWH_MIXER_END; i++) { | ||
1065 | state = get_switch_state(mixer, i); | ||
1066 | do_switch(mixer->atc, i, state); | ||
1067 | } | ||
1068 | |||
1069 | return 0; | ||
1070 | } | ||
1071 | #endif | ||
1072 | |||
1042 | int ct_mixer_destroy(struct ct_mixer *mixer) | 1073 | int ct_mixer_destroy(struct ct_mixer *mixer) |
1043 | { | 1074 | { |
1044 | struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; | 1075 | struct sum_mgr *sum_mgr = (struct sum_mgr *)mixer->atc->rsc_mgrs[SUM]; |
@@ -1087,6 +1118,9 @@ int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer) | |||
1087 | mixer->get_output_ports = mixer_get_output_ports; | 1118 | mixer->get_output_ports = mixer_get_output_ports; |
1088 | mixer->set_input_left = mixer_set_input_left; | 1119 | mixer->set_input_left = mixer_set_input_left; |
1089 | mixer->set_input_right = mixer_set_input_right; | 1120 | mixer->set_input_right = mixer_set_input_right; |
1121 | #ifdef CONFIG_PM | ||
1122 | mixer->resume = mixer_resume; | ||
1123 | #endif | ||
1090 | 1124 | ||
1091 | /* Allocate chip resources for mixer obj */ | 1125 | /* Allocate chip resources for mixer obj */ |
1092 | err = ct_mixer_get_resources(mixer); | 1126 | err = ct_mixer_get_resources(mixer); |
diff --git a/sound/pci/ctxfi/ctmixer.h b/sound/pci/ctxfi/ctmixer.h index e2d96ebde746..b009e989e77d 100644 --- a/sound/pci/ctxfi/ctmixer.h +++ b/sound/pci/ctxfi/ctmixer.h | |||
@@ -56,6 +56,9 @@ struct ct_mixer { | |||
56 | enum MIXER_PORT_T type, struct rsc *rsc); | 56 | enum MIXER_PORT_T type, struct rsc *rsc); |
57 | int (*set_input_right)(struct ct_mixer *mixer, | 57 | int (*set_input_right)(struct ct_mixer *mixer, |
58 | enum MIXER_PORT_T type, struct rsc *rsc); | 58 | enum MIXER_PORT_T type, struct rsc *rsc); |
59 | #ifdef CONFIG_PM | ||
60 | int (*resume)(struct ct_mixer *mixer); | ||
61 | #endif | ||
59 | }; | 62 | }; |
60 | 63 | ||
61 | int ct_alsa_mix_create(struct ct_atc *atc, | 64 | int ct_alsa_mix_create(struct ct_atc *atc, |
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 9e5c0c4da726..60ea23180acb 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c | |||
@@ -422,5 +422,9 @@ int ct_alsa_pcm_create(struct ct_atc *atc, | |||
422 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, | 422 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
423 | snd_dma_pci_data(atc->pci), 128*1024, 128*1024); | 423 | snd_dma_pci_data(atc->pci), 128*1024, 128*1024); |
424 | 424 | ||
425 | #ifdef CONFIG_PM | ||
426 | atc->pcms[device] = pcm; | ||
427 | #endif | ||
428 | |||
425 | return 0; | 429 | return 0; |
426 | } | 430 | } |
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index 2d3dd89af151..76541748e7bc 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c | |||
@@ -121,11 +121,33 @@ static void __devexit ct_card_remove(struct pci_dev *pci) | |||
121 | pci_set_drvdata(pci, NULL); | 121 | pci_set_drvdata(pci, NULL); |
122 | } | 122 | } |
123 | 123 | ||
124 | #ifdef CONFIG_PM | ||
125 | static int ct_card_suspend(struct pci_dev *pci, pm_message_t state) | ||
126 | { | ||
127 | struct snd_card *card = pci_get_drvdata(pci); | ||
128 | struct ct_atc *atc = card->private_data; | ||
129 | |||
130 | return atc->suspend(atc, state); | ||
131 | } | ||
132 | |||
133 | static int ct_card_resume(struct pci_dev *pci) | ||
134 | { | ||
135 | struct snd_card *card = pci_get_drvdata(pci); | ||
136 | struct ct_atc *atc = card->private_data; | ||
137 | |||
138 | return atc->resume(atc); | ||
139 | } | ||
140 | #endif | ||
141 | |||
124 | static struct pci_driver ct_driver = { | 142 | static struct pci_driver ct_driver = { |
125 | .name = "SB-XFi", | 143 | .name = "SB-XFi", |
126 | .id_table = ct_pci_dev_ids, | 144 | .id_table = ct_pci_dev_ids, |
127 | .probe = ct_card_probe, | 145 | .probe = ct_card_probe, |
128 | .remove = __devexit_p(ct_card_remove), | 146 | .remove = __devexit_p(ct_card_remove), |
147 | #ifdef CONFIG_PM | ||
148 | .suspend = ct_card_suspend, | ||
149 | .resume = ct_card_resume, | ||
150 | #endif | ||
129 | }; | 151 | }; |
130 | 152 | ||
131 | static int __init ct_card_init(void) | 153 | static int __init ct_card_init(void) |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index c7f3b994101c..168af67d938e 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -77,9 +77,9 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model."); | |||
77 | * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 | 77 | * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 |
78 | */ | 78 | */ |
79 | static struct pci_device_id snd_emu10k1_ids[] = { | 79 | static struct pci_device_id snd_emu10k1_ids[] = { |
80 | { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ | 80 | { PCI_VDEVICE(CREATIVE, 0x0002), 0 }, /* EMU10K1 */ |
81 | { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ | 81 | { PCI_VDEVICE(CREATIVE, 0x0004), 1 }, /* Audigy */ |
82 | { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ | 82 | { PCI_VDEVICE(CREATIVE, 0x0008), 1 }, /* Audigy 2 Value SB0400 */ |
83 | { 0, } | 83 | { 0, } |
84 | }; | 84 | }; |
85 | 85 | ||
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 4d3ad793e98f..36e08bd2b3cc 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -1607,7 +1607,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci) | |||
1607 | 1607 | ||
1608 | // PCI IDs | 1608 | // PCI IDs |
1609 | static struct pci_device_id snd_emu10k1x_ids[] = { | 1609 | static struct pci_device_id snd_emu10k1x_ids[] = { |
1610 | { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ | 1610 | { PCI_VDEVICE(CREATIVE, 0x0006), 0 }, /* Dell OEM version (EMU10K1) */ |
1611 | { 0, } | 1611 | { 0, } |
1612 | }; | 1612 | }; |
1613 | MODULE_DEVICE_TABLE(pci, snd_emu10k1x_ids); | 1613 | MODULE_DEVICE_TABLE(pci, snd_emu10k1x_ids); |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 18f4d1e98c46..2b82c5c723e1 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -445,12 +445,12 @@ static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id); | |||
445 | 445 | ||
446 | static struct pci_device_id snd_audiopci_ids[] = { | 446 | static struct pci_device_id snd_audiopci_ids[] = { |
447 | #ifdef CHIP1370 | 447 | #ifdef CHIP1370 |
448 | { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */ | 448 | { PCI_VDEVICE(ENSONIQ, 0x5000), 0, }, /* ES1370 */ |
449 | #endif | 449 | #endif |
450 | #ifdef CHIP1371 | 450 | #ifdef CHIP1371 |
451 | { 0x1274, 0x1371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1371 */ | 451 | { PCI_VDEVICE(ENSONIQ, 0x1371), 0, }, /* ES1371 */ |
452 | { 0x1274, 0x5880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1373 - CT5880 */ | 452 | { PCI_VDEVICE(ENSONIQ, 0x5880), 0, }, /* ES1373 - CT5880 */ |
453 | { 0x1102, 0x8938, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Ectiva EV1938 */ | 453 | { PCI_VDEVICE(ECTIVA, 0x8938), 0, }, /* Ectiva EV1938 */ |
454 | #endif | 454 | #endif |
455 | { 0, } | 455 | { 0, } |
456 | }; | 456 | }; |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index fbd2ac09aa34..820318ee62c1 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -244,7 +244,7 @@ struct es1938 { | |||
244 | static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id); | 244 | static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id); |
245 | 245 | ||
246 | static struct pci_device_id snd_es1938_ids[] = { | 246 | static struct pci_device_id snd_es1938_ids[] = { |
247 | { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ | 247 | { PCI_VDEVICE(ESS, 0x1969), 0, }, /* Solo-1 */ |
248 | { 0, } | 248 | { 0, } |
249 | }; | 249 | }; |
250 | 250 | ||
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index c710150d5065..04438f1d682d 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig | |||
@@ -2,7 +2,6 @@ menuconfig SND_HDA_INTEL | |||
2 | tristate "Intel HD Audio" | 2 | tristate "Intel HD Audio" |
3 | select SND_PCM | 3 | select SND_PCM |
4 | select SND_VMASTER | 4 | select SND_VMASTER |
5 | select SND_JACK if INPUT=y || INPUT=SND | ||
6 | help | 5 | help |
7 | Say Y here to include support for Intel "High Definition | 6 | Say Y here to include support for Intel "High Definition |
8 | Audio" (Azalia) and its compatible devices. | 7 | Audio" (Azalia) and its compatible devices. |
@@ -39,6 +38,14 @@ config SND_HDA_INPUT_BEEP | |||
39 | Say Y here to build a digital beep interface for HD-audio | 38 | Say Y here to build a digital beep interface for HD-audio |
40 | driver. This interface is used to generate digital beeps. | 39 | driver. This interface is used to generate digital beeps. |
41 | 40 | ||
41 | config SND_HDA_INPUT_JACK | ||
42 | bool "Support jack plugging notification via input layer" | ||
43 | depends on INPUT=y || INPUT=SND_HDA_INTEL | ||
44 | select SND_JACK | ||
45 | help | ||
46 | Say Y here to enable the jack plugging notification via | ||
47 | input layer. | ||
48 | |||
42 | config SND_HDA_CODEC_REALTEK | 49 | config SND_HDA_CODEC_REALTEK |
43 | bool "Build Realtek HD-audio codec support" | 50 | bool "Build Realtek HD-audio codec support" |
44 | default y | 51 | default y |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 84cc49ca9148..1988582d1ab8 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -72,6 +72,7 @@ struct ad198x_spec { | |||
72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; | 72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; |
73 | 73 | ||
74 | unsigned int jack_present :1; | 74 | unsigned int jack_present :1; |
75 | unsigned int inv_jack_detect:1; | ||
75 | 76 | ||
76 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 77 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
77 | struct hda_loopback_check loopback; | 78 | struct hda_loopback_check loopback; |
@@ -669,39 +670,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = { | |||
669 | }, | 670 | }, |
670 | }; | 671 | }; |
671 | 672 | ||
672 | static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { | 673 | static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = { |
673 | HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), | 674 | HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), |
674 | HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), | 675 | HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), |
675 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), | ||
676 | HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), | ||
677 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT), | ||
678 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT), | ||
679 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), | ||
680 | HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), | ||
681 | HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), | ||
682 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT), | ||
683 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT), | ||
684 | { | ||
685 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
686 | .name = "Capture Source", | ||
687 | .info = ad198x_mux_enum_info, | ||
688 | .get = ad198x_mux_enum_get, | ||
689 | .put = ad198x_mux_enum_put, | ||
690 | }, | ||
691 | { | ||
692 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
693 | .name = "External Amplifier", | ||
694 | .info = ad198x_eapd_info, | ||
695 | .get = ad198x_eapd_get, | ||
696 | .put = ad198x_eapd_put, | ||
697 | .private_value = 0x1b | (1 << 8), /* port-D, inversed */ | ||
698 | }, | ||
699 | { } /* end */ | 676 | { } /* end */ |
700 | }; | 677 | }; |
701 | 678 | ||
702 | static struct snd_kcontrol_new ad1986a_samsung_mixers[] = { | 679 | static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { |
703 | HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), | ||
704 | HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), | ||
705 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), | 680 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), |
706 | HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), | 681 | HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), |
707 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), | 682 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), |
@@ -727,6 +702,12 @@ static struct snd_kcontrol_new ad1986a_samsung_mixers[] = { | |||
727 | { } /* end */ | 702 | { } /* end */ |
728 | }; | 703 | }; |
729 | 704 | ||
705 | static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = { | ||
706 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT), | ||
707 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT), | ||
708 | { } /* end */ | ||
709 | }; | ||
710 | |||
730 | /* re-connect the mic boost input according to the jack sensing */ | 711 | /* re-connect the mic boost input according to the jack sensing */ |
731 | static void ad1986a_automic(struct hda_codec *codec) | 712 | static void ad1986a_automic(struct hda_codec *codec) |
732 | { | 713 | { |
@@ -776,8 +757,9 @@ static void ad1986a_hp_automute(struct hda_codec *codec) | |||
776 | unsigned int present; | 757 | unsigned int present; |
777 | 758 | ||
778 | present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); | 759 | present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); |
779 | /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */ | 760 | spec->jack_present = !!(present & 0x80000000); |
780 | spec->jack_present = !(present & 0x80000000); | 761 | if (spec->inv_jack_detect) |
762 | spec->jack_present = !spec->jack_present; | ||
781 | ad1986a_update_hp(codec); | 763 | ad1986a_update_hp(codec); |
782 | } | 764 | } |
783 | 765 | ||
@@ -816,7 +798,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol, | |||
816 | return change; | 798 | return change; |
817 | } | 799 | } |
818 | 800 | ||
819 | static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = { | 801 | static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { |
820 | HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), | 802 | HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), |
821 | { | 803 | { |
822 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 804 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -826,33 +808,10 @@ static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = { | |||
826 | .put = ad1986a_hp_master_sw_put, | 808 | .put = ad1986a_hp_master_sw_put, |
827 | .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), | 809 | .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), |
828 | }, | 810 | }, |
829 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), | ||
830 | HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), | ||
831 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT), | ||
832 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT), | ||
833 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), | ||
834 | HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), | ||
835 | HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), | ||
836 | HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT), | ||
837 | HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT), | ||
838 | { | ||
839 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
840 | .name = "Capture Source", | ||
841 | .info = ad198x_mux_enum_info, | ||
842 | .get = ad198x_mux_enum_get, | ||
843 | .put = ad198x_mux_enum_put, | ||
844 | }, | ||
845 | { | ||
846 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
847 | .name = "External Amplifier", | ||
848 | .info = ad198x_eapd_info, | ||
849 | .get = ad198x_eapd_get, | ||
850 | .put = ad198x_eapd_put, | ||
851 | .private_value = 0x1b | (1 << 8), /* port-D, inversed */ | ||
852 | }, | ||
853 | { } /* end */ | 811 | { } /* end */ |
854 | }; | 812 | }; |
855 | 813 | ||
814 | |||
856 | /* | 815 | /* |
857 | * initialization verbs | 816 | * initialization verbs |
858 | */ | 817 | */ |
@@ -981,6 +940,27 @@ static struct hda_verb ad1986a_hp_init_verbs[] = { | |||
981 | {} | 940 | {} |
982 | }; | 941 | }; |
983 | 942 | ||
943 | static void ad1986a_samsung_p50_unsol_event(struct hda_codec *codec, | ||
944 | unsigned int res) | ||
945 | { | ||
946 | switch (res >> 26) { | ||
947 | case AD1986A_HP_EVENT: | ||
948 | ad1986a_hp_automute(codec); | ||
949 | break; | ||
950 | case AD1986A_MIC_EVENT: | ||
951 | ad1986a_automic(codec); | ||
952 | break; | ||
953 | } | ||
954 | } | ||
955 | |||
956 | static int ad1986a_samsung_p50_init(struct hda_codec *codec) | ||
957 | { | ||
958 | ad198x_init(codec); | ||
959 | ad1986a_hp_automute(codec); | ||
960 | ad1986a_automic(codec); | ||
961 | return 0; | ||
962 | } | ||
963 | |||
984 | 964 | ||
985 | /* models */ | 965 | /* models */ |
986 | enum { | 966 | enum { |
@@ -991,6 +971,7 @@ enum { | |||
991 | AD1986A_LAPTOP_AUTOMUTE, | 971 | AD1986A_LAPTOP_AUTOMUTE, |
992 | AD1986A_ULTRA, | 972 | AD1986A_ULTRA, |
993 | AD1986A_SAMSUNG, | 973 | AD1986A_SAMSUNG, |
974 | AD1986A_SAMSUNG_P50, | ||
994 | AD1986A_MODELS | 975 | AD1986A_MODELS |
995 | }; | 976 | }; |
996 | 977 | ||
@@ -1002,6 +983,7 @@ static const char *ad1986a_models[AD1986A_MODELS] = { | |||
1002 | [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute", | 983 | [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute", |
1003 | [AD1986A_ULTRA] = "ultra", | 984 | [AD1986A_ULTRA] = "ultra", |
1004 | [AD1986A_SAMSUNG] = "samsung", | 985 | [AD1986A_SAMSUNG] = "samsung", |
986 | [AD1986A_SAMSUNG_P50] = "samsung-p50", | ||
1005 | }; | 987 | }; |
1006 | 988 | ||
1007 | static struct snd_pci_quirk ad1986a_cfg_tbl[] = { | 989 | static struct snd_pci_quirk ad1986a_cfg_tbl[] = { |
@@ -1024,6 +1006,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = { | |||
1024 | SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), | 1006 | SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), |
1025 | SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), | 1007 | SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), |
1026 | SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), | 1008 | SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), |
1009 | SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50), | ||
1027 | SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), | 1010 | SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), |
1028 | SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG), | 1011 | SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG), |
1029 | SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), | 1012 | SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), |
@@ -1111,7 +1094,10 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1111 | spec->multiout.dac_nids = ad1986a_laptop_dac_nids; | 1094 | spec->multiout.dac_nids = ad1986a_laptop_dac_nids; |
1112 | break; | 1095 | break; |
1113 | case AD1986A_LAPTOP_EAPD: | 1096 | case AD1986A_LAPTOP_EAPD: |
1114 | spec->mixers[0] = ad1986a_laptop_eapd_mixers; | 1097 | spec->num_mixers = 3; |
1098 | spec->mixers[0] = ad1986a_laptop_master_mixers; | ||
1099 | spec->mixers[1] = ad1986a_laptop_eapd_mixers; | ||
1100 | spec->mixers[2] = ad1986a_laptop_intmic_mixers; | ||
1115 | spec->num_init_verbs = 2; | 1101 | spec->num_init_verbs = 2; |
1116 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; | 1102 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; |
1117 | spec->multiout.max_channels = 2; | 1103 | spec->multiout.max_channels = 2; |
@@ -1122,7 +1108,9 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1122 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; | 1108 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; |
1123 | break; | 1109 | break; |
1124 | case AD1986A_SAMSUNG: | 1110 | case AD1986A_SAMSUNG: |
1125 | spec->mixers[0] = ad1986a_samsung_mixers; | 1111 | spec->num_mixers = 2; |
1112 | spec->mixers[0] = ad1986a_laptop_master_mixers; | ||
1113 | spec->mixers[1] = ad1986a_laptop_eapd_mixers; | ||
1126 | spec->num_init_verbs = 3; | 1114 | spec->num_init_verbs = 3; |
1127 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; | 1115 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; |
1128 | spec->init_verbs[2] = ad1986a_automic_verbs; | 1116 | spec->init_verbs[2] = ad1986a_automic_verbs; |
@@ -1135,8 +1123,28 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1135 | codec->patch_ops.unsol_event = ad1986a_automic_unsol_event; | 1123 | codec->patch_ops.unsol_event = ad1986a_automic_unsol_event; |
1136 | codec->patch_ops.init = ad1986a_automic_init; | 1124 | codec->patch_ops.init = ad1986a_automic_init; |
1137 | break; | 1125 | break; |
1126 | case AD1986A_SAMSUNG_P50: | ||
1127 | spec->num_mixers = 2; | ||
1128 | spec->mixers[0] = ad1986a_automute_master_mixers; | ||
1129 | spec->mixers[1] = ad1986a_laptop_eapd_mixers; | ||
1130 | spec->num_init_verbs = 4; | ||
1131 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; | ||
1132 | spec->init_verbs[2] = ad1986a_automic_verbs; | ||
1133 | spec->init_verbs[3] = ad1986a_hp_init_verbs; | ||
1134 | spec->multiout.max_channels = 2; | ||
1135 | spec->multiout.num_dacs = 1; | ||
1136 | spec->multiout.dac_nids = ad1986a_laptop_dac_nids; | ||
1137 | if (!is_jack_available(codec, 0x25)) | ||
1138 | spec->multiout.dig_out_nid = 0; | ||
1139 | spec->input_mux = &ad1986a_automic_capture_source; | ||
1140 | codec->patch_ops.unsol_event = ad1986a_samsung_p50_unsol_event; | ||
1141 | codec->patch_ops.init = ad1986a_samsung_p50_init; | ||
1142 | break; | ||
1138 | case AD1986A_LAPTOP_AUTOMUTE: | 1143 | case AD1986A_LAPTOP_AUTOMUTE: |
1139 | spec->mixers[0] = ad1986a_laptop_automute_mixers; | 1144 | spec->num_mixers = 3; |
1145 | spec->mixers[0] = ad1986a_automute_master_mixers; | ||
1146 | spec->mixers[1] = ad1986a_laptop_eapd_mixers; | ||
1147 | spec->mixers[2] = ad1986a_laptop_intmic_mixers; | ||
1140 | spec->num_init_verbs = 3; | 1148 | spec->num_init_verbs = 3; |
1141 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; | 1149 | spec->init_verbs[1] = ad1986a_eapd_init_verbs; |
1142 | spec->init_verbs[2] = ad1986a_hp_init_verbs; | 1150 | spec->init_verbs[2] = ad1986a_hp_init_verbs; |
@@ -1148,6 +1156,10 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1148 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; | 1156 | spec->input_mux = &ad1986a_laptop_eapd_capture_source; |
1149 | codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; | 1157 | codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; |
1150 | codec->patch_ops.init = ad1986a_hp_init; | 1158 | codec->patch_ops.init = ad1986a_hp_init; |
1159 | /* Lenovo N100 seems to report the reversed bit | ||
1160 | * for HP jack-sensing | ||
1161 | */ | ||
1162 | spec->inv_jack_detect = 1; | ||
1151 | break; | 1163 | break; |
1152 | case AD1986A_ULTRA: | 1164 | case AD1986A_ULTRA: |
1153 | spec->mixers[0] = ad1986a_laptop_eapd_mixers; | 1165 | spec->mixers[0] = ad1986a_laptop_eapd_mixers; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 4fcbe21829ab..ac868c59f9e3 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -349,7 +349,7 @@ static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
349 | &spec->cur_mux[adc_idx]); | 349 | &spec->cur_mux[adc_idx]); |
350 | } | 350 | } |
351 | 351 | ||
352 | #ifdef CONFIG_SND_JACK | 352 | #ifdef CONFIG_SND_HDA_INPUT_JACK |
353 | static void conexant_free_jack_priv(struct snd_jack *jack) | 353 | static void conexant_free_jack_priv(struct snd_jack *jack) |
354 | { | 354 | { |
355 | struct conexant_jack *jacks = jack->private_data; | 355 | struct conexant_jack *jacks = jack->private_data; |
@@ -463,7 +463,7 @@ static int conexant_init(struct hda_codec *codec) | |||
463 | 463 | ||
464 | static void conexant_free(struct hda_codec *codec) | 464 | static void conexant_free(struct hda_codec *codec) |
465 | { | 465 | { |
466 | #ifdef CONFIG_SND_JACK | 466 | #ifdef CONFIG_SND_HDA_INPUT_JACK |
467 | struct conexant_spec *spec = codec->spec; | 467 | struct conexant_spec *spec = codec->spec; |
468 | if (spec->jacks.list) { | 468 | if (spec->jacks.list) { |
469 | struct conexant_jack *jacks = spec->jacks.list; | 469 | struct conexant_jack *jacks = spec->jacks.list; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index bf4b78a74a8f..3a8e58c483df 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -250,13 +250,6 @@ enum { | |||
250 | ALC883_MODEL_LAST, | 250 | ALC883_MODEL_LAST, |
251 | }; | 251 | }; |
252 | 252 | ||
253 | /* styles of capture selection */ | ||
254 | enum { | ||
255 | CAPT_MUX = 0, /* only mux based */ | ||
256 | CAPT_MIX, /* only mixer based */ | ||
257 | CAPT_1MUX_MIX, /* first mux and other mixers */ | ||
258 | }; | ||
259 | |||
260 | /* for GPIO Poll */ | 253 | /* for GPIO Poll */ |
261 | #define GPIO_MASK 0x03 | 254 | #define GPIO_MASK 0x03 |
262 | 255 | ||
@@ -306,7 +299,6 @@ struct alc_spec { | |||
306 | hda_nid_t *adc_nids; | 299 | hda_nid_t *adc_nids; |
307 | hda_nid_t *capsrc_nids; | 300 | hda_nid_t *capsrc_nids; |
308 | hda_nid_t dig_in_nid; /* digital-in NID; optional */ | 301 | hda_nid_t dig_in_nid; /* digital-in NID; optional */ |
309 | int capture_style; /* capture style (CAPT_*) */ | ||
310 | 302 | ||
311 | /* capture source */ | 303 | /* capture source */ |
312 | unsigned int num_mux_defs; | 304 | unsigned int num_mux_defs; |
@@ -420,12 +412,13 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
420 | unsigned int mux_idx; | 412 | unsigned int mux_idx; |
421 | hda_nid_t nid = spec->capsrc_nids ? | 413 | hda_nid_t nid = spec->capsrc_nids ? |
422 | spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; | 414 | spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; |
415 | unsigned int type; | ||
423 | 416 | ||
424 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; | 417 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; |
425 | imux = &spec->input_mux[mux_idx]; | 418 | imux = &spec->input_mux[mux_idx]; |
426 | 419 | ||
427 | if (spec->capture_style && | 420 | type = (get_wcaps(codec, nid) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; |
428 | !(spec->capture_style == CAPT_1MUX_MIX && !adc_idx)) { | 421 | if (type == AC_WID_AUD_MIX) { |
429 | /* Matrix-mixer style (e.g. ALC882) */ | 422 | /* Matrix-mixer style (e.g. ALC882) */ |
430 | unsigned int *cur_val = &spec->cur_mux[adc_idx]; | 423 | unsigned int *cur_val = &spec->cur_mux[adc_idx]; |
431 | unsigned int i, idx; | 424 | unsigned int i, idx; |
@@ -952,12 +945,13 @@ static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, | |||
952 | static void alc_automute_pin(struct hda_codec *codec) | 945 | static void alc_automute_pin(struct hda_codec *codec) |
953 | { | 946 | { |
954 | struct alc_spec *spec = codec->spec; | 947 | struct alc_spec *spec = codec->spec; |
955 | unsigned int present; | 948 | unsigned int present, pincap; |
956 | unsigned int nid = spec->autocfg.hp_pins[0]; | 949 | unsigned int nid = spec->autocfg.hp_pins[0]; |
957 | int i; | 950 | int i; |
958 | 951 | ||
959 | /* need to execute and sync at first */ | 952 | pincap = snd_hda_query_pin_caps(codec, nid); |
960 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | 953 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ |
954 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
961 | present = snd_hda_codec_read(codec, nid, 0, | 955 | present = snd_hda_codec_read(codec, nid, 0, |
962 | AC_VERB_GET_PIN_SENSE, 0); | 956 | AC_VERB_GET_PIN_SENSE, 0); |
963 | spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0; | 957 | spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0; |
@@ -1399,7 +1393,7 @@ static struct hda_verb alc888_fujitsu_xa3530_verbs[] = { | |||
1399 | static void alc_automute_amp(struct hda_codec *codec) | 1393 | static void alc_automute_amp(struct hda_codec *codec) |
1400 | { | 1394 | { |
1401 | struct alc_spec *spec = codec->spec; | 1395 | struct alc_spec *spec = codec->spec; |
1402 | unsigned int val, mute; | 1396 | unsigned int val, mute, pincap; |
1403 | hda_nid_t nid; | 1397 | hda_nid_t nid; |
1404 | int i; | 1398 | int i; |
1405 | 1399 | ||
@@ -1408,6 +1402,10 @@ static void alc_automute_amp(struct hda_codec *codec) | |||
1408 | nid = spec->autocfg.hp_pins[i]; | 1402 | nid = spec->autocfg.hp_pins[i]; |
1409 | if (!nid) | 1403 | if (!nid) |
1410 | break; | 1404 | break; |
1405 | pincap = snd_hda_query_pin_caps(codec, nid); | ||
1406 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1407 | snd_hda_codec_read(codec, nid, 0, | ||
1408 | AC_VERB_SET_PIN_SENSE, 0); | ||
1411 | val = snd_hda_codec_read(codec, nid, 0, | 1409 | val = snd_hda_codec_read(codec, nid, 0, |
1412 | AC_VERB_GET_PIN_SENSE, 0); | 1410 | AC_VERB_GET_PIN_SENSE, 0); |
1413 | if (val & AC_PINSENSE_PRESENCE) { | 1411 | if (val & AC_PINSENSE_PRESENCE) { |
@@ -1478,6 +1476,10 @@ static struct hda_verb alc888_acer_aspire_4930g_verbs[] = { | |||
1478 | static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { | 1476 | static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { |
1479 | /* Bias voltage on for external mic port */ | 1477 | /* Bias voltage on for external mic port */ |
1480 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, | 1478 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, |
1479 | /* Front Mic: set to PIN_IN (empty by default) */ | ||
1480 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
1481 | /* Unselect Front Mic by default in input mixer 3 */ | ||
1482 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)}, | ||
1481 | /* Enable unsolicited event for HP jack */ | 1483 | /* Enable unsolicited event for HP jack */ |
1482 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | 1484 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, |
1483 | /* Enable speaker output */ | 1485 | /* Enable speaker output */ |
@@ -1567,18 +1569,22 @@ static struct hda_input_mux alc888_2_capture_sources[2] = { | |||
1567 | static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = { | 1569 | static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = { |
1568 | /* Interal mic only available on one ADC */ | 1570 | /* Interal mic only available on one ADC */ |
1569 | { | 1571 | { |
1570 | .num_items = 3, | 1572 | .num_items = 5, |
1571 | .items = { | 1573 | .items = { |
1572 | { "Ext Mic", 0x0 }, | 1574 | { "Ext Mic", 0x0 }, |
1575 | { "Line In", 0x2 }, | ||
1573 | { "CD", 0x4 }, | 1576 | { "CD", 0x4 }, |
1577 | { "Input Mix", 0xa }, | ||
1574 | { "Int Mic", 0xb }, | 1578 | { "Int Mic", 0xb }, |
1575 | }, | 1579 | }, |
1576 | }, | 1580 | }, |
1577 | { | 1581 | { |
1578 | .num_items = 2, | 1582 | .num_items = 4, |
1579 | .items = { | 1583 | .items = { |
1580 | { "Ext Mic", 0x0 }, | 1584 | { "Ext Mic", 0x0 }, |
1585 | { "Line In", 0x2 }, | ||
1581 | { "CD", 0x4 }, | 1586 | { "CD", 0x4 }, |
1587 | { "Input Mix", 0xa }, | ||
1582 | }, | 1588 | }, |
1583 | } | 1589 | } |
1584 | }; | 1590 | }; |
@@ -1646,6 +1652,17 @@ static void alc888_acer_aspire_4930g_init_hook(struct hda_codec *codec) | |||
1646 | alc_automute_amp(codec); | 1652 | alc_automute_amp(codec); |
1647 | } | 1653 | } |
1648 | 1654 | ||
1655 | static void alc888_acer_aspire_6530g_init_hook(struct hda_codec *codec) | ||
1656 | { | ||
1657 | struct alc_spec *spec = codec->spec; | ||
1658 | |||
1659 | spec->autocfg.hp_pins[0] = 0x15; | ||
1660 | spec->autocfg.speaker_pins[0] = 0x14; | ||
1661 | spec->autocfg.speaker_pins[1] = 0x16; | ||
1662 | spec->autocfg.speaker_pins[2] = 0x17; | ||
1663 | alc_automute_amp(codec); | ||
1664 | } | ||
1665 | |||
1649 | static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec) | 1666 | static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec) |
1650 | { | 1667 | { |
1651 | struct alc_spec *spec = codec->spec; | 1668 | struct alc_spec *spec = codec->spec; |
@@ -7557,7 +7574,6 @@ static int patch_alc882(struct hda_codec *codec) | |||
7557 | spec->stream_digital_playback = &alc882_pcm_digital_playback; | 7574 | spec->stream_digital_playback = &alc882_pcm_digital_playback; |
7558 | spec->stream_digital_capture = &alc882_pcm_digital_capture; | 7575 | spec->stream_digital_capture = &alc882_pcm_digital_capture; |
7559 | 7576 | ||
7560 | spec->capture_style = CAPT_MIX; /* matrix-style capture */ | ||
7561 | if (!spec->adc_nids && spec->input_mux) { | 7577 | if (!spec->adc_nids && spec->input_mux) { |
7562 | /* check whether NID 0x07 is valid */ | 7578 | /* check whether NID 0x07 is valid */ |
7563 | unsigned int wcap = get_wcaps(codec, 0x07); | 7579 | unsigned int wcap = get_wcaps(codec, 0x07); |
@@ -8197,6 +8213,8 @@ static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = { | |||
8197 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | 8213 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), |
8198 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT), | 8214 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT), |
8199 | HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT), | 8215 | HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT), |
8216 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
8217 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
8200 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | 8218 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), |
8201 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | 8219 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), |
8202 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | 8220 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), |
@@ -9072,7 +9090,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
9072 | SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO), | 9090 | SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO), |
9073 | SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO), | 9091 | SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO), |
9074 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", | 9092 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
9075 | ALC888_ACER_ASPIRE_4930G), | 9093 | ALC888_ACER_ASPIRE_6530G), |
9076 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", | 9094 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
9077 | ALC888_ACER_ASPIRE_6530G), | 9095 | ALC888_ACER_ASPIRE_6530G), |
9078 | /* default Acer -- disabled as it causes more problems. | 9096 | /* default Acer -- disabled as it causes more problems. |
@@ -9325,7 +9343,7 @@ static struct alc_config_preset alc883_presets[] = { | |||
9325 | ARRAY_SIZE(alc888_2_capture_sources), | 9343 | ARRAY_SIZE(alc888_2_capture_sources), |
9326 | .input_mux = alc888_acer_aspire_6530_sources, | 9344 | .input_mux = alc888_acer_aspire_6530_sources, |
9327 | .unsol_event = alc_automute_amp_unsol_event, | 9345 | .unsol_event = alc_automute_amp_unsol_event, |
9328 | .init_hook = alc888_acer_aspire_4930g_init_hook, | 9346 | .init_hook = alc888_acer_aspire_6530g_init_hook, |
9329 | }, | 9347 | }, |
9330 | [ALC888_ACER_ASPIRE_8930G] = { | 9348 | [ALC888_ACER_ASPIRE_8930G] = { |
9331 | .mixers = { alc888_base_mixer, | 9349 | .mixers = { alc888_base_mixer, |
@@ -9781,7 +9799,6 @@ static int patch_alc883(struct hda_codec *codec) | |||
9781 | } | 9799 | } |
9782 | if (!spec->capsrc_nids) | 9800 | if (!spec->capsrc_nids) |
9783 | spec->capsrc_nids = alc883_capsrc_nids; | 9801 | spec->capsrc_nids = alc883_capsrc_nids; |
9784 | spec->capture_style = CAPT_MIX; /* matrix-style capture */ | ||
9785 | spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ | 9802 | spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ |
9786 | break; | 9803 | break; |
9787 | case 0x10ec0889: | 9804 | case 0x10ec0889: |
@@ -9791,8 +9808,6 @@ static int patch_alc883(struct hda_codec *codec) | |||
9791 | } | 9808 | } |
9792 | if (!spec->capsrc_nids) | 9809 | if (!spec->capsrc_nids) |
9793 | spec->capsrc_nids = alc889_capsrc_nids; | 9810 | spec->capsrc_nids = alc889_capsrc_nids; |
9794 | spec->capture_style = CAPT_1MUX_MIX; /* 1mux/Nmix-style | ||
9795 | capture */ | ||
9796 | break; | 9811 | break; |
9797 | default: | 9812 | default: |
9798 | if (!spec->num_adc_nids) { | 9813 | if (!spec->num_adc_nids) { |
@@ -9801,7 +9816,6 @@ static int patch_alc883(struct hda_codec *codec) | |||
9801 | } | 9816 | } |
9802 | if (!spec->capsrc_nids) | 9817 | if (!spec->capsrc_nids) |
9803 | spec->capsrc_nids = alc883_capsrc_nids; | 9818 | spec->capsrc_nids = alc883_capsrc_nids; |
9804 | spec->capture_style = CAPT_MIX; /* matrix-style capture */ | ||
9805 | break; | 9819 | break; |
9806 | } | 9820 | } |
9807 | 9821 | ||
@@ -10913,9 +10927,27 @@ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
10913 | return 0; | 10927 | return 0; |
10914 | } | 10928 | } |
10915 | 10929 | ||
10916 | /* identical with ALC880 */ | 10930 | static int alc262_auto_create_analog_input_ctls(struct alc_spec *spec, |
10917 | #define alc262_auto_create_analog_input_ctls \ | 10931 | const struct auto_pin_cfg *cfg) |
10918 | alc880_auto_create_analog_input_ctls | 10932 | { |
10933 | int err; | ||
10934 | |||
10935 | err = alc880_auto_create_analog_input_ctls(spec, cfg); | ||
10936 | if (err < 0) | ||
10937 | return err; | ||
10938 | /* digital-mic input pin is excluded in alc880_auto_create..() | ||
10939 | * because it's under 0x18 | ||
10940 | */ | ||
10941 | if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 || | ||
10942 | cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) { | ||
10943 | struct hda_input_mux *imux = &spec->private_imux[0]; | ||
10944 | imux->items[imux->num_items].label = "Int Mic"; | ||
10945 | imux->items[imux->num_items].index = 0x09; | ||
10946 | imux->num_items++; | ||
10947 | } | ||
10948 | return 0; | ||
10949 | } | ||
10950 | |||
10919 | 10951 | ||
10920 | /* | 10952 | /* |
10921 | * generic initialization of ADC, input mixers and output mixers | 10953 | * generic initialization of ADC, input mixers and output mixers |
@@ -11332,6 +11364,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
11332 | SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO), | 11364 | SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO), |
11333 | SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), | 11365 | SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), |
11334 | SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ | 11366 | SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ |
11367 | SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06), | ||
11335 | SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO", | 11368 | SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO", |
11336 | ALC262_SONY_ASSAMD), | 11369 | ALC262_SONY_ASSAMD), |
11337 | SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", | 11370 | SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", |
@@ -11539,6 +11572,7 @@ static struct alc_config_preset alc262_presets[] = { | |||
11539 | .capsrc_nids = alc262_dmic_capsrc_nids, | 11572 | .capsrc_nids = alc262_dmic_capsrc_nids, |
11540 | .dac_nids = alc262_dac_nids, | 11573 | .dac_nids = alc262_dac_nids, |
11541 | .adc_nids = alc262_dmic_adc_nids, /* ADC0 */ | 11574 | .adc_nids = alc262_dmic_adc_nids, /* ADC0 */ |
11575 | .num_adc_nids = 1, /* single ADC */ | ||
11542 | .dig_out_nid = ALC262_DIGOUT_NID, | 11576 | .dig_out_nid = ALC262_DIGOUT_NID, |
11543 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | 11577 | .num_channel_mode = ARRAY_SIZE(alc262_modes), |
11544 | .channel_mode = alc262_modes, | 11578 | .channel_mode = alc262_modes, |
@@ -11640,21 +11674,36 @@ static int patch_alc262(struct hda_codec *codec) | |||
11640 | spec->stream_digital_playback = &alc262_pcm_digital_playback; | 11674 | spec->stream_digital_playback = &alc262_pcm_digital_playback; |
11641 | spec->stream_digital_capture = &alc262_pcm_digital_capture; | 11675 | spec->stream_digital_capture = &alc262_pcm_digital_capture; |
11642 | 11676 | ||
11643 | spec->capture_style = CAPT_MIX; | ||
11644 | if (!spec->adc_nids && spec->input_mux) { | 11677 | if (!spec->adc_nids && spec->input_mux) { |
11645 | /* check whether NID 0x07 is valid */ | 11678 | int i; |
11646 | unsigned int wcap = get_wcaps(codec, 0x07); | 11679 | /* check whether the digital-mic has to be supported */ |
11647 | 11680 | for (i = 0; i < spec->input_mux->num_items; i++) { | |
11648 | /* get type */ | 11681 | if (spec->input_mux->items[i].index >= 9) |
11649 | wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | 11682 | break; |
11650 | if (wcap != AC_WID_AUD_IN) { | 11683 | } |
11651 | spec->adc_nids = alc262_adc_nids_alt; | 11684 | if (i < spec->input_mux->num_items) { |
11652 | spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt); | 11685 | /* use only ADC0 */ |
11653 | spec->capsrc_nids = alc262_capsrc_nids_alt; | 11686 | spec->adc_nids = alc262_dmic_adc_nids; |
11687 | spec->num_adc_nids = 1; | ||
11688 | spec->capsrc_nids = alc262_dmic_capsrc_nids; | ||
11654 | } else { | 11689 | } else { |
11655 | spec->adc_nids = alc262_adc_nids; | 11690 | /* all analog inputs */ |
11656 | spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids); | 11691 | /* check whether NID 0x07 is valid */ |
11657 | spec->capsrc_nids = alc262_capsrc_nids; | 11692 | unsigned int wcap = get_wcaps(codec, 0x07); |
11693 | |||
11694 | /* get type */ | ||
11695 | wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | ||
11696 | if (wcap != AC_WID_AUD_IN) { | ||
11697 | spec->adc_nids = alc262_adc_nids_alt; | ||
11698 | spec->num_adc_nids = | ||
11699 | ARRAY_SIZE(alc262_adc_nids_alt); | ||
11700 | spec->capsrc_nids = alc262_capsrc_nids_alt; | ||
11701 | } else { | ||
11702 | spec->adc_nids = alc262_adc_nids; | ||
11703 | spec->num_adc_nids = | ||
11704 | ARRAY_SIZE(alc262_adc_nids); | ||
11705 | spec->capsrc_nids = alc262_capsrc_nids; | ||
11706 | } | ||
11658 | } | 11707 | } |
11659 | } | 11708 | } |
11660 | if (!spec->cap_mixer && !spec->no_analog) | 11709 | if (!spec->cap_mixer && !spec->no_analog) |
@@ -12414,6 +12463,8 @@ static int alc268_parse_auto_config(struct hda_codec *codec) | |||
12414 | if (err < 0) | 12463 | if (err < 0) |
12415 | return err; | 12464 | return err; |
12416 | 12465 | ||
12466 | alc_ssid_check(codec, 0x15, 0x1b, 0x14); | ||
12467 | |||
12417 | return 1; | 12468 | return 1; |
12418 | } | 12469 | } |
12419 | 12470 | ||
@@ -13244,26 +13295,8 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
13244 | return 0; | 13295 | return 0; |
13245 | } | 13296 | } |
13246 | 13297 | ||
13247 | static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec, | 13298 | #define alc269_auto_create_analog_input_ctls \ |
13248 | const struct auto_pin_cfg *cfg) | 13299 | alc262_auto_create_analog_input_ctls |
13249 | { | ||
13250 | int err; | ||
13251 | |||
13252 | err = alc880_auto_create_analog_input_ctls(spec, cfg); | ||
13253 | if (err < 0) | ||
13254 | return err; | ||
13255 | /* digital-mic input pin is excluded in alc880_auto_create..() | ||
13256 | * because it's under 0x18 | ||
13257 | */ | ||
13258 | if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 || | ||
13259 | cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) { | ||
13260 | struct hda_input_mux *imux = &spec->private_imux[0]; | ||
13261 | imux->items[imux->num_items].label = "Int Mic"; | ||
13262 | imux->items[imux->num_items].index = 0x05; | ||
13263 | imux->num_items++; | ||
13264 | } | ||
13265 | return 0; | ||
13266 | } | ||
13267 | 13300 | ||
13268 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 13301 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
13269 | #define alc269_loopbacks alc880_loopbacks | 13302 | #define alc269_loopbacks alc880_loopbacks |
@@ -13340,6 +13373,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
13340 | if (!spec->cap_mixer && !spec->no_analog) | 13373 | if (!spec->cap_mixer && !spec->no_analog) |
13341 | set_capture_mixer(spec); | 13374 | set_capture_mixer(spec); |
13342 | 13375 | ||
13376 | alc_ssid_check(codec, 0x15, 0x1b, 0x14); | ||
13377 | |||
13343 | return 1; | 13378 | return 1; |
13344 | } | 13379 | } |
13345 | 13380 | ||
@@ -15554,7 +15589,6 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
15554 | spec->adc_nids = alc861vd_adc_nids; | 15589 | spec->adc_nids = alc861vd_adc_nids; |
15555 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); | 15590 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); |
15556 | spec->capsrc_nids = alc861vd_capsrc_nids; | 15591 | spec->capsrc_nids = alc861vd_capsrc_nids; |
15557 | spec->capture_style = CAPT_MIX; | ||
15558 | 15592 | ||
15559 | set_capture_mixer(spec); | 15593 | set_capture_mixer(spec); |
15560 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 15594 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
@@ -17474,7 +17508,6 @@ static int patch_alc662(struct hda_codec *codec) | |||
17474 | spec->adc_nids = alc662_adc_nids; | 17508 | spec->adc_nids = alc662_adc_nids; |
17475 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); | 17509 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); |
17476 | spec->capsrc_nids = alc662_capsrc_nids; | 17510 | spec->capsrc_nids = alc662_capsrc_nids; |
17477 | spec->capture_style = CAPT_MIX; | ||
17478 | 17511 | ||
17479 | if (!spec->cap_mixer) | 17512 | if (!spec->cap_mixer) |
17480 | set_capture_mixer(spec); | 17513 | set_capture_mixer(spec); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 93e47c96a38b..14f3c3e0f62d 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -639,7 +639,7 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol, | |||
639 | static unsigned int stac92xx_vref_set(struct hda_codec *codec, | 639 | static unsigned int stac92xx_vref_set(struct hda_codec *codec, |
640 | hda_nid_t nid, unsigned int new_vref) | 640 | hda_nid_t nid, unsigned int new_vref) |
641 | { | 641 | { |
642 | unsigned int error; | 642 | int error; |
643 | unsigned int pincfg; | 643 | unsigned int pincfg; |
644 | pincfg = snd_hda_codec_read(codec, nid, 0, | 644 | pincfg = snd_hda_codec_read(codec, nid, 0, |
645 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | 645 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); |
@@ -2703,7 +2703,7 @@ static int stac92xx_dc_bias_put(struct snd_kcontrol *kcontrol, | |||
2703 | { | 2703 | { |
2704 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2704 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2705 | unsigned int new_vref = 0; | 2705 | unsigned int new_vref = 0; |
2706 | unsigned int error; | 2706 | int error; |
2707 | hda_nid_t nid = kcontrol->private_value; | 2707 | hda_nid_t nid = kcontrol->private_value; |
2708 | 2708 | ||
2709 | if (ucontrol->value.enumerated.item[0] == 0) | 2709 | if (ucontrol->value.enumerated.item[0] == 0) |
@@ -4035,7 +4035,7 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, | |||
4035 | AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */ | 4035 | AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */ |
4036 | } | 4036 | } |
4037 | 4037 | ||
4038 | #ifdef CONFIG_SND_JACK | 4038 | #ifdef CONFIG_SND_HDA_INPUT_JACK |
4039 | static void stac92xx_free_jack_priv(struct snd_jack *jack) | 4039 | static void stac92xx_free_jack_priv(struct snd_jack *jack) |
4040 | { | 4040 | { |
4041 | struct sigmatel_jack *jacks = jack->private_data; | 4041 | struct sigmatel_jack *jacks = jack->private_data; |
@@ -4047,7 +4047,7 @@ static void stac92xx_free_jack_priv(struct snd_jack *jack) | |||
4047 | static int stac92xx_add_jack(struct hda_codec *codec, | 4047 | static int stac92xx_add_jack(struct hda_codec *codec, |
4048 | hda_nid_t nid, int type) | 4048 | hda_nid_t nid, int type) |
4049 | { | 4049 | { |
4050 | #ifdef CONFIG_SND_JACK | 4050 | #ifdef CONFIG_SND_HDA_INPUT_JACK |
4051 | struct sigmatel_spec *spec = codec->spec; | 4051 | struct sigmatel_spec *spec = codec->spec; |
4052 | struct sigmatel_jack *jack; | 4052 | struct sigmatel_jack *jack; |
4053 | int def_conf = snd_hda_codec_get_pincfg(codec, nid); | 4053 | int def_conf = snd_hda_codec_get_pincfg(codec, nid); |
@@ -4336,7 +4336,7 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4336 | 4336 | ||
4337 | static void stac92xx_free_jacks(struct hda_codec *codec) | 4337 | static void stac92xx_free_jacks(struct hda_codec *codec) |
4338 | { | 4338 | { |
4339 | #ifdef CONFIG_SND_JACK | 4339 | #ifdef CONFIG_SND_HDA_INPUT_JACK |
4340 | /* free jack instances manually when clearing/reconfiguring */ | 4340 | /* free jack instances manually when clearing/reconfiguring */ |
4341 | struct sigmatel_spec *spec = codec->spec; | 4341 | struct sigmatel_spec *spec = codec->spec; |
4342 | if (!codec->bus->shutdown && spec->jacks.list) { | 4342 | if (!codec->bus->shutdown && spec->jacks.list) { |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 0d0cdbdb4486..cecf1ffeeaaa 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -107,7 +107,7 @@ MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); | |||
107 | 107 | ||
108 | 108 | ||
109 | static const struct pci_device_id snd_ice1712_ids[] = { | 109 | static const struct pci_device_id snd_ice1712_ids[] = { |
110 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ | 110 | { PCI_VDEVICE(ICE, PCI_DEVICE_ID_ICE_1712), 0 }, /* ICE1712 */ |
111 | { 0, } | 111 | { 0, } |
112 | }; | 112 | }; |
113 | 113 | ||
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 36ade77cf371..cc84a831eb21 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -93,7 +93,7 @@ MODULE_PARM_DESC(model, "Use the given board model."); | |||
93 | 93 | ||
94 | /* Both VT1720 and VT1724 have the same PCI IDs */ | 94 | /* Both VT1720 and VT1724 have the same PCI IDs */ |
95 | static const struct pci_device_id snd_vt1724_ids[] = { | 95 | static const struct pci_device_id snd_vt1724_ids[] = { |
96 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 96 | { PCI_VDEVICE(ICE, PCI_DEVICE_ID_VT1724), 0 }, |
97 | { 0, } | 97 | { 0, } |
98 | }; | 98 | }; |
99 | 99 | ||
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 8aa5687f392a..171ada535209 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -421,29 +421,29 @@ struct intel8x0 { | |||
421 | }; | 421 | }; |
422 | 422 | ||
423 | static struct pci_device_id snd_intel8x0_ids[] = { | 423 | static struct pci_device_id snd_intel8x0_ids[] = { |
424 | { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ | 424 | { PCI_VDEVICE(INTEL, 0x2415), DEVICE_INTEL }, /* 82801AA */ |
425 | { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ | 425 | { PCI_VDEVICE(INTEL, 0x2425), DEVICE_INTEL }, /* 82901AB */ |
426 | { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ | 426 | { PCI_VDEVICE(INTEL, 0x2445), DEVICE_INTEL }, /* 82801BA */ |
427 | { 0x8086, 0x2485, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH3 */ | 427 | { PCI_VDEVICE(INTEL, 0x2485), DEVICE_INTEL }, /* ICH3 */ |
428 | { 0x8086, 0x24c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH4 */ | 428 | { PCI_VDEVICE(INTEL, 0x24c5), DEVICE_INTEL_ICH4 }, /* ICH4 */ |
429 | { 0x8086, 0x24d5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH5 */ | 429 | { PCI_VDEVICE(INTEL, 0x24d5), DEVICE_INTEL_ICH4 }, /* ICH5 */ |
430 | { 0x8086, 0x25a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ESB */ | 430 | { PCI_VDEVICE(INTEL, 0x25a6), DEVICE_INTEL_ICH4 }, /* ESB */ |
431 | { 0x8086, 0x266e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH6 */ | 431 | { PCI_VDEVICE(INTEL, 0x266e), DEVICE_INTEL_ICH4 }, /* ICH6 */ |
432 | { 0x8086, 0x27de, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH7 */ | 432 | { PCI_VDEVICE(INTEL, 0x27de), DEVICE_INTEL_ICH4 }, /* ICH7 */ |
433 | { 0x8086, 0x2698, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ESB2 */ | 433 | { PCI_VDEVICE(INTEL, 0x2698), DEVICE_INTEL_ICH4 }, /* ESB2 */ |
434 | { 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */ | 434 | { PCI_VDEVICE(INTEL, 0x7195), DEVICE_INTEL }, /* 440MX */ |
435 | { 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7012 */ | 435 | { PCI_VDEVICE(SI, 0x7012), DEVICE_SIS }, /* SI7012 */ |
436 | { 0x10de, 0x01b1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE */ | 436 | { PCI_VDEVICE(NVIDIA, 0x01b1), DEVICE_NFORCE }, /* NFORCE */ |
437 | { 0x10de, 0x003a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* MCP04 */ | 437 | { PCI_VDEVICE(NVIDIA, 0x003a), DEVICE_NFORCE }, /* MCP04 */ |
438 | { 0x10de, 0x006a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2 */ | 438 | { PCI_VDEVICE(NVIDIA, 0x006a), DEVICE_NFORCE }, /* NFORCE2 */ |
439 | { 0x10de, 0x0059, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK804 */ | 439 | { PCI_VDEVICE(NVIDIA, 0x0059), DEVICE_NFORCE }, /* CK804 */ |
440 | { 0x10de, 0x008a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK8 */ | 440 | { PCI_VDEVICE(NVIDIA, 0x008a), DEVICE_NFORCE }, /* CK8 */ |
441 | { 0x10de, 0x00da, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE3 */ | 441 | { PCI_VDEVICE(NVIDIA, 0x00da), DEVICE_NFORCE }, /* NFORCE3 */ |
442 | { 0x10de, 0x00ea, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK8S */ | 442 | { PCI_VDEVICE(NVIDIA, 0x00ea), DEVICE_NFORCE }, /* CK8S */ |
443 | { 0x10de, 0x026b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* MCP51 */ | 443 | { PCI_VDEVICE(NVIDIA, 0x026b), DEVICE_NFORCE }, /* MCP51 */ |
444 | { 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */ | 444 | { PCI_VDEVICE(AMD, 0x746d), DEVICE_INTEL }, /* AMD8111 */ |
445 | { 0x1022, 0x7445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */ | 445 | { PCI_VDEVICE(AMD, 0x7445), DEVICE_INTEL }, /* AMD768 */ |
446 | { 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */ | 446 | { PCI_VDEVICE(AL, 0x5455), DEVICE_ALI }, /* Ali5455 */ |
447 | { 0, } | 447 | { 0, } |
448 | }; | 448 | }; |
449 | 449 | ||
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 6ec0fc50d6be..9e7d12e7673f 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -220,24 +220,24 @@ struct intel8x0m { | |||
220 | }; | 220 | }; |
221 | 221 | ||
222 | static struct pci_device_id snd_intel8x0m_ids[] = { | 222 | static struct pci_device_id snd_intel8x0m_ids[] = { |
223 | { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ | 223 | { PCI_VDEVICE(INTEL, 0x2416), DEVICE_INTEL }, /* 82801AA */ |
224 | { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ | 224 | { PCI_VDEVICE(INTEL, 0x2426), DEVICE_INTEL }, /* 82901AB */ |
225 | { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ | 225 | { PCI_VDEVICE(INTEL, 0x2446), DEVICE_INTEL }, /* 82801BA */ |
226 | { 0x8086, 0x2486, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH3 */ | 226 | { PCI_VDEVICE(INTEL, 0x2486), DEVICE_INTEL }, /* ICH3 */ |
227 | { 0x8086, 0x24c6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH4 */ | 227 | { PCI_VDEVICE(INTEL, 0x24c6), DEVICE_INTEL }, /* ICH4 */ |
228 | { 0x8086, 0x24d6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH5 */ | 228 | { PCI_VDEVICE(INTEL, 0x24d6), DEVICE_INTEL }, /* ICH5 */ |
229 | { 0x8086, 0x266d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH6 */ | 229 | { PCI_VDEVICE(INTEL, 0x266d), DEVICE_INTEL }, /* ICH6 */ |
230 | { 0x8086, 0x27dd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH7 */ | 230 | { PCI_VDEVICE(INTEL, 0x27dd), DEVICE_INTEL }, /* ICH7 */ |
231 | { 0x8086, 0x7196, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */ | 231 | { PCI_VDEVICE(INTEL, 0x7196), DEVICE_INTEL }, /* 440MX */ |
232 | { 0x1022, 0x7446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */ | 232 | { PCI_VDEVICE(AMD, 0x7446), DEVICE_INTEL }, /* AMD768 */ |
233 | { 0x1039, 0x7013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7013 */ | 233 | { PCI_VDEVICE(SI, 0x7013), DEVICE_SIS }, /* SI7013 */ |
234 | { 0x10de, 0x01c1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE */ | 234 | { PCI_VDEVICE(NVIDIA, 0x01c1), DEVICE_NFORCE }, /* NFORCE */ |
235 | { 0x10de, 0x0069, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2 */ | 235 | { PCI_VDEVICE(NVIDIA, 0x0069), DEVICE_NFORCE }, /* NFORCE2 */ |
236 | { 0x10de, 0x0089, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2s */ | 236 | { PCI_VDEVICE(NVIDIA, 0x0089), DEVICE_NFORCE }, /* NFORCE2s */ |
237 | { 0x10de, 0x00d9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE3 */ | 237 | { PCI_VDEVICE(NVIDIA, 0x00d9), DEVICE_NFORCE }, /* NFORCE3 */ |
238 | #if 0 | 238 | #if 0 |
239 | { 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */ | 239 | { PCI_VDEVICE(AMD, 0x746d), DEVICE_INTEL }, /* AMD8111 */ |
240 | { 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */ | 240 | { PCI_VDEVICE(AL, 0x5455), DEVICE_ALI }, /* Ali5455 */ |
241 | #endif | 241 | #endif |
242 | { 0, } | 242 | { 0, } |
243 | }; | 243 | }; |
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 18da2ef04d09..11b8c6514b3d 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c | |||
@@ -654,13 +654,12 @@ static int __devinit lx_init_ethersound_config(struct lx6464es *chip) | |||
654 | int i; | 654 | int i; |
655 | u32 orig_conf_es = lx_dsp_reg_read(chip, eReg_CONFES); | 655 | u32 orig_conf_es = lx_dsp_reg_read(chip, eReg_CONFES); |
656 | 656 | ||
657 | u32 default_conf_es = (64 << IOCR_OUTPUTS_OFFSET) | | 657 | /* configure 64 io channels */ |
658 | u32 conf_es = (orig_conf_es & CONFES_READ_PART_MASK) | | ||
658 | (64 << IOCR_INPUTS_OFFSET) | | 659 | (64 << IOCR_INPUTS_OFFSET) | |
660 | (64 << IOCR_OUTPUTS_OFFSET) | | ||
659 | (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET); | 661 | (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET); |
660 | 662 | ||
661 | u32 conf_es = (orig_conf_es & CONFES_READ_PART_MASK) | ||
662 | | (default_conf_es & CONFES_WRITE_PART_MASK); | ||
663 | |||
664 | snd_printdd("->lx_init_ethersound\n"); | 663 | snd_printdd("->lx_init_ethersound\n"); |
665 | 664 | ||
666 | chip->freq_ratio = FREQ_RATIO_SINGLE_MODE; | 665 | chip->freq_ratio = FREQ_RATIO_SINGLE_MODE; |
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 82bc5b9e7629..a83d1968a845 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -61,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard."); | |||
61 | */ | 61 | */ |
62 | 62 | ||
63 | static struct pci_device_id snd_mixart_ids[] = { | 63 | static struct pci_device_id snd_mixart_ids[] = { |
64 | { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */ | 64 | { PCI_VDEVICE(MOTOROLA, 0x0003), 0, }, /* MC8240 */ |
65 | { 0, } | 65 | { 0, } |
66 | }; | 66 | }; |
67 | 67 | ||
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 522a040855d4..97a0731331a1 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c | |||
@@ -263,9 +263,9 @@ struct nm256 { | |||
263 | * PCI ids | 263 | * PCI ids |
264 | */ | 264 | */ |
265 | static struct pci_device_id snd_nm256_ids[] = { | 265 | static struct pci_device_id snd_nm256_ids[] = { |
266 | {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 266 | {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO), 0}, |
267 | {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 267 | {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO), 0}, |
268 | {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 268 | {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO), 0}, |
269 | {0,}, | 269 | {0,}, |
270 | }; | 270 | }; |
271 | 271 | ||
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 304da169bfdc..5401c547c4e3 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -575,8 +575,10 @@ static int ac97_switch_put(struct snd_kcontrol *ctl, | |||
575 | static int ac97_volume_info(struct snd_kcontrol *ctl, | 575 | static int ac97_volume_info(struct snd_kcontrol *ctl, |
576 | struct snd_ctl_elem_info *info) | 576 | struct snd_ctl_elem_info *info) |
577 | { | 577 | { |
578 | int stereo = (ctl->private_value >> 16) & 1; | ||
579 | |||
578 | info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 580 | info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
579 | info->count = 2; | 581 | info->count = stereo ? 2 : 1; |
580 | info->value.integer.min = 0; | 582 | info->value.integer.min = 0; |
581 | info->value.integer.max = 0x1f; | 583 | info->value.integer.max = 0x1f; |
582 | return 0; | 584 | return 0; |
@@ -587,6 +589,7 @@ static int ac97_volume_get(struct snd_kcontrol *ctl, | |||
587 | { | 589 | { |
588 | struct oxygen *chip = ctl->private_data; | 590 | struct oxygen *chip = ctl->private_data; |
589 | unsigned int codec = (ctl->private_value >> 24) & 1; | 591 | unsigned int codec = (ctl->private_value >> 24) & 1; |
592 | int stereo = (ctl->private_value >> 16) & 1; | ||
590 | unsigned int index = ctl->private_value & 0xff; | 593 | unsigned int index = ctl->private_value & 0xff; |
591 | u16 reg; | 594 | u16 reg; |
592 | 595 | ||
@@ -594,7 +597,8 @@ static int ac97_volume_get(struct snd_kcontrol *ctl, | |||
594 | reg = oxygen_read_ac97(chip, codec, index); | 597 | reg = oxygen_read_ac97(chip, codec, index); |
595 | mutex_unlock(&chip->mutex); | 598 | mutex_unlock(&chip->mutex); |
596 | value->value.integer.value[0] = 31 - (reg & 0x1f); | 599 | value->value.integer.value[0] = 31 - (reg & 0x1f); |
597 | value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f); | 600 | if (stereo) |
601 | value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f); | ||
598 | return 0; | 602 | return 0; |
599 | } | 603 | } |
600 | 604 | ||
@@ -603,6 +607,7 @@ static int ac97_volume_put(struct snd_kcontrol *ctl, | |||
603 | { | 607 | { |
604 | struct oxygen *chip = ctl->private_data; | 608 | struct oxygen *chip = ctl->private_data; |
605 | unsigned int codec = (ctl->private_value >> 24) & 1; | 609 | unsigned int codec = (ctl->private_value >> 24) & 1; |
610 | int stereo = (ctl->private_value >> 16) & 1; | ||
606 | unsigned int index = ctl->private_value & 0xff; | 611 | unsigned int index = ctl->private_value & 0xff; |
607 | u16 oldreg, newreg; | 612 | u16 oldreg, newreg; |
608 | int change; | 613 | int change; |
@@ -612,8 +617,11 @@ static int ac97_volume_put(struct snd_kcontrol *ctl, | |||
612 | newreg = oldreg; | 617 | newreg = oldreg; |
613 | newreg = (newreg & ~0x1f) | | 618 | newreg = (newreg & ~0x1f) | |
614 | (31 - (value->value.integer.value[0] & 0x1f)); | 619 | (31 - (value->value.integer.value[0] & 0x1f)); |
615 | newreg = (newreg & ~0x1f00) | | 620 | if (stereo) |
616 | ((31 - (value->value.integer.value[0] & 0x1f)) << 8); | 621 | newreg = (newreg & ~0x1f00) | |
622 | ((31 - (value->value.integer.value[1] & 0x1f)) << 8); | ||
623 | else | ||
624 | newreg = (newreg & ~0x1f00) | ((newreg & 0x1f) << 8); | ||
617 | change = newreg != oldreg; | 625 | change = newreg != oldreg; |
618 | if (change) | 626 | if (change) |
619 | oxygen_write_ac97(chip, codec, index, newreg); | 627 | oxygen_write_ac97(chip, codec, index, newreg); |
@@ -673,7 +681,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl, | |||
673 | .private_value = ((codec) << 24) | ((invert) << 16) | \ | 681 | .private_value = ((codec) << 24) | ((invert) << 16) | \ |
674 | ((bitnr) << 8) | (index), \ | 682 | ((bitnr) << 8) | (index), \ |
675 | } | 683 | } |
676 | #define AC97_VOLUME(xname, codec, index) { \ | 684 | #define AC97_VOLUME(xname, codec, index, stereo) { \ |
677 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 685 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
678 | .name = xname, \ | 686 | .name = xname, \ |
679 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ | 687 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ |
@@ -682,7 +690,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl, | |||
682 | .get = ac97_volume_get, \ | 690 | .get = ac97_volume_get, \ |
683 | .put = ac97_volume_put, \ | 691 | .put = ac97_volume_put, \ |
684 | .tlv = { .p = ac97_db_scale, }, \ | 692 | .tlv = { .p = ac97_db_scale, }, \ |
685 | .private_value = ((codec) << 24) | (index), \ | 693 | .private_value = ((codec) << 24) | ((stereo) << 16) | (index), \ |
686 | } | 694 | } |
687 | 695 | ||
688 | static DECLARE_TLV_DB_SCALE(monitor_db_scale, -1000, 1000, 0); | 696 | static DECLARE_TLV_DB_SCALE(monitor_db_scale, -1000, 1000, 0); |
@@ -882,18 +890,18 @@ static const struct { | |||
882 | }; | 890 | }; |
883 | 891 | ||
884 | static const struct snd_kcontrol_new ac97_controls[] = { | 892 | static const struct snd_kcontrol_new ac97_controls[] = { |
885 | AC97_VOLUME("Mic Capture Volume", 0, AC97_MIC), | 893 | AC97_VOLUME("Mic Capture Volume", 0, AC97_MIC, 0), |
886 | AC97_SWITCH("Mic Capture Switch", 0, AC97_MIC, 15, 1), | 894 | AC97_SWITCH("Mic Capture Switch", 0, AC97_MIC, 15, 1), |
887 | AC97_SWITCH("Mic Boost (+20dB)", 0, AC97_MIC, 6, 0), | 895 | AC97_SWITCH("Mic Boost (+20dB)", 0, AC97_MIC, 6, 0), |
888 | AC97_SWITCH("Line Capture Switch", 0, AC97_LINE, 15, 1), | 896 | AC97_SWITCH("Line Capture Switch", 0, AC97_LINE, 15, 1), |
889 | AC97_VOLUME("CD Capture Volume", 0, AC97_CD), | 897 | AC97_VOLUME("CD Capture Volume", 0, AC97_CD, 1), |
890 | AC97_SWITCH("CD Capture Switch", 0, AC97_CD, 15, 1), | 898 | AC97_SWITCH("CD Capture Switch", 0, AC97_CD, 15, 1), |
891 | AC97_VOLUME("Aux Capture Volume", 0, AC97_AUX), | 899 | AC97_VOLUME("Aux Capture Volume", 0, AC97_AUX, 1), |
892 | AC97_SWITCH("Aux Capture Switch", 0, AC97_AUX, 15, 1), | 900 | AC97_SWITCH("Aux Capture Switch", 0, AC97_AUX, 15, 1), |
893 | }; | 901 | }; |
894 | 902 | ||
895 | static const struct snd_kcontrol_new ac97_fp_controls[] = { | 903 | static const struct snd_kcontrol_new ac97_fp_controls[] = { |
896 | AC97_VOLUME("Front Panel Playback Volume", 1, AC97_HEADPHONE), | 904 | AC97_VOLUME("Front Panel Playback Volume", 1, AC97_HEADPHONE, 1), |
897 | AC97_SWITCH("Front Panel Playback Switch", 1, AC97_HEADPHONE, 15, 1), | 905 | AC97_SWITCH("Front Panel Playback Switch", 1, AC97_HEADPHONE, 15, 1), |
898 | { | 906 | { |
899 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 907 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index d7b966e7c4cf..f977dba7cbd0 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c | |||
@@ -227,12 +227,9 @@ struct rme32 { | |||
227 | }; | 227 | }; |
228 | 228 | ||
229 | static struct pci_device_id snd_rme32_ids[] = { | 229 | static struct pci_device_id snd_rme32_ids[] = { |
230 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, | 230 | {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32), 0,}, |
231 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | 231 | {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8), 0,}, |
232 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, | 232 | {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_PRO), 0,}, |
233 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | ||
234 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_PRO, | ||
235 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | ||
236 | {0,} | 233 | {0,} |
237 | }; | 234 | }; |
238 | 235 | ||
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index 55fb1c131f58..2ba5c0fd55db 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c | |||
@@ -232,14 +232,10 @@ struct rme96 { | |||
232 | }; | 232 | }; |
233 | 233 | ||
234 | static struct pci_device_id snd_rme96_ids[] = { | 234 | static struct pci_device_id snd_rme96_ids[] = { |
235 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, | 235 | { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96), 0, }, |
236 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 236 | { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8), 0, }, |
237 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, | 237 | { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO), 0, }, |
238 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 238 | { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST), 0, }, |
239 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO, | ||
240 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | ||
241 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST, | ||
242 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | ||
243 | { 0, } | 239 | { 0, } |
244 | }; | 240 | }; |
245 | 241 | ||
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index 7dc60ad4772e..1f6406c4534d 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c | |||
@@ -243,7 +243,7 @@ struct sonicvibes { | |||
243 | }; | 243 | }; |
244 | 244 | ||
245 | static struct pci_device_id snd_sonic_ids[] = { | 245 | static struct pci_device_id snd_sonic_ids[] = { |
246 | { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 246 | { PCI_VDEVICE(S3, 0xca00), 0, }, |
247 | { 0, } | 247 | { 0, } |
248 | }; | 248 | }; |
249 | 249 | ||
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 1ef58c51c213..acfa4760da49 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -85,6 +85,7 @@ static int joystick; | |||
85 | static int ac97_clock = 48000; | 85 | static int ac97_clock = 48000; |
86 | static char *ac97_quirk; | 86 | static char *ac97_quirk; |
87 | static int dxs_support; | 87 | static int dxs_support; |
88 | static int nodelay; | ||
88 | 89 | ||
89 | module_param(index, int, 0444); | 90 | module_param(index, int, 0444); |
90 | MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); | 91 | MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); |
@@ -102,6 +103,8 @@ module_param(ac97_quirk, charp, 0444); | |||
102 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); | 103 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); |
103 | module_param(dxs_support, int, 0444); | 104 | module_param(dxs_support, int, 0444); |
104 | MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); | 105 | MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); |
106 | module_param(nodelay, int, 0444); | ||
107 | MODULE_PARM_DESC(nodelay, "Disable 500ms init delay"); | ||
105 | 108 | ||
106 | /* just for backward compatibility */ | 109 | /* just for backward compatibility */ |
107 | static int enable; | 110 | static int enable; |
@@ -399,9 +402,9 @@ struct via82xx { | |||
399 | 402 | ||
400 | static struct pci_device_id snd_via82xx_ids[] = { | 403 | static struct pci_device_id snd_via82xx_ids[] = { |
401 | /* 0x1106, 0x3058 */ | 404 | /* 0x1106, 0x3058 */ |
402 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ | 405 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C686_5), TYPE_CARD_VIA686, }, /* 686A */ |
403 | /* 0x1106, 0x3059 */ | 406 | /* 0x1106, 0x3059 */ |
404 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA8233, }, /* VT8233 */ | 407 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233_5), TYPE_CARD_VIA8233, }, /* VT8233 */ |
405 | { 0, } | 408 | { 0, } |
406 | }; | 409 | }; |
407 | 410 | ||
@@ -549,7 +552,8 @@ static void snd_via82xx_codec_wait(struct snd_ac97 *ac97) | |||
549 | int err; | 552 | int err; |
550 | err = snd_via82xx_codec_ready(chip, ac97->num); | 553 | err = snd_via82xx_codec_ready(chip, ac97->num); |
551 | /* here we need to wait fairly for long time.. */ | 554 | /* here we need to wait fairly for long time.. */ |
552 | msleep(500); | 555 | if (!nodelay) |
556 | msleep(500); | ||
553 | } | 557 | } |
554 | 558 | ||
555 | static void snd_via82xx_codec_write(struct snd_ac97 *ac97, | 559 | static void snd_via82xx_codec_write(struct snd_ac97 *ac97, |
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 0d54e3503c1e..47eb61561dfc 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -261,7 +261,7 @@ struct via82xx_modem { | |||
261 | }; | 261 | }; |
262 | 262 | ||
263 | static struct pci_device_id snd_via82xx_modem_ids[] = { | 263 | static struct pci_device_id snd_via82xx_modem_ids[] = { |
264 | { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, }, | 264 | { PCI_VDEVICE(VIA, 0x3068), TYPE_CARD_VIA82XX_MODEM, }, |
265 | { 0, } | 265 | { 0, } |
266 | }; | 266 | }; |
267 | 267 | ||
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index 4af66661f9b0..e6b18b90d451 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c | |||
@@ -67,12 +67,12 @@ module_param_array(rear_switch, bool, NULL, 0444); | |||
67 | MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch"); | 67 | MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch"); |
68 | 68 | ||
69 | static struct pci_device_id snd_ymfpci_ids[] = { | 69 | static struct pci_device_id snd_ymfpci_ids[] = { |
70 | { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ | 70 | { PCI_VDEVICE(YAMAHA, 0x0004), 0, }, /* YMF724 */ |
71 | { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */ | 71 | { PCI_VDEVICE(YAMAHA, 0x000d), 0, }, /* YMF724F */ |
72 | { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */ | 72 | { PCI_VDEVICE(YAMAHA, 0x000a), 0, }, /* YMF740 */ |
73 | { 0x1073, 0x000c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740C */ | 73 | { PCI_VDEVICE(YAMAHA, 0x000c), 0, }, /* YMF740C */ |
74 | { 0x1073, 0x0010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF744 */ | 74 | { PCI_VDEVICE(YAMAHA, 0x0010), 0, }, /* YMF744 */ |
75 | { 0x1073, 0x0012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF754 */ | 75 | { PCI_VDEVICE(YAMAHA, 0x0012), 0, }, /* YMF754 */ |
76 | { 0, } | 76 | { 0, } |
77 | }; | 77 | }; |
78 | 78 | ||