Lines Matching +full:0 +full:xcfff

39 		 "(in second, 0 = disable).");
55 { 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },
56 { 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
57 { 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },
58 { 0x414c4700, 0xffffff00, "Realtek", NULL, NULL },
64 { 0x415a5400, 0xffffff00, "Aztech Labs (emulated)", NULL, NULL },
65 { 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL },
66 { 0x43525900, 0xffffff00, "Cirrus Logic", NULL, NULL },
67 { 0x43585400, 0xffffff00, "Conexant", NULL, NULL },
68 { 0x44543000, 0xffffff00, "Diamond Technology", NULL, NULL },
69 { 0x454d4300, 0xffffff00, "eMicro", NULL, NULL },
70 { 0x45838300, 0xffffff00, "ESS Technology", NULL, NULL },
71 { 0x48525300, 0xffffff00, "Intersil", NULL, NULL },
72 { 0x49434500, 0xffffff00, "ICEnsemble", NULL, NULL },
73 { 0x49544500, 0xffffff00, "ITE Tech.Inc", NULL, NULL },
74 { 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL },
75 { 0x50534300, 0xffffff00, "Philips", NULL, NULL },
76 { 0x53494c00, 0xffffff00, "Silicon Laboratory", NULL, NULL },
77 { 0x53544d00, 0xffffff00, "STMicroelectronics", NULL, NULL },
78 { 0x54524100, 0xffffff00, "TriTech", NULL, NULL },
79 { 0x54584e00, 0xffffff00, "Texas Instruments", NULL, NULL },
80 { 0x56494100, 0xffffff00, "VIA Technologies", NULL, NULL },
81 { 0x57454300, 0xffffff00, "Winbond", NULL, NULL },
82 { 0x574d4c00, 0xffffff00, "Wolfson", NULL, NULL },
83 { 0x594d4800, 0xffffff00, "Yamaha", NULL, NULL },
84 { 0x83847600, 0xffffff00, "SigmaTel", NULL, NULL },
85 { 0, 0, NULL, NULL, NULL }
89 { 0x41445303, 0xffffffff, "AD1819", patch_ad1819, NULL },
90 { 0x41445340, 0xffffffff, "AD1881", patch_ad1881, NULL },
91 { 0x41445348, 0xffffffff, "AD1881A", patch_ad1881, NULL },
92 { 0x41445360, 0xffffffff, "AD1885", patch_ad1885, NULL },
93 { 0x41445361, 0xffffffff, "AD1886", patch_ad1886, NULL },
94 { 0x41445362, 0xffffffff, "AD1887", patch_ad1881, NULL },
95 { 0x41445363, 0xffffffff, "AD1886A", patch_ad1881, NULL },
96 { 0x41445368, 0xffffffff, "AD1888", patch_ad1888, NULL },
97 { 0x41445370, 0xffffffff, "AD1980", patch_ad1980, NULL },
98 { 0x41445372, 0xffffffff, "AD1981A", patch_ad1981a, NULL },
99 { 0x41445374, 0xffffffff, "AD1981B", patch_ad1981b, NULL },
100 { 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL },
101 { 0x41445378, 0xffffffff, "AD1986", patch_ad1986, NULL },
102 { 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
103 { 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
104 { 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
105 { 0x414b4d06, 0xffffffff, "AK4544A", NULL, NULL },
106 { 0x414b4d07, 0xffffffff, "AK4545", NULL, NULL },
107 { 0x414c4300, 0xffffff00, "ALC100,100P", NULL, NULL },
108 { 0x414c4710, 0xfffffff0, "ALC200,200P", NULL, NULL },
109 { 0x414c4721, 0xffffffff, "ALC650D", NULL, NULL }, /* already patched */
110 { 0x414c4722, 0xffffffff, "ALC650E", NULL, NULL }, /* already patched */
111 { 0x414c4723, 0xffffffff, "ALC650F", NULL, NULL }, /* already patched */
112 { 0x414c4720, 0xfffffff0, "ALC650", patch_alc650, NULL },
113 { 0x414c4730, 0xffffffff, "ALC101", NULL, NULL },
114 { 0x414c4740, 0xfffffff0, "ALC202", NULL, NULL },
115 { 0x414c4750, 0xfffffff0, "ALC250", NULL, NULL },
116 { 0x414c4760, 0xfffffff0, "ALC655", patch_alc655, NULL },
117 { 0x414c4770, 0xfffffff0, "ALC203", patch_alc203, NULL },
118 { 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */
119 { 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL },
120 { 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL },
121 { 0x415a5401, 0xffffffff, "AZF3328", patch_aztech_azf3328, NULL },
122 { 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL },
123 { 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL },
124 { 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL },
125 { 0x434d4978, 0xffffffff, "CMI9761A", patch_cm9761, NULL },
126 { 0x434d4982, 0xffffffff, "CMI9761B", patch_cm9761, NULL },
127 { 0x434d4983, 0xffffffff, "CMI9761A+", patch_cm9761, NULL },
128 { 0x43525900, 0xfffffff8, "CS4297", NULL, NULL },
129 { 0x43525910, 0xfffffff8, "CS4297A", patch_cirrus_spdif, NULL },
130 { 0x43525920, 0xfffffff8, "CS4298", patch_cirrus_spdif, NULL },
131 { 0x43525928, 0xfffffff8, "CS4294", NULL, NULL },
132 { 0x43525930, 0xfffffff8, "CS4299", patch_cirrus_cs4299, NULL },
133 { 0x43525948, 0xfffffff8, "CS4201", NULL, NULL },
134 { 0x43525958, 0xfffffff8, "CS4205", patch_cirrus_spdif, NULL },
135 { 0x43525960, 0xfffffff8, "CS4291", NULL, NULL },
136 { 0x43525970, 0xfffffff8, "CS4202", NULL, NULL },
137 { 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, // SmartMC II
138 { 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, // SmartAMC fixme: the mask might be …
139 { 0x43585430, 0xffffffff, "Cx20468-31", patch_conexant, NULL },
140 { 0x43585431, 0xffffffff, "Cx20551", patch_cx20551, NULL },
141 { 0x44543031, 0xfffffff0, "DT0398", NULL, NULL },
142 { 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, // same as TR28028?
143 { 0x45838308, 0xffffffff, "ESS1988", NULL, NULL },
144 { 0x48525300, 0xffffff00, "HMP9701", NULL, NULL },
145 { 0x49434501, 0xffffffff, "ICE1230", NULL, NULL },
146 { 0x49434511, 0xffffffff, "ICE1232", NULL, NULL }, // alias VIA VT1611A?
147 { 0x49434514, 0xffffffff, "ICE1232A", NULL, NULL },
148 { 0x49434551, 0xffffffff, "VT1616", patch_vt1616, NULL },
149 { 0x49434552, 0xffffffff, "VT1616i", patch_vt1616, NULL }, // VT1616 compatible (chipset integrate…
150 { 0x49544520, 0xffffffff, "IT2226E", NULL, NULL },
151 { 0x49544561, 0xffffffff, "IT2646E", patch_it2646, NULL },
152 { 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, // only guess --jk
153 { 0x4e534331, 0xffffffff, "LM4549", NULL, NULL },
154 { 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix
155 { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH },
156 { 0x53544d02, 0xffffffff, "ST7597", NULL, NULL },
157 { 0x54524102, 0xffffffff, "TR28022", NULL, NULL },
158 { 0x54524103, 0xffffffff, "TR28023", NULL, NULL },
159 { 0x54524106, 0xffffffff, "TR28026", NULL, NULL },
160 { 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99]
161 { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (…
162 { 0x54584e03, 0xffffffff, "TLV320AIC27", NULL, NULL },
163 { 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
164 { 0x56494120, 0xfffffff0, "VIA1613", patch_vt1613, NULL },
165 { 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF
166 { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF
167 { 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL },
168 { 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
169 { 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
170 { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
171 { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q", patch_wolfson04, NULL},
172 { 0x574d4C05, 0xffffffff, "WM9705,WM9710", patch_wolfson05, NULL},
173 { 0x574d4C09, 0xffffffff, "WM9709", NULL, NULL},
174 { 0x574d4C12, 0xffffffff, "WM9711,WM9712,WM9715", patch_wolfson11, NULL},
175 { 0x574d4c13, 0xffffffff, "WM9713,WM9714", patch_wolfson13, NULL, AC97_DEFAULT_POWER_OFF},
176 { 0x594d4800, 0xffffffff, "YMF743", patch_yamaha_ymf743, NULL },
177 { 0x594d4802, 0xffffffff, "YMF752", NULL, NULL },
178 { 0x594d4803, 0xffffffff, "YMF753", patch_yamaha_ymf753, NULL },
179 { 0x83847600, 0xffffffff, "STAC9700,83,84", patch_sigmatel_stac9700, NULL },
180 { 0x83847604, 0xffffffff, "STAC9701,3,4,5", NULL, NULL },
181 { 0x83847605, 0xffffffff, "STAC9704", NULL, NULL },
182 { 0x83847608, 0xffffffff, "STAC9708,11", patch_sigmatel_stac9708, NULL },
183 { 0x83847609, 0xffffffff, "STAC9721,23", patch_sigmatel_stac9721, NULL },
184 { 0x83847644, 0xffffffff, "STAC9744", patch_sigmatel_stac9744, NULL },
185 { 0x83847650, 0xffffffff, "STAC9750,51", NULL, NULL }, // patch?
186 { 0x83847652, 0xffffffff, "STAC9752,53", NULL, NULL }, // patch?
187 { 0x83847656, 0xffffffff, "STAC9756,57", patch_sigmatel_stac9756, NULL },
188 { 0x83847658, 0xffffffff, "STAC9758,59", patch_sigmatel_stac9758, NULL },
189 { 0x83847666, 0xffffffff, "STAC9766,67", NULL, NULL }, // patch?
190 { 0, 0, NULL, NULL, NULL }
199 #define ac97_is_power_save_mode(ac97) 0
218 if (reg == 0x08) in snd_ac97_valid_reg()
219 return 0; in snd_ac97_valid_reg()
222 if (reg == 0x22 || reg == 0x7a) in snd_ac97_valid_reg()
227 if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c) in snd_ac97_valid_reg()
229 return 0; in snd_ac97_valid_reg()
233 if (reg >= 0x3a && reg <= 0x6e) /* 0x59 */ in snd_ac97_valid_reg()
234 return 0; in snd_ac97_valid_reg()
240 if (reg == 0x5a) in snd_ac97_valid_reg()
242 if (reg >= 0x3c && reg <= 0x6e) /* 0x59 */ in snd_ac97_valid_reg()
243 return 0; in snd_ac97_valid_reg()
252 if (reg <= 0x3a || reg >= 0x5a) in snd_ac97_valid_reg()
254 return 0; in snd_ac97_valid_reg()
275 if ((ac97->id & 0xffffff00) == AC97_ID_ALC100) { in snd_ac97_write()
278 ac97->bus->ops->write(ac97, AC97_RESET, 0); /* reset audio codec */ in snd_ac97_write()
299 return 0; in snd_ac97_read()
347 * Return: 1 if the value is changed, 0 if no change, or a negative
379 * Return: 1 if the bits are changed, 0 if no change, or a negative
429 (cfg & ~0x7000) | in snd_ac97_ad18xx_update_pcm_bits()
435 cfg | 0x7000); in snd_ac97_ad18xx_update_pcm_bits()
465 ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & (bitmask - 1); in snd_ac97_get_enum_double()
469 return 0; in snd_ac97_get_enum_double()
482 if (ucontrol->value.enumerated.item[0] > e->mask - 1) in snd_ac97_put_enum_double()
484 val = ucontrol->value.enumerated.item[0] << e->shift_l; in snd_ac97_put_enum_double()
501 (reg >= 0x60 && reg < 0x70)) { in snd_ac97_page_save()
502 unsigned short page = (kcontrol->private_value >> 26) & 0x0f; in snd_ac97_page_save()
512 if (page_save >= 0) { in snd_ac97_page_restore()
522 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_info_volsw()
523 int shift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_info_volsw()
524 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_info_volsw()
528 uinfo->value.integer.min = 0; in snd_ac97_info_volsw()
530 return 0; in snd_ac97_info_volsw()
537 int reg = kcontrol->private_value & 0xff; in snd_ac97_get_volsw()
538 int shift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_get_volsw()
539 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_get_volsw()
540 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_get_volsw()
541 int invert = (kcontrol->private_value >> 24) & 0x01; in snd_ac97_get_volsw()
545 ucontrol->value.integer.value[0] = (snd_ac97_read_cache(ac97, reg) >> shift) & mask; in snd_ac97_get_volsw()
549 ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0]; in snd_ac97_get_volsw()
554 return 0; in snd_ac97_get_volsw()
561 int reg = kcontrol->private_value & 0xff; in snd_ac97_put_volsw()
562 int shift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_put_volsw()
563 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_put_volsw()
564 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_put_volsw()
565 int invert = (kcontrol->private_value >> 24) & 0x01; in snd_ac97_put_volsw()
570 val = (ucontrol->value.integer.value[0] & mask); in snd_ac97_put_volsw()
600 AC97_SINGLE("Tone Control - Treble", AC97_MASTER_TONE, 0, 15, 1)
609 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
618 AC97_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, std_rec_sel),
625 AC97_ENUM("Capture Source", std_enum[0]);
628 AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0);
632 AC97_SINGLE("Mic Capture Volume", AC97_REC_GAIN_MIC, 0, 15, 0)
636 AC97_GENERAL_PCM_OUT = 0,
647 AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),
648 AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),
649 AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0),
652 AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)
656 AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0),
657 AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0)
662 AC97_SINGLE("Center Playback Volume", AC97_CENTER_LFE_MASTER, 0, 31, 1)
674 AC97_SINGLE("Off-hook Switch", AC97_GPIO_STATUS, 0, 1, 0),
675 AC97_SINGLE("Caller ID Switch", AC97_GPIO_STATUS, 2, 1, 0)
681 kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0); in set_inv_eapd()
690 return 0; in snd_ac97_spdif_mask_info()
695 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | in snd_ac97_spdif_cmask_get()
702 return 0; in snd_ac97_spdif_cmask_get()
708 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | in snd_ac97_spdif_pmask_get()
712 return 0; in snd_ac97_spdif_pmask_get()
720 ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff; in snd_ac97_spdif_default_get()
721 ucontrol->value.iec958.status[1] = (ac97->spdif_status >> 8) & 0xff; in snd_ac97_spdif_default_get()
722 ucontrol->value.iec958.status[2] = (ac97->spdif_status >> 16) & 0xff; in snd_ac97_spdif_default_get()
723 ucontrol->value.iec958.status[3] = (ac97->spdif_status >> 24) & 0xff; in snd_ac97_spdif_default_get()
725 return 0; in snd_ac97_spdif_default_get()
731 unsigned int new = 0; in snd_ac97_spdif_default_put()
732 unsigned short val = 0; in snd_ac97_spdif_default_put()
735 new = val = ucontrol->value.iec958.status[0] & (IEC958_AES0_PROFESSIONAL|IEC958_AES0_NONAUDIO); in snd_ac97_spdif_default_put()
736 if (ucontrol->value.iec958.status[0] & IEC958_AES0_PROFESSIONAL) { in snd_ac97_spdif_default_put()
737 new |= ucontrol->value.iec958.status[0] & (IEC958_AES0_PRO_FS|IEC958_AES0_PRO_EMPHASIS_5015); in snd_ac97_spdif_default_put()
739 case IEC958_AES0_PRO_FS_44100: val |= 0<<12; break; in snd_ac97_spdif_default_put()
747 …new |= ucontrol->value.iec958.status[0] & (IEC958_AES0_CON_EMPHASIS_5015|IEC958_AES0_CON_NOT_COPYR… in snd_ac97_spdif_default_put()
754 val |= ((new >> 8) & 0xff) << 4; // category + original in snd_ac97_spdif_default_put()
755 switch ((new >> 24) & 0xff) { in snd_ac97_spdif_default_put()
756 case IEC958_AES3_CON_FS_44100: val |= 0<<12; break; in snd_ac97_spdif_default_put()
768 int x = (val >> 12) & 0x03; in snd_ac97_spdif_default_put()
770 case 0: x = 1; break; // 44.1 in snd_ac97_spdif_default_put()
771 case 2: x = 0; break; // 48.0 in snd_ac97_spdif_default_put()
772 default: x = 0; break; // illegal. in snd_ac97_spdif_default_put()
774 change |= snd_ac97_update_bits_nolock(ac97, AC97_CSR_SPDIF, 0x3fff, ((val & 0xcfff) | (x << 12))); in snd_ac97_spdif_default_put()
777 v = new & (IEC958_AES0_CON_EMPHASIS_5015|IEC958_AES0_CON_NOT_COPYRIGHT) ? 0 : AC97_CXR_COPYRGT; in snd_ac97_spdif_default_put()
785 0xff38, in snd_ac97_spdif_default_put()
786 ((val << 4) & 0xff00) | in snd_ac97_spdif_default_put()
787 ((val << 2) & 0x0038)); in snd_ac97_spdif_default_put()
790 snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); /* turn off */ in snd_ac97_spdif_default_put()
792 change |= snd_ac97_update_bits_nolock(ac97, AC97_SPDIF, 0x3fff, val); in snd_ac97_spdif_default_put()
805 int reg = kcontrol->private_value & 0xff; in snd_ac97_put_spsa()
806 int shift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_put_spsa()
807 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_put_spsa()
808 // int invert = (kcontrol->private_value >> 24) & 0xff; in snd_ac97_put_spsa()
812 value = (ucontrol->value.integer.value[0] & mask); in snd_ac97_put_spsa()
823 snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); /* turn off */ in snd_ac97_put_spsa()
855 AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH),AC97_EXTENDED_STATUS, 2, 1, 0),
862 .private_value = AC97_SINGLE_VALUE(AC97_EXTENDED_STATUS, 4, 3, 0)
874 int mask = (kcontrol->private_value >> 16) & 0x0f; in snd_ac97_ad18xx_pcm_info_bits()
875 int lshift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_ad18xx_pcm_info_bits()
876 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_ad18xx_pcm_info_bits()
883 uinfo->value.integer.min = 0; in snd_ac97_ad18xx_pcm_info_bits()
885 return 0; in snd_ac97_ad18xx_pcm_info_bits()
892 int lshift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_ad18xx_pcm_get_bits()
893 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_ad18xx_pcm_get_bits()
894 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_ad18xx_pcm_get_bits()
896 ucontrol->value.integer.value[0] = mask - ((ac97->spec.ad18xx.pcmreg[codec] >> lshift) & mask); in snd_ac97_ad18xx_pcm_get_bits()
899 return 0; in snd_ac97_ad18xx_pcm_get_bits()
906 int lshift = (kcontrol->private_value >> 8) & 0x0f; in snd_ac97_ad18xx_pcm_put_bits()
907 int rshift = (kcontrol->private_value >> 12) & 0x0f; in snd_ac97_ad18xx_pcm_put_bits()
908 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_ac97_ad18xx_pcm_put_bits()
911 val = (mask - (ucontrol->value.integer.value[0] & mask)) << lshift; in snd_ac97_ad18xx_pcm_put_bits()
929 uinfo->value.integer.min = 0; in snd_ac97_ad18xx_pcm_info_volume()
931 return 0; in snd_ac97_ad18xx_pcm_info_volume()
940 ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31); in snd_ac97_ad18xx_pcm_get_volume()
941 ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31); in snd_ac97_ad18xx_pcm_get_volume()
943 return 0; in snd_ac97_ad18xx_pcm_get_volume()
952 val1 = 31 - (ucontrol->value.integer.value[0] & 31); in snd_ac97_ad18xx_pcm_put_volume()
954 return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2); in snd_ac97_ad18xx_pcm_put_volume()
958 AD18XX_PCM_BITS("PCM Playback Switch", 0, 15, 7, 1),
959 AD18XX_PCM_VOLUME("PCM Playback Volume", 0)
974 AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
992 return 0; in snd_ac97_bus_free()
1014 return 0; in snd_ac97_free()
1029 return 0; in snd_ac97_try_volume_mix()
1033 return ac97->caps & AC97_BC_BASS_TREBLE ? 1 : 0; in snd_ac97_try_volume_mix()
1035 return ac97->caps & AC97_BC_HEADPHONE ? 1 : 0; in snd_ac97_try_volume_mix()
1037 return ac97->caps & AC97_BC_DEDICATED_MIC ? 1 : 0; in snd_ac97_try_volume_mix()
1042 return val == 0; in snd_ac97_try_volume_mix()
1044 return 0; in snd_ac97_try_volume_mix()
1046 if ((ac97->ext_id & AC97_EI_CDAC) == 0) in snd_ac97_try_volume_mix()
1047 return 0; in snd_ac97_try_volume_mix()
1050 if ((ac97->ext_id & AC97_EI_LDAC) == 0) in snd_ac97_try_volume_mix()
1051 return 0; in snd_ac97_try_volume_mix()
1053 mask = 0x0080; in snd_ac97_try_volume_mix()
1056 if ((ac97->ext_id & AC97_EI_SDAC) == 0) in snd_ac97_try_volume_mix()
1057 return 0; in snd_ac97_try_volume_mix()
1069 return 0; /* nothing here */ in snd_ac97_try_volume_mix()
1076 unsigned short cbit[3] = { 0x20, 0x10, 0x01 }; in check_volume_resolution()
1085 *lo_max = tbl->bits & 0xff; in check_volume_resolution()
1086 *hi_max = (tbl->bits >> 8) & 0xff; in check_volume_resolution()
1092 *lo_max = *hi_max = 0; in check_volume_resolution()
1093 for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { in check_volume_resolution()
1105 if (! *lo_max && (val & 0x7f) == cbit[i]) in check_volume_resolution()
1107 if (! *hi_max && ((val >> 8) & 0x7f) == cbit[i]) in check_volume_resolution()
1133 val = AC97_MUTE_MASK_STEREO | (0x20 << shift); in snd_ac97_change_volume_params2()
1145 x &= 0xff; in printable()
1146 if (x < ' ' || x >= 0x71) { in printable()
1147 if (x <= 0x89) in printable()
1148 return x - 0x71 + 'A'; in printable()
1175 return 0; in snd_ac97_cmute_new_stereo()
1200 if (err < 0) in snd_ac97_cmute_new_stereo()
1204 return 0; in snd_ac97_cmute_new_stereo()
1210 static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0);
1211 static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0);
1212 static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
1213 static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);
1214 static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
1219 case 0x0f: return db_scale_4bit; in find_db_scale()
1220 case 0x1f: return db_scale_5bit; in find_db_scale()
1221 case 0x3f: return db_scale_6bit; in find_db_scale()
1230 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; in set_tlv_db_scale()
1243 return 0; in snd_ac97_cvol_new()
1246 struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1); in snd_ac97_cvol_new()
1251 struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 0, lo_max, 1); in snd_ac97_cvol_new()
1262 if (err < 0) in snd_ac97_cvol_new()
1269 return 0; in snd_ac97_cvol_new()
1284 return 0; in snd_ac97_cmix_new_stereo()
1291 if (err < 0) in snd_ac97_cmix_new_stereo()
1298 if (err < 0) in snd_ac97_cmix_new_stereo()
1301 return 0; in snd_ac97_cmix_new_stereo()
1305 snd_ac97_cmix_new_stereo(card, pfx, reg, 0, acheck, ac97)
1307 snd_ac97_cmute_new_stereo(card, name, reg, 0, acheck, ac97)
1324 AC97_MASTER, 0, ac97); in snd_ac97_mixer_build()
1327 AC97_MASTER, 0, ac97); in snd_ac97_mixer_build()
1328 if (err < 0) in snd_ac97_mixer_build()
1337 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97)); in snd_ac97_mixer_build()
1338 if (err < 0) in snd_ac97_mixer_build()
1341 if (err < 0) in snd_ac97_mixer_build()
1343 snd_ac97_change_volume_params2(ac97, AC97_CENTER_LFE_MASTER, 0, &max); in snd_ac97_mixer_build()
1344 kctl->private_value &= ~(0xff << 16); in snd_ac97_mixer_build()
1353 err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97)); in snd_ac97_mixer_build()
1354 if (err < 0) in snd_ac97_mixer_build()
1357 if (err < 0) in snd_ac97_mixer_build()
1360 kctl->private_value &= ~(0xff << 16); in snd_ac97_mixer_build()
1369 /* Surround Master (0x38) is with stereo mutes */ in snd_ac97_mixer_build()
1371 AC97_SURROUND_MASTER, 1, 0, in snd_ac97_mixer_build()
1373 if (err < 0) in snd_ac97_mixer_build()
1380 AC97_HEADPHONE, 0, ac97); in snd_ac97_mixer_build()
1381 if (err < 0) in snd_ac97_mixer_build()
1388 AC97_MASTER_MONO, 0, ac97); in snd_ac97_mixer_build()
1389 if (err < 0) in snd_ac97_mixer_build()
1396 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1399 if (err < 0) in snd_ac97_mixer_build()
1403 kctl->private_value &= ~(0xff << 16); in snd_ac97_mixer_build()
1407 snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f); in snd_ac97_mixer_build()
1415 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1418 if (err < 0) in snd_ac97_mixer_build()
1426 | AC97_MUTE_MASK_MONO | 0x001e) in snd_ac97_mixer_build()
1435 if (err < 0) in snd_ac97_mixer_build()
1445 if (err < 0) in snd_ac97_mixer_build()
1448 if (err < 0) in snd_ac97_mixer_build()
1457 if (err < 0) in snd_ac97_mixer_build()
1466 if (err < 0) in snd_ac97_mixer_build()
1476 if (err < 0) in snd_ac97_mixer_build()
1486 if (err < 0) in snd_ac97_mixer_build()
1495 init_val = 0x9f9f; in snd_ac97_mixer_build()
1497 init_val = 0x9f1f; in snd_ac97_mixer_build()
1498 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1501 if (err < 0) in snd_ac97_mixer_build()
1505 ac97->spec.ad18xx.pcmreg[0] = init_val; in snd_ac97_mixer_build()
1507 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1510 if (err < 0) in snd_ac97_mixer_build()
1517 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1520 if (err < 0) in snd_ac97_mixer_build()
1524 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1527 if (err < 0) in snd_ac97_mixer_build()
1539 AC97_PCM, 0, ac97); in snd_ac97_mixer_build()
1542 AC97_PCM, 0, ac97); in snd_ac97_mixer_build()
1543 if (err < 0) in snd_ac97_mixer_build()
1551 if (err < 0) in snd_ac97_mixer_build()
1555 AC97_REC_GAIN, 0, ac97); in snd_ac97_mixer_build()
1556 if (err < 0) in snd_ac97_mixer_build()
1561 if (err < 0) in snd_ac97_mixer_build()
1564 snd_ac97_write_cache(ac97, AC97_REC_SEL, 0x0000); in snd_ac97_mixer_build()
1565 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x0000); in snd_ac97_mixer_build()
1569 for (idx = 0; idx < 2; idx++) { in snd_ac97_mixer_build()
1572 if (err < 0) in snd_ac97_mixer_build()
1576 snd_ac97_write_cache(ac97, AC97_REC_GAIN_MIC, 0x0000); in snd_ac97_mixer_build()
1582 if (err < 0) in snd_ac97_mixer_build()
1589 if (err < 0) in snd_ac97_mixer_build()
1596 if (err < 0) in snd_ac97_mixer_build()
1603 if (err < 0) in snd_ac97_mixer_build()
1610 if (err < 0) in snd_ac97_mixer_build()
1617 if (err < 0) in snd_ac97_mixer_build()
1624 if (err < 0) in snd_ac97_mixer_build()
1628 snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, ~AC97_GP_DRSS_MASK, 0x0000); in snd_ac97_mixer_build()
1636 val = 0x0707; in snd_ac97_mixer_build()
1639 val = val == 0x0606; in snd_ac97_mixer_build()
1640 kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97); in snd_ac97_mixer_build()
1642 if (err < 0) in snd_ac97_mixer_build()
1648 if (err < 0) in snd_ac97_mixer_build()
1652 snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000); in snd_ac97_mixer_build()
1659 if (ac97->subsystem_vendor == 0x1043 && in snd_ac97_mixer_build()
1660 ac97->subsystem_device == 0x810f) in snd_ac97_mixer_build()
1666 if (err < 0) in snd_ac97_mixer_build()
1669 for (idx = 0; idx < 5; idx++) { in snd_ac97_mixer_build()
1671 if (err < 0) in snd_ac97_mixer_build()
1676 if (err < 0) in snd_ac97_mixer_build()
1681 snd_ac97_write_cache(ac97, AC97_SPDIF, 0x2a20); in snd_ac97_mixer_build()
1690 if (err < 0) in snd_ac97_mixer_build()
1701 if (err < 0) in snd_ac97_mixer_build()
1705 return 0; in snd_ac97_mixer_build()
1716 snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH)); in snd_ac97_modem_build()
1717 snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH)); in snd_ac97_modem_build()
1718 snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff); in snd_ac97_modem_build()
1719 snd_ac97_write(ac97, AC97_GPIO_WAKEUP, 0x0); in snd_ac97_modem_build()
1720 snd_ac97_write(ac97, AC97_MISC_AFE, 0x0); in snd_ac97_modem_build()
1723 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_modem_switches); idx++) { in snd_ac97_modem_build()
1725 if (err < 0) in snd_ac97_modem_build()
1732 if (err < 0) in snd_ac97_modem_build()
1736 return 0; in snd_ac97_modem_build()
1745 snd_ac97_write_cache(ac97, reg, tmp & 0xffff); in snd_ac97_test_rate()
1747 snd_ac97_write_cache(ac97, shadow_reg, tmp & 0xffff); in snd_ac97_test_rate()
1749 return val == (tmp & 0xffff); in snd_ac97_test_rate()
1754 unsigned int result = 0; in snd_ac97_determine_rates()
1768 AC97_EA_DRA, 0); in snd_ac97_determine_rates()
1802 AC97_EA_DRA, 0); in snd_ac97_determine_rates()
1814 unsigned int result = 0; in snd_ac97_determine_spdif_rates()
1823 for (i = 0; i < (int)ARRAY_SIZE(ctl_bits); i++) { in snd_ac97_determine_spdif_rates()
1847 sprintf(name, "0x%x %c%c%c", id, in snd_ac97_get_name()
1866 if (pid->mask != 0xffffffff) in snd_ac97_get_name()
1874 sprintf(name + strlen(name), " id %x", id & 0xff); in snd_ac97_get_name()
1896 * return 0 if ok, negative not ready
1913 if (val != 0xffff && (val & 1) != 0) in ac97_reset_wait()
1914 return 0; in ac97_reset_wait()
1919 if (val != 0 && val != 0xffff) in ac97_reset_wait()
1920 return 0; in ac97_reset_wait()
1926 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x8a05); in ac97_reset_wait()
1927 if ((snd_ac97_read(ac97, AC97_REC_GAIN) & 0x7fff) == 0x0a05) in ac97_reset_wait()
1928 return 0; in ac97_reset_wait()
1980 if (err < 0) { in snd_ac97_bus()
1986 return 0; in snd_ac97_bus()
2009 if (err < 0) { in snd_ac97_dev_register()
2015 return 0; in snd_ac97_dev_register()
2024 return 0; in snd_ac97_dev_disconnect()
2120 snd_ac97_write(ac97, AC97_RESET, 0); in snd_ac97_mixer()
2122 snd_ac97_write(ac97, AC97_EXTENDED_MID, 0); in snd_ac97_mixer()
2130 err = ac97_reset_wait(ac97, msecs_to_jiffies(500), 0); in snd_ac97_mixer()
2131 if (err < 0) in snd_ac97_mixer()
2135 if (err < 0) { in snd_ac97_mixer()
2145 (ac97->id == 0x00000000 || ac97->id == 0xffffffff)) { in snd_ac97_mixer()
2147 "AC'97 %d access is not valid [0x%x], removing mixer.\n", in snd_ac97_mixer()
2159 snd_ac97_write_cache(ac97, AC97_REC_GAIN, 0x8a06); in snd_ac97_mixer()
2161 if ((err & 0x7fff) == 0x0a06) in snd_ac97_mixer()
2167 if (ac97->ext_id == 0xffff) /* invalid combination */ in snd_ac97_mixer()
2168 ac97->ext_id = 0; in snd_ac97_mixer()
2174 if (ac97->ext_mid == 0xffff) /* invalid combination */ in snd_ac97_mixer()
2175 ac97->ext_mid = 0; in snd_ac97_mixer()
2195 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0); in snd_ac97_mixer()
2197 snd_ac97_write_cache(ac97, AC97_RESET, 0); /* reset to defaults */ in snd_ac97_mixer()
2199 snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0); in snd_ac97_mixer()
2202 snd_ac97_write_cache(ac97, AC97_GENERAL_PURPOSE, 0); in snd_ac97_mixer()
2205 if ((snd_ac97_read(ac97, AC97_POWERDOWN) & 0x0f) == 0x0f) in snd_ac97_mixer()
2232 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0); in snd_ac97_mixer()
2235 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0); in snd_ac97_mixer()
2243 "MC'97 %d converters and GPIO not ready (0x%x)\n", in snd_ac97_mixer()
2253 if (ac97->ext_id & 0x01c9) { /* L/R, MIC, SDAC, LDAC VRA support */ in snd_ac97_mixer()
2255 reg |= ac97->ext_id & 0x01c0; /* LDAC/SDAC/CDAC */ in snd_ac97_mixer()
2257 reg |= ac97->ext_id & 0x0009; /* VRA/VRM */ in snd_ac97_mixer()
2267 snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, AC97_GP_DRSS_MASK, 0); in snd_ac97_mixer()
2270 snd_ac97_determine_rates(ac97, AC97_PCM_FRONT_DAC_RATE, 0, &ac97->rates[AC97_RATES_FRONT_DAC]); in snd_ac97_mixer()
2271 snd_ac97_determine_rates(ac97, AC97_PCM_LR_ADC_RATE, 0, &ac97->rates[AC97_RATES_ADC]); in snd_ac97_mixer()
2283 snd_ac97_determine_rates(ac97, AC97_PCM_MIC_ADC_RATE, 0, &ac97->rates[AC97_RATES_MIC_ADC]); in snd_ac97_mixer()
2305 if (card->mixername[0] == '\0') { in snd_ac97_mixer()
2315 if (err < 0) { in snd_ac97_mixer()
2319 if (snd_ac97_mixer_build(ac97) < 0) { in snd_ac97_mixer()
2326 if (card->mixername[0] == '\0') { in snd_ac97_mixer()
2336 if (err < 0) { in snd_ac97_mixer()
2340 if (snd_ac97_modem_build(card, ac97) < 0) { in snd_ac97_mixer()
2349 if (err < 0) { in snd_ac97_mixer()
2354 return 0; in snd_ac97_mixer()
2371 snd_ac97_write(ac97, AC97_MASTER, 0x9f9f); in snd_ac97_powerdown()
2372 snd_ac97_write(ac97, AC97_HEADPHONE, 0x9f9f); in snd_ac97_powerdown()
2442 return 0; in snd_ac97_update_power()
2448 for (i = 0; i < PWIDX_SIZE; i++) { in snd_ac97_update_power()
2471 return 0; in snd_ac97_update_power()
2496 AC97_PD_PR3, 0); in update_power_regs()
2499 AC97_PD_PR2, 0); in update_power_regs()
2502 for (i = 0; i < PWIDX_SIZE; i++) { in update_power_regs()
2504 bits = 0; in update_power_regs()
2550 for (i = 2; i < 0x7c ; i += 2) { in snd_ac97_restore_status()
2572 snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); in snd_ac97_restore_iec958()
2602 snd_ac97_write(ac97, AC97_POWERDOWN, 0); in snd_ac97_resume()
2605 snd_ac97_write(ac97, AC97_RESET, 0); in snd_ac97_resume()
2607 snd_ac97_write(ac97, AC97_EXTENDED_MID, 0); in snd_ac97_resume()
2609 snd_ac97_write(ac97, AC97_POWERDOWN, 0); in snd_ac97_resume()
2611 snd_ac97_write(ac97, AC97_GENERAL_PURPOSE, 0); in snd_ac97_resume()
2615 ac97->bus->ops->write(ac97, AC97_MASTER, 0x8101); in snd_ac97_resume()
2618 if (snd_ac97_read(ac97, AC97_MASTER) == 0x8101) in snd_ac97_resume()
2630 if (val != 0xffff && (val & 1) != 0) in snd_ac97_resume()
2664 if (strscpy(dst, src, msize) < 0) in set_ctl_name()
2675 memset(&id, 0, sizeof(id)); in snd_ac97_remove_ctl()
2684 memset(&sid, 0, sizeof(sid)); in ctl_find()
2700 return 0; in snd_ac97_rename_ctl()
2729 return 0; in snd_ac97_swap_ctl()
2739 if (err > 0) { in bind_hp_volsw_put()
2741 kcontrol->private_value = (kcontrol->private_value & ~0xff) | AC97_HEADPHONE; in bind_hp_volsw_put()
2759 return 0; in tune_hp_only()
2771 return 0; in tune_hp_only()
2782 return 0; in tune_swap_hp()
2791 return 0; in tune_swap_surround()
2798 if ((ac97->id & 0xffffff00) != 0x41445300) { in tune_ad_sharing()
2804 snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x0200); in tune_ad_sharing()
2805 return 0; in tune_ad_sharing()
2809 AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
2814 if ((ac97->id & 0xffffff00) != 0x414c4700) { in tune_alc_jack()
2819 snd_ac97_update_bits(ac97, 0x7a, 0x20, 0x20); /* select jack detect function */ in tune_alc_jack()
2820 snd_ac97_update_bits(ac97, 0x7a, 0x01, 0x01); /* Line-out auto mute */ in tune_alc_jack()
2822 snd_ac97_update_bits(ac97, 0x74, 0x0800, 0x0800); in tune_alc_jack()
2833 return 0; in tune_inv_eapd()
2839 if (err > 0) { in master_mute_sw_put()
2841 int shift = (kcontrol->private_value >> 8) & 0x0f; in master_mute_sw_put()
2842 int rshift = (kcontrol->private_value >> 12) & 0x0f; in master_mute_sw_put()
2850 AC97_PD_EAPD : 0); in master_mute_sw_put()
2868 return 0; in tune_mute_led()
2875 if (err > 0) { in hp_master_mute_sw_put()
2877 int shift = (kcontrol->private_value >> 8) & 0x0f; in hp_master_mute_sw_put()
2878 int rshift = (kcontrol->private_value >> 12) & 0x0f; in hp_master_mute_sw_put()
2886 AC97_PD_EAPD : 0); in hp_master_mute_sw_put()
2906 return 0; in tune_hp_mute_led()
2929 if (type <= 0) in apply_quirk()
2930 return 0; in apply_quirk()
2935 return 0; in apply_quirk()
2944 for (i = 0; i < ARRAY_SIZE(applicable_quirks); i++) { in apply_quirk_str()
2950 if (*typestr >= '0' && *typestr <= '9') in apply_quirk_str()
2976 if (result < 0) in snd_ac97_tune_hardware()
2996 if (result < 0) in snd_ac97_tune_hardware()
3003 return 0; in snd_ac97_tune_hardware()