Lines Matching +full:0 +full:x0b

67 #define CS420X_VENDOR_NID	0x11
68 #define CS_DIG_OUT1_PIN_NID 0x10
69 #define CS_DIG_OUT2_PIN_NID 0x15
70 #define CS_DMIC1_PIN_NID 0x0e
71 #define CS_DMIC2_PIN_NID 0x12
74 #define IDX_SPDIF_STAT 0x0000
75 #define IDX_SPDIF_CTL 0x0001
76 #define IDX_ADC_CFG 0x0002
78 * 0 = immediate,
83 #define CS_COEF_ADC_SZC_MASK (3 << 0)
84 #define CS_COEF_ADC_MIC_SZC_MODE (3 << 0) /* SZC setup for mic */
85 #define CS_COEF_ADC_LI_SZC_MODE (3 << 0) /* SZC setup for line-in */
86 /* PGA mode: 0 = differential, 1 = signle-ended */
89 #define IDX_DAC_CFG 0x0003
91 * 0 = Immediate
96 #define CS_COEF_DAC_HP_SZC_MODE (3 << 0) /* nid 0x02 */
97 #define CS_COEF_DAC_LO_SZC_MODE (3 << 2) /* nid 0x03 */
98 #define CS_COEF_DAC_SPK_SZC_MODE (3 << 4) /* nid 0x04 */
100 #define IDX_BEEP_CFG 0x0004
101 /* 0x0008 - test reg key */
102 /* 0x0009 - 0x0014 -> 12 test regs */
103 /* 0x0015 - visibility reg */
106 #define CS4208_VENDOR_NID 0x24
115 #define CS4210_DAC_NID 0x02
116 #define CS4210_ADC_NID 0x03
117 #define CS4210_VENDOR_NID 0x0B
118 #define CS421X_DMIC_PIN_NID 0x09 /* Port E */
119 #define CS421X_SPDIF_PIN_NID 0x0A /* Port H */
121 #define CS421X_IDX_DEV_CFG 0x01
122 #define CS421X_IDX_ADC_CFG 0x02
123 #define CS421X_IDX_DAC_CFG 0x03
124 #define CS421X_IDX_SPK_CTL 0x04
127 #define CS4213_VENDOR_NID 0x09
134 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
136 return snd_hda_codec_read(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
137 AC_VERB_GET_PROC_COEF, 0); in cs_vendor_coef_get()
145 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
147 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
173 snd_hda_codec_write(codec, 0x01, 0, in cs_automute()
207 {0x11, AC_VERB_SET_PROC_STATE, 1},
208 {0x11, AC_VERB_SET_COEF_INDEX, IDX_DAC_CFG},
209 {0x11, AC_VERB_SET_PROC_COEF,
210 (0x002a /* DAC1/2/3 SZCMode Soft Ramp */
211 | 0x0040 /* Mute DACs on FIFO error */
212 | 0x1000 /* Enable DACs High Pass Filter */
213 | 0x0400 /* Disable Coefficient Auto increment */
216 {0x11, AC_VERB_SET_COEF_INDEX, IDX_ADC_CFG},
217 {0x11, AC_VERB_SET_PROC_COEF, 0x000a},
219 {0x11, AC_VERB_SET_COEF_INDEX, IDX_BEEP_CFG},
220 {0x11, AC_VERB_SET_PROC_COEF, 0x0007}, /* Enable Beep thru DAC1/2/3 */
226 {0x01, AC_VERB_SET_POWER_STATE, 0x00}, /* AFG: D0 */
227 {0x24, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */
228 {0x24, AC_VERB_SET_COEF_INDEX, 0x0033},
229 {0x24, AC_VERB_SET_PROC_COEF, 0x0001}, /* A1 ICS */
230 {0x24, AC_VERB_SET_COEF_INDEX, 0x0034},
231 {0x24, AC_VERB_SET_PROC_COEF, 0x1C01}, /* A1 Enable, A Thresh = 300mV */
254 {0x01, AC_VERB_SET_POWER_STATE, 0x00}, /* AFG: D0 */
255 {0x11, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */
257 {0x11, AC_VERB_SET_COEF_INDEX, 0x0008},
258 {0x11, AC_VERB_SET_PROC_COEF, 0x9999},
259 {0x11, AC_VERB_SET_COEF_INDEX, 0x0017},
260 {0x11, AC_VERB_SET_PROC_COEF, 0xa412},
261 {0x11, AC_VERB_SET_COEF_INDEX, 0x0001},
262 {0x11, AC_VERB_SET_PROC_COEF, 0x0009},
264 {0x07, AC_VERB_SET_POWER_STATE, 0x00}, /* S/PDIF Rx: D0 */
265 {0x08, AC_VERB_SET_POWER_STATE, 0x00}, /* S/PDIF Tx: D0 */
267 {0x11, AC_VERB_SET_COEF_INDEX, 0x0017},
268 {0x11, AC_VERB_SET_PROC_COEF, 0x2412},
269 {0x11, AC_VERB_SET_COEF_INDEX, 0x0008},
270 {0x11, AC_VERB_SET_PROC_COEF, 0x0000},
271 {0x11, AC_VERB_SET_COEF_INDEX, 0x0001},
272 {0x11, AC_VERB_SET_PROC_COEF, 0x0008},
273 {0x11, AC_VERB_SET_PROC_STATE, 0x00},
282 coef = 0x0002; /* SRC_MUTE soft-mute on SPDIF (if no lock) */ in init_digital_coef()
283 coef |= 0x0008; /* Replace with mute on error */ in init_digital_coef()
285 coef |= 0x4000; /* RX to TX1 or TX2 Loopthru / SPDIF2 in init_digital_coef()
307 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, in cs_init()
309 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, in cs_init()
311 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, in cs_init()
320 return 0; in cs_init()
328 if (err < 0) in cs_build_controls()
331 return 0; in cs_build_controls()
350 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); in cs_parse_auto_config()
351 if (err < 0) in cs_parse_auto_config()
355 if (err < 0) in cs_parse_auto_config()
360 unsigned int done = 0; in cs_parse_auto_config()
362 for (i = 0; i < spec->gen.input_mux.num_items; i++) { in cs_parse_auto_config()
373 return 0; in cs_parse_auto_config()
389 SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),
390 SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
391 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
392 SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
394 /*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/
397 SND_PCI_QUIRK(0x106b, 0x0600, "iMac 14,1", CS420X_IMAC27_122),
398 SND_PCI_QUIRK(0x106b, 0x0900, "iMac 12,1", CS420X_IMAC27_122),
399 SND_PCI_QUIRK(0x106b, 0x1c00, "MacBookPro 8,1", CS420X_MBP81),
400 SND_PCI_QUIRK(0x106b, 0x2000, "iMac 12,2", CS420X_IMAC27_122),
401 SND_PCI_QUIRK(0x106b, 0x2800, "MacBookPro 10,1", CS420X_MBP101),
402 SND_PCI_QUIRK(0x106b, 0x5600, "MacBookAir 5,2", CS420X_MBP81),
403 SND_PCI_QUIRK(0x106b, 0x5b00, "MacBookAir 4,2", CS420X_MBA42),
404 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
409 { 0x09, 0x012b4050 },
410 { 0x0a, 0x90100141 },
411 { 0x0b, 0x90100140 },
412 { 0x0c, 0x018b3020 },
413 { 0x0d, 0x90a00110 },
414 { 0x0e, 0x400000f0 },
415 { 0x0f, 0x01cbe030 },
416 { 0x10, 0x014be060 },
417 { 0x12, 0x400000f0 },
418 { 0x15, 0x400000f0 },
423 { 0x09, 0x012b4030 },
424 { 0x0a, 0x90100121 },
425 { 0x0b, 0x90100120 },
426 { 0x0c, 0x400000f0 },
427 { 0x0d, 0x90a00110 },
428 { 0x0e, 0x400000f0 },
429 { 0x0f, 0x400000f0 },
430 { 0x10, 0x014be040 },
431 { 0x12, 0x400000f0 },
432 { 0x15, 0x400000f0 },
437 { 0x09, 0x012b4050 },
438 { 0x0a, 0x90100140 },
439 { 0x0b, 0x90100142 },
440 { 0x0c, 0x018b3020 },
441 { 0x0d, 0x90a00110 },
442 { 0x0e, 0x400000f0 },
443 { 0x0f, 0x01cbe030 },
444 { 0x10, 0x014be060 },
445 { 0x12, 0x01ab9070 },
446 { 0x15, 0x400000f0 },
451 { 0x0d, 0x40ab90f0 },
452 { 0x0e, 0x90a600f0 },
453 { 0x12, 0x50a600f0 },
458 { 0x09, 0x012b4030 }, /* HP */
459 { 0x0a, 0x400000f0 },
460 { 0x0b, 0x90100120 }, /* speaker */
461 { 0x0c, 0x400000f0 },
462 { 0x0d, 0x90a00110 }, /* mic */
463 { 0x0e, 0x400000f0 },
464 { 0x0f, 0x400000f0 },
465 { 0x10, 0x400000f0 },
466 { 0x12, 0x400000f0 },
467 { 0x15, 0x400000f0 },
472 { 0x10, 0x032120f0 }, /* HP */
473 { 0x11, 0x500000f0 },
474 { 0x12, 0x90100010 }, /* Speaker */
475 { 0x13, 0x500000f0 },
476 { 0x14, 0x500000f0 },
477 { 0x15, 0x770000f0 },
478 { 0x16, 0x770000f0 },
479 { 0x17, 0x430000f0 },
480 { 0x18, 0x43ab9030 }, /* Mic */
481 { 0x19, 0x770000f0 },
482 { 0x1a, 0x770000f0 },
483 { 0x1b, 0x770000f0 },
484 { 0x1c, 0x90a00090 },
485 { 0x1d, 0x500000f0 },
486 { 0x1e, 0x500000f0 },
487 { 0x1f, 0x500000f0 },
488 { 0x20, 0x500000f0 },
489 { 0x21, 0x430000f0 },
490 { 0x22, 0x430000f0 },
557 {0x11, AC_VERB_SET_COEF_INDEX, IDX_ADC_CFG},
558 {0x11, AC_VERB_SET_PROC_COEF, 0x102a},
605 if (err < 0) in patch_cs420x()
610 return 0; in patch_cs420x()
638 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_MAC_AUTO),
644 SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
645 SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI),
646 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
647 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
648 SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11),
658 spec->gpio_eapd_hp = 0; in cs4208_fixup_gpio0()
686 { 0x18, 0x00ab9150 }, /* mic (audio-in) jack: disable detect */ in cs4208_fixup_macmini()
687 { 0x21, 0x004be140 }, /* SPDIF: disable detect */ in cs4208_fixup_macmini()
692 /* HP pin (0x10) has an inverted detection */ in cs4208_fixup_macmini()
704 hda_nid_t pin = spec->gen.autocfg.dig_out_pins[0]; in cs4208_spdif_sw_put()
705 int pinctl = ucontrol->value.integer.value[0] ? PIN_OUT : 0; in cs4208_spdif_sw_put()
719 if (!spec->gen.autocfg.dig_out_pins[0]) in cs4208_fixup_spdif_switch()
758 /* correct the 0dB offset of input pins */
765 caps |= 0x02; in cs4208_fix_amp_caps()
780 /* exclude NID 0x10 (HP) from output volumes due to different steps */ in patch_cs4208()
781 spec->gen.out_vol_mask = 1ULL << 0x10; in patch_cs4208()
787 snd_hda_override_wcaps(codec, 0x18, in patch_cs4208()
788 get_wcaps(codec, 0x18) | AC_WCAP_STEREO); in patch_cs4208()
789 cs4208_fix_amp_caps(codec, 0x18); in patch_cs4208()
790 cs4208_fix_amp_caps(codec, 0x1b); in patch_cs4208()
791 cs4208_fix_amp_caps(codec, 0x1c); in patch_cs4208()
794 if (err < 0) in patch_cs4208()
799 return 0; in patch_cs4208()
823 SND_PCI_QUIRK(0x8086, 0x5001, "DP45SG/CDB4210", CS421X_CDB4210),
830 { 0x05, 0x0321401f },
831 { 0x06, 0x90170010 },
832 { 0x07, 0x03813031 },
833 { 0x08, 0xb7a70037 },
834 { 0x09, 0xb7a6003e },
835 { 0x0a, 0x034510f0 },
841 { 0x05, 0x022120f0 },
842 { 0x06, 0x901700f0 },
843 { 0x07, 0x02a120f0 },
844 { 0x08, 0x77a70037 },
845 { 0x09, 0x77a6003e },
846 { 0x0a, 0x434510f0 },
878 {0x0B, AC_VERB_SET_PROC_STATE, 1},
879 {0x0B, AC_VERB_SET_COEF_INDEX, CS421X_IDX_DEV_CFG},
882 * PDREF=0
884 {0x0B, AC_VERB_SET_PROC_COEF, 0x0001 },
886 {0x0B, AC_VERB_SET_COEF_INDEX, CS421X_IDX_ADC_CFG},
888 {0x0B, AC_VERB_SET_PROC_COEF, 0x0002 },
890 {0x0B, AC_VERB_SET_COEF_INDEX, CS421X_IDX_DAC_CFG},
891 {0x0B, AC_VERB_SET_PROC_COEF,
892 (0x0002 /* DAC SZCMode = Digital Soft Ramp */
893 | 0x0004 /* Mute DAC on FIFO error */
894 | 0x0008 /* Enable DAC High Pass Filter */
915 {0x0B, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */
917 {0x0B, AC_VERB_SET_COEF_INDEX, 0x0006},
918 {0x0B, AC_VERB_SET_PROC_COEF, 0x9999}, /* Test mode: on */
920 {0x0B, AC_VERB_SET_COEF_INDEX, 0x000A},
921 {0x0B, AC_VERB_SET_PROC_COEF, 0x14CB}, /* Chop double */
923 {0x0B, AC_VERB_SET_COEF_INDEX, 0x0011},
924 {0x0B, AC_VERB_SET_PROC_COEF, 0xA2D0}, /* Increase ADC current */
926 {0x0B, AC_VERB_SET_COEF_INDEX, 0x001A},
927 {0x0B, AC_VERB_SET_PROC_COEF, 0x02A9}, /* Mute speaker */
929 {0x0B, AC_VERB_SET_COEF_INDEX, 0x001B},
930 {0x0B, AC_VERB_SET_PROC_COEF, 0X1006}, /* Remove noise */
936 static const DECLARE_TLV_DB_SCALE(cs421x_speaker_boost_db_scale, 900, 300, 0);
943 uinfo->value.integer.min = 0; in cs421x_boost_vol_info()
945 return 0; in cs421x_boost_vol_info()
953 ucontrol->value.integer.value[0] = in cs421x_boost_vol_get()
954 cs_vendor_coef_get(codec, CS421X_IDX_SPK_CTL) & 0x0003; in cs421x_boost_vol_get()
955 return 0; in cs421x_boost_vol_get()
963 unsigned int vol = ucontrol->value.integer.value[0]; in cs421x_boost_vol_put()
968 coef &= ~0x0003; in cs421x_boost_vol_put()
969 coef |= (vol & 0x0003); in cs421x_boost_vol_put()
975 return 0; in cs421x_boost_vol_put()
999 coef |= 0x0008; /* B1,B2 are GPIOs */ in cs4210_pinmux_init()
1001 coef &= ~0x0008; in cs4210_pinmux_init()
1004 coef |= 0x0010; /* B2 is SENSE_B, not inverted */ in cs4210_pinmux_init()
1006 coef &= ~0x0010; in cs4210_pinmux_init()
1028 hda_nid_t spdif_pin = spec->gen.autocfg.dig_out_pins[0]; in cs4210_spdif_automute()
1041 snd_hda_set_pin_ctl(codec, spdif_pin, spdif_present ? PIN_OUT : 0); in cs4210_spdif_automute()
1052 for (i = 0; i < cfg->dig_outs; i++) { in parse_cs421x_digital()
1076 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, in cs421x_init()
1078 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, in cs421x_init()
1080 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, in cs421x_init()
1088 return 0; in cs421x_init()
1095 /* set the upper-limit for mixer amp to 0dB */ in fix_volume_caps()
1097 caps &= ~(0x7f << AC_AMPCAP_NUM_STEPS_SHIFT); in fix_volume_caps()
1098 caps |= ((caps >> AC_AMPCAP_OFFSET_SHIFT) & 0x7f) in fix_volume_caps()
1111 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); in cs421x_parse_auto_config()
1112 if (err < 0) in cs421x_parse_auto_config()
1116 if (err < 0) in cs421x_parse_auto_config()
1128 return 0; in cs421x_parse_auto_config()
1142 snd_hda_codec_write(codec, CS4210_DAC_NID, 0, in cs421x_suspend()
1144 snd_hda_codec_write(codec, CS4210_ADC_NID, 0, in cs421x_suspend()
1149 coef |= 0x0004; /* PDREF */ in cs421x_suspend()
1153 return 0; in cs421x_suspend()
1189 if (err < 0) in patch_cs4210()
1194 return 0; in patch_cs4210()
1213 if (err < 0) in patch_cs4213()
1216 return 0; in patch_cs4213()
1227 HDA_CODEC_ENTRY(0x10134206, "CS4206", patch_cs420x),
1228 HDA_CODEC_ENTRY(0x10134207, "CS4207", patch_cs420x),
1229 HDA_CODEC_ENTRY(0x10134208, "CS4208", patch_cs4208),
1230 HDA_CODEC_ENTRY(0x10134210, "CS4210", patch_cs4210),
1231 HDA_CODEC_ENTRY(0x10134213, "CS4213", patch_cs4213),