1 /*-
2 * Copyright 2002 FreeBSD, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26 #include <dev/sound/pcm/sound.h>
27 #include <dev/sound/pcm/ac97.h>
28 #include <dev/sound/pcm/ac97_patch.h>
29
30 SND_DECLARE_FILE("$FreeBSD$");
31
32 void ad1886_patch(struct ac97_info* codec)
33 {
34 #define AC97_AD_JACK_SPDIF 0x72
35 /*
36 * Presario700 workaround
37 * for Jack Sense/SPDIF Register misetting causing
38 * no audible output
39 * by Santiago Nullo 04/05/2002
40 */
41 ac97_wrcd(codec, AC97_AD_JACK_SPDIF, 0x0010);
42 }
43
44 void ad198x_patch(struct ac97_info* codec)
45 {
46 switch (ac97_getsubvendor(codec)) {
47 case 0x11931043: /* Not for ASUS A9T (probably else too). */
48 break;
49 default:
50 ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0420);
51 break;
52 }
53 }
54
55 void ad1981b_patch(struct ac97_info* codec)
56 {
57 /*
58 * Enable headphone jack sensing.
59 */
60 switch (ac97_getsubvendor(codec)) {
61 case 0x02d91014: /* IBM Thinkcentre */
62 case 0x099c103c: /* HP nx6110 */
63 ac97_wrcd(codec, AC97_AD_JACK_SPDIF,
64 ac97_rdcd(codec, AC97_AD_JACK_SPDIF) | 0x0800);
65 break;
66 default:
67 break;
68 }
69 }
70
71 void cmi9739_patch(struct ac97_info* codec)
72 {
73 /*
74 * Few laptops need extra register initialization
75 * to power up the internal speakers.
76 */
77 switch (ac97_getsubvendor(codec)) {
78 case 0x18431043: /* ASUS W1000N */
79 ac97_wrcd(codec, AC97_REG_POWER, 0x000f);
80 ac97_wrcd(codec, AC97_MIXEXT_CLFE, 0x0000);
81 ac97_wrcd(codec, 0x64, 0x7110);
82 break;
83 default:
84 break;
85 }
86 }
87
88 void alc655_patch(struct ac97_info* codec)
89 {
90 /*
91 * MSI (Micro-Star International) specific EAPD quirk.
92 */
93 switch (ac97_getsubvendor(codec)) {
94 case 0x00611462: /* MSI S250 */
95 case 0x01311462: /* MSI S270 */
96 case 0x01611462: /* LG K1 Express */
97 case 0x03511462: /* MSI L725 */
98 ac97_wrcd(codec, 0x7a, ac97_rdcd(codec, 0x7a) & 0xfffd);
99 break;
100 case 0x10ca1734:
101 /*
102 * Amilo Pro V2055 with ALC655 has phone out by default
103 * disabled (surround on), leaving us only with internal
104 * speakers. This should really go to mixer. We write the
105 * Data Flow Control reg.
106 */
107 ac97_wrcd(codec, 0x6a, ac97_rdcd(codec, 0x6a) | 0x0001);
108 break;
109 default:
110 break;
111 }
112 }
Cache object: 784bd2d4648ac12fe83b43d2f1f58d6c
|