2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for C-Media CMI9880
6 * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
9 * This driver is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This driver is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/init.h>
25 #include <linux/delay.h>
26 #include <linux/slab.h>
27 #include <linux/pci.h>
28 #include <linux/module.h>
29 #include <sound/core.h>
30 #include "hda_codec.h"
31 #include "hda_local.h"
32 #include "hda_auto_parser.h"
34 #include "hda_generic.h"
39 /* board config type */
41 CMI_MINIMAL
, /* back 3-jack */
42 CMI_MIN_FP
, /* back 3-jack + front-panel 2-jack */
43 CMI_FULL
, /* back 6-jack + front-panel 2-jack */
44 CMI_FULL_DIG
, /* back 6-jack + front-panel 2-jack + digital I/O */
45 CMI_ALLOUT
, /* back 5-jack + front-panel 2-jack + digital out */
46 CMI_AUTO
, /* let driver guess it */
51 struct hda_gen_spec gen
;
53 /* below are only for static models */
56 unsigned int no_line_in
: 1; /* no line-in (5-jack) */
57 unsigned int front_panel
: 1; /* has front-panel 2-jack */
60 struct hda_multi_out multiout
;
61 hda_nid_t dac_nids
[AUTO_CFG_MAX_OUTS
]; /* NID for each DAC */
65 const hda_nid_t
*adc_nids
;
69 const struct hda_input_mux
*input_mux
;
70 unsigned int cur_mux
[2];
73 int num_channel_modes
;
74 const struct hda_channel_mode
*channel_modes
;
76 struct hda_pcm pcm_rec
[2]; /* PCM information */
78 /* pin default configuration */
79 hda_nid_t pin_nid
[NUM_PINS
];
80 unsigned int def_conf
[NUM_PINS
];
81 unsigned int pin_def_confs
;
83 /* multichannel pins */
84 struct hda_verb multi_init
[9]; /* 2 verbs for each pin + terminator */
90 static int cmi_mux_enum_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
92 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
93 struct cmi_spec
*spec
= codec
->spec
;
94 return snd_hda_input_mux_info(spec
->input_mux
, uinfo
);
97 static int cmi_mux_enum_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
99 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
100 struct cmi_spec
*spec
= codec
->spec
;
101 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
103 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_mux
[adc_idx
];
107 static int cmi_mux_enum_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
109 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
110 struct cmi_spec
*spec
= codec
->spec
;
111 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
113 return snd_hda_input_mux_put(codec
, spec
->input_mux
, ucontrol
,
114 spec
->adc_nids
[adc_idx
], &spec
->cur_mux
[adc_idx
]);
118 * shared line-in, mic for surrounds
121 /* 3-stack / 2 channel */
122 static const struct hda_verb cmi9880_ch2_init
[] = {
123 /* set line-in PIN for input */
124 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
125 /* set mic PIN for input, also enable vref */
126 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
127 /* route front PCM (DAC1) to HP */
128 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
132 /* 3-stack / 6 channel */
133 static const struct hda_verb cmi9880_ch6_init
[] = {
134 /* set line-in PIN for output */
135 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
136 /* set mic PIN for output */
137 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
138 /* route front PCM (DAC1) to HP */
139 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
143 /* 3-stack+front / 8 channel */
144 static const struct hda_verb cmi9880_ch8_init
[] = {
145 /* set line-in PIN for output */
146 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
147 /* set mic PIN for output */
148 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
149 /* route rear-surround PCM (DAC4) to HP */
150 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x03 },
154 static const struct hda_channel_mode cmi9880_channel_modes
[3] = {
155 { 2, cmi9880_ch2_init
},
156 { 6, cmi9880_ch6_init
},
157 { 8, cmi9880_ch8_init
},
160 static int cmi_ch_mode_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
162 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
163 struct cmi_spec
*spec
= codec
->spec
;
164 return snd_hda_ch_mode_info(codec
, uinfo
, spec
->channel_modes
,
165 spec
->num_channel_modes
);
168 static int cmi_ch_mode_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
170 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
171 struct cmi_spec
*spec
= codec
->spec
;
172 return snd_hda_ch_mode_get(codec
, ucontrol
, spec
->channel_modes
,
173 spec
->num_channel_modes
, spec
->multiout
.max_channels
);
176 static int cmi_ch_mode_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
178 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
179 struct cmi_spec
*spec
= codec
->spec
;
180 return snd_hda_ch_mode_put(codec
, ucontrol
, spec
->channel_modes
,
181 spec
->num_channel_modes
, &spec
->multiout
.max_channels
);
186 static const struct snd_kcontrol_new cmi9880_basic_mixer
[] = {
187 /* CMI9880 has no playback volumes! */
188 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT
), /* front */
189 HDA_CODEC_MUTE("Surround Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
190 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
191 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
192 HDA_CODEC_MUTE("Side Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
194 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
195 /* The multiple "Capture Source" controls confuse alsamixer
196 * So call somewhat different..
198 /* .name = "Capture Source", */
199 .name
= "Input Source",
201 .info
= cmi_mux_enum_info
,
202 .get
= cmi_mux_enum_get
,
203 .put
= cmi_mux_enum_put
,
205 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0, HDA_INPUT
),
206 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0, HDA_INPUT
),
207 HDA_CODEC_MUTE("Capture Switch", 0x08, 0, HDA_INPUT
),
208 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0, HDA_INPUT
),
209 HDA_CODEC_VOLUME("Beep Playback Volume", 0x23, 0, HDA_OUTPUT
),
210 HDA_CODEC_MUTE("Beep Playback Switch", 0x23, 0, HDA_OUTPUT
),
217 static const struct snd_kcontrol_new cmi9880_ch_mode_mixer
[] = {
219 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
220 .name
= "Channel Mode",
221 .info
= cmi_ch_mode_info
,
222 .get
= cmi_ch_mode_get
,
223 .put
= cmi_ch_mode_put
,
228 /* AUD-in selections:
229 * 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x1f 0x20
231 static const struct hda_input_mux cmi9880_basic_mux
= {
234 { "Front Mic", 0x5 },
241 static const struct hda_input_mux cmi9880_no_line_mux
= {
244 { "Front Mic", 0x5 },
250 /* front, rear, clfe, rear_surr */
251 static const hda_nid_t cmi9880_dac_nids
[4] = {
252 0x03, 0x04, 0x05, 0x06
255 static const hda_nid_t cmi9880_adc_nids
[2] = {
259 #define CMI_DIG_OUT_NID 0x07
260 #define CMI_DIG_IN_NID 0x0a
264 static const struct hda_verb cmi9880_basic_init
[] = {
265 /* port-D for line out (rear panel) */
266 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
267 /* port-E for HP out (front panel) */
268 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
269 /* route front PCM to HP */
270 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
271 /* port-A for surround (rear panel) */
272 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
273 /* port-G for CLFE (rear panel) */
274 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
275 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x02 },
276 /* port-H for side (rear panel) */
277 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
278 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x01 },
279 /* port-C for line-in (rear panel) */
280 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
281 /* port-B for mic-in (rear panel) with vref */
282 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
283 /* port-F for mic-in (front panel) with vref */
284 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
286 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
287 /* route front mic to ADC1/2 */
288 { 0x08, AC_VERB_SET_CONNECT_SEL
, 0x05 },
289 { 0x09, AC_VERB_SET_CONNECT_SEL
, 0x05 },
293 static const struct hda_verb cmi9880_allout_init
[] = {
294 /* port-D for line out (rear panel) */
295 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
296 /* port-E for HP out (front panel) */
297 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
298 /* route front PCM to HP */
299 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
300 /* port-A for side (rear panel) */
301 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
302 /* port-G for CLFE (rear panel) */
303 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
304 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x02 },
305 /* port-H for side (rear panel) */
306 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
307 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x01 },
308 /* port-C for surround (rear panel) */
309 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
310 /* port-B for mic-in (rear panel) with vref */
311 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
312 /* port-F for mic-in (front panel) with vref */
313 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
315 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
316 /* route front mic to ADC1/2 */
317 { 0x08, AC_VERB_SET_CONNECT_SEL
, 0x05 },
318 { 0x09, AC_VERB_SET_CONNECT_SEL
, 0x05 },
324 static int cmi9880_build_controls(struct hda_codec
*codec
)
326 struct cmi_spec
*spec
= codec
->spec
;
327 struct snd_kcontrol
*kctl
;
330 err
= snd_hda_add_new_ctls(codec
, cmi9880_basic_mixer
);
333 if (spec
->channel_modes
) {
334 err
= snd_hda_add_new_ctls(codec
, cmi9880_ch_mode_mixer
);
338 if (spec
->multiout
.dig_out_nid
) {
339 err
= snd_hda_create_spdif_out_ctls(codec
,
340 spec
->multiout
.dig_out_nid
,
341 spec
->multiout
.dig_out_nid
);
344 err
= snd_hda_create_spdif_share_sw(codec
,
348 spec
->multiout
.share_spdif
= 1;
350 if (spec
->dig_in_nid
) {
351 err
= snd_hda_create_spdif_in_ctls(codec
, spec
->dig_in_nid
);
356 /* assign Capture Source enums to NID */
357 kctl
= snd_hda_find_mixer_ctl(codec
, "Capture Source");
358 for (i
= 0; kctl
&& i
< kctl
->count
; i
++) {
359 err
= snd_hda_add_nid(codec
, kctl
, i
, spec
->adc_nids
[i
]);
366 static int cmi9880_init(struct hda_codec
*codec
)
368 struct cmi_spec
*spec
= codec
->spec
;
369 if (spec
->board_config
== CMI_ALLOUT
)
370 snd_hda_sequence_write(codec
, cmi9880_allout_init
);
372 snd_hda_sequence_write(codec
, cmi9880_basic_init
);
373 if (spec
->board_config
== CMI_AUTO
)
374 snd_hda_sequence_write(codec
, spec
->multi_init
);
379 * Analog playback callbacks
381 static int cmi9880_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
382 struct hda_codec
*codec
,
383 struct snd_pcm_substream
*substream
)
385 struct cmi_spec
*spec
= codec
->spec
;
386 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
390 static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
391 struct hda_codec
*codec
,
392 unsigned int stream_tag
,
394 struct snd_pcm_substream
*substream
)
396 struct cmi_spec
*spec
= codec
->spec
;
397 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
, stream_tag
,
401 static int cmi9880_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
402 struct hda_codec
*codec
,
403 struct snd_pcm_substream
*substream
)
405 struct cmi_spec
*spec
= codec
->spec
;
406 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
412 static int cmi9880_dig_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
413 struct hda_codec
*codec
,
414 struct snd_pcm_substream
*substream
)
416 struct cmi_spec
*spec
= codec
->spec
;
417 return snd_hda_multi_out_dig_open(codec
, &spec
->multiout
);
420 static int cmi9880_dig_playback_pcm_close(struct hda_pcm_stream
*hinfo
,
421 struct hda_codec
*codec
,
422 struct snd_pcm_substream
*substream
)
424 struct cmi_spec
*spec
= codec
->spec
;
425 return snd_hda_multi_out_dig_close(codec
, &spec
->multiout
);
428 static int cmi9880_dig_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
429 struct hda_codec
*codec
,
430 unsigned int stream_tag
,
432 struct snd_pcm_substream
*substream
)
434 struct cmi_spec
*spec
= codec
->spec
;
435 return snd_hda_multi_out_dig_prepare(codec
, &spec
->multiout
, stream_tag
,
442 static int cmi9880_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
443 struct hda_codec
*codec
,
444 unsigned int stream_tag
,
446 struct snd_pcm_substream
*substream
)
448 struct cmi_spec
*spec
= codec
->spec
;
450 snd_hda_codec_setup_stream(codec
, spec
->adc_nids
[substream
->number
],
451 stream_tag
, 0, format
);
455 static int cmi9880_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
456 struct hda_codec
*codec
,
457 struct snd_pcm_substream
*substream
)
459 struct cmi_spec
*spec
= codec
->spec
;
461 snd_hda_codec_cleanup_stream(codec
, spec
->adc_nids
[substream
->number
]);
468 static const struct hda_pcm_stream cmi9880_pcm_analog_playback
= {
472 .nid
= 0x03, /* NID to query formats and rates */
474 .open
= cmi9880_playback_pcm_open
,
475 .prepare
= cmi9880_playback_pcm_prepare
,
476 .cleanup
= cmi9880_playback_pcm_cleanup
480 static const struct hda_pcm_stream cmi9880_pcm_analog_capture
= {
484 .nid
= 0x08, /* NID to query formats and rates */
486 .prepare
= cmi9880_capture_pcm_prepare
,
487 .cleanup
= cmi9880_capture_pcm_cleanup
491 static const struct hda_pcm_stream cmi9880_pcm_digital_playback
= {
495 /* NID is set in cmi9880_build_pcms */
497 .open
= cmi9880_dig_playback_pcm_open
,
498 .close
= cmi9880_dig_playback_pcm_close
,
499 .prepare
= cmi9880_dig_playback_pcm_prepare
503 static const struct hda_pcm_stream cmi9880_pcm_digital_capture
= {
507 /* NID is set in cmi9880_build_pcms */
510 static int cmi9880_build_pcms(struct hda_codec
*codec
)
512 struct cmi_spec
*spec
= codec
->spec
;
513 struct hda_pcm
*info
= spec
->pcm_rec
;
516 codec
->pcm_info
= info
;
518 info
->name
= "CMI9880";
519 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = cmi9880_pcm_analog_playback
;
520 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = cmi9880_pcm_analog_capture
;
522 if (spec
->multiout
.dig_out_nid
|| spec
->dig_in_nid
) {
525 info
->name
= "CMI9880 Digital";
526 info
->pcm_type
= HDA_PCM_TYPE_SPDIF
;
527 if (spec
->multiout
.dig_out_nid
) {
528 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = cmi9880_pcm_digital_playback
;
529 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dig_out_nid
;
531 if (spec
->dig_in_nid
) {
532 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = cmi9880_pcm_digital_capture
;
533 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->dig_in_nid
;
540 static void cmi9880_free(struct hda_codec
*codec
)
548 static const char * const cmi9880_models
[CMI_MODELS
] = {
549 [CMI_MINIMAL
] = "minimal",
550 [CMI_MIN_FP
] = "min_fp",
552 [CMI_FULL_DIG
] = "full_dig",
553 [CMI_ALLOUT
] = "allout",
557 static const struct snd_pci_quirk cmi9880_cfg_tbl
[] = {
558 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG
),
559 SND_PCI_QUIRK(0x1854, 0x002b, "LG LS75", CMI_MINIMAL
),
560 SND_PCI_QUIRK(0x1854, 0x0032, "LG", CMI_FULL_DIG
),
564 static const struct hda_codec_ops cmi9880_patch_ops
= {
565 .build_controls
= cmi9880_build_controls
,
566 .build_pcms
= cmi9880_build_pcms
,
567 .init
= cmi9880_init
,
568 .free
= cmi9880_free
,
572 * stuff for auto-parser
574 static const struct hda_codec_ops cmi_auto_patch_ops
= {
575 .build_controls
= snd_hda_gen_build_controls
,
576 .build_pcms
= snd_hda_gen_build_pcms
,
577 .init
= snd_hda_gen_init
,
578 .free
= snd_hda_gen_free
,
579 .unsol_event
= snd_hda_jack_unsol_event
,
582 static int cmi_parse_auto_config(struct hda_codec
*codec
)
584 struct cmi_spec
*spec
= codec
->spec
;
585 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
588 snd_hda_gen_spec_init(&spec
->gen
);
590 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, NULL
, 0);
593 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
597 codec
->patch_ops
= cmi_auto_patch_ops
;
601 static int patch_cmi9880(struct hda_codec
*codec
)
603 struct cmi_spec
*spec
;
605 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
610 spec
->board_config
= snd_hda_check_board_config(codec
, CMI_MODELS
,
613 if (spec
->board_config
< 0) {
614 snd_printdd(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
616 spec
->board_config
= CMI_AUTO
; /* try everything */
619 if (spec
->board_config
== CMI_AUTO
) {
620 int err
= cmi_parse_auto_config(codec
);
622 snd_hda_gen_free(codec
);
628 /* copy default DAC NIDs */
629 memcpy(spec
->dac_nids
, cmi9880_dac_nids
, sizeof(spec
->dac_nids
));
632 switch (spec
->board_config
) {
635 spec
->channel_modes
= cmi9880_channel_modes
;
636 if (spec
->board_config
== CMI_MINIMAL
)
637 spec
->num_channel_modes
= 2;
639 spec
->front_panel
= 1;
640 spec
->num_channel_modes
= 3;
642 spec
->multiout
.max_channels
= cmi9880_channel_modes
[0].channels
;
643 spec
->input_mux
= &cmi9880_basic_mux
;
647 spec
->front_panel
= 1;
648 spec
->multiout
.max_channels
= 8;
649 spec
->input_mux
= &cmi9880_basic_mux
;
650 if (spec
->board_config
== CMI_FULL_DIG
) {
651 spec
->multiout
.dig_out_nid
= CMI_DIG_OUT_NID
;
652 spec
->dig_in_nid
= CMI_DIG_IN_NID
;
657 spec
->front_panel
= 1;
658 spec
->multiout
.max_channels
= 8;
659 spec
->no_line_in
= 1;
660 spec
->input_mux
= &cmi9880_no_line_mux
;
661 spec
->multiout
.dig_out_nid
= CMI_DIG_OUT_NID
;
665 spec
->multiout
.num_dacs
= spec
->num_dacs
;
666 spec
->multiout
.dac_nids
= spec
->dac_nids
;
668 spec
->adc_nids
= cmi9880_adc_nids
;
670 codec
->patch_ops
= cmi9880_patch_ops
;
678 static const struct hda_codec_preset snd_hda_preset_cmedia
[] = {
679 { .id
= 0x13f69880, .name
= "CMI9880", .patch
= patch_cmi9880
},
680 { .id
= 0x434d4980, .name
= "CMI9880", .patch
= patch_cmi9880
},
684 MODULE_ALIAS("snd-hda-codec-id:13f69880");
685 MODULE_ALIAS("snd-hda-codec-id:434d4980");
687 MODULE_LICENSE("GPL");
688 MODULE_DESCRIPTION("C-Media HD-audio codec");
690 static struct hda_codec_preset_list cmedia_list
= {
691 .preset
= snd_hda_preset_cmedia
,
692 .owner
= THIS_MODULE
,
695 static int __init
patch_cmedia_init(void)
697 return snd_hda_add_codec_preset(&cmedia_list
);
700 static void __exit
patch_cmedia_exit(void)
702 snd_hda_delete_codec_preset(&cmedia_list
);
705 module_init(patch_cmedia_init
)
706 module_exit(patch_cmedia_exit
)