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/slab.h>
26 #include <linux/pci.h>
27 #include <linux/module.h>
28 #include <sound/core.h>
29 #include "hda_codec.h"
30 #include "hda_local.h"
31 #include "hda_auto_parser.h"
33 #include "hda_generic.h"
38 /* board config type */
40 CMI_MINIMAL
, /* back 3-jack */
41 CMI_MIN_FP
, /* back 3-jack + front-panel 2-jack */
42 CMI_FULL
, /* back 6-jack + front-panel 2-jack */
43 CMI_FULL_DIG
, /* back 6-jack + front-panel 2-jack + digital I/O */
44 CMI_ALLOUT
, /* back 5-jack + front-panel 2-jack + digital out */
45 CMI_AUTO
, /* let driver guess it */
50 struct hda_gen_spec gen
;
52 /* below are only for static models */
55 unsigned int no_line_in
: 1; /* no line-in (5-jack) */
56 unsigned int front_panel
: 1; /* has front-panel 2-jack */
59 struct hda_multi_out multiout
;
60 hda_nid_t dac_nids
[AUTO_CFG_MAX_OUTS
]; /* NID for each DAC */
64 const hda_nid_t
*adc_nids
;
68 const struct hda_input_mux
*input_mux
;
69 unsigned int cur_mux
[2];
72 int num_channel_modes
;
73 const struct hda_channel_mode
*channel_modes
;
75 struct hda_pcm pcm_rec
[2]; /* PCM information */
77 /* pin default configuration */
78 hda_nid_t pin_nid
[NUM_PINS
];
79 unsigned int def_conf
[NUM_PINS
];
80 unsigned int pin_def_confs
;
82 /* multichannel pins */
83 struct hda_verb multi_init
[9]; /* 2 verbs for each pin + terminator */
89 static int cmi_mux_enum_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
91 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
92 struct cmi_spec
*spec
= codec
->spec
;
93 return snd_hda_input_mux_info(spec
->input_mux
, uinfo
);
96 static int cmi_mux_enum_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
98 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
99 struct cmi_spec
*spec
= codec
->spec
;
100 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
102 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_mux
[adc_idx
];
106 static int cmi_mux_enum_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
108 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
109 struct cmi_spec
*spec
= codec
->spec
;
110 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
112 return snd_hda_input_mux_put(codec
, spec
->input_mux
, ucontrol
,
113 spec
->adc_nids
[adc_idx
], &spec
->cur_mux
[adc_idx
]);
117 * shared line-in, mic for surrounds
120 /* 3-stack / 2 channel */
121 static const struct hda_verb cmi9880_ch2_init
[] = {
122 /* set line-in PIN for input */
123 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
124 /* set mic PIN for input, also enable vref */
125 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
126 /* route front PCM (DAC1) to HP */
127 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
131 /* 3-stack / 6 channel */
132 static const struct hda_verb cmi9880_ch6_init
[] = {
133 /* set line-in PIN for output */
134 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
135 /* set mic PIN for output */
136 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
137 /* route front PCM (DAC1) to HP */
138 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
142 /* 3-stack+front / 8 channel */
143 static const struct hda_verb cmi9880_ch8_init
[] = {
144 /* set line-in PIN for output */
145 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
146 /* set mic PIN for output */
147 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
148 /* route rear-surround PCM (DAC4) to HP */
149 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x03 },
153 static const struct hda_channel_mode cmi9880_channel_modes
[3] = {
154 { 2, cmi9880_ch2_init
},
155 { 6, cmi9880_ch6_init
},
156 { 8, cmi9880_ch8_init
},
159 static int cmi_ch_mode_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
161 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
162 struct cmi_spec
*spec
= codec
->spec
;
163 return snd_hda_ch_mode_info(codec
, uinfo
, spec
->channel_modes
,
164 spec
->num_channel_modes
);
167 static int cmi_ch_mode_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
169 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
170 struct cmi_spec
*spec
= codec
->spec
;
171 return snd_hda_ch_mode_get(codec
, ucontrol
, spec
->channel_modes
,
172 spec
->num_channel_modes
, spec
->multiout
.max_channels
);
175 static int cmi_ch_mode_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
177 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
178 struct cmi_spec
*spec
= codec
->spec
;
179 return snd_hda_ch_mode_put(codec
, ucontrol
, spec
->channel_modes
,
180 spec
->num_channel_modes
, &spec
->multiout
.max_channels
);
185 static const struct snd_kcontrol_new cmi9880_basic_mixer
[] = {
186 /* CMI9880 has no playback volumes! */
187 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT
), /* front */
188 HDA_CODEC_MUTE("Surround Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
189 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
190 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
191 HDA_CODEC_MUTE("Side Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
193 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
194 /* The multiple "Capture Source" controls confuse alsamixer
195 * So call somewhat different..
197 /* .name = "Capture Source", */
198 .name
= "Input Source",
200 .info
= cmi_mux_enum_info
,
201 .get
= cmi_mux_enum_get
,
202 .put
= cmi_mux_enum_put
,
204 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0, HDA_INPUT
),
205 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0, HDA_INPUT
),
206 HDA_CODEC_MUTE("Capture Switch", 0x08, 0, HDA_INPUT
),
207 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0, HDA_INPUT
),
208 HDA_CODEC_VOLUME("Beep Playback Volume", 0x23, 0, HDA_OUTPUT
),
209 HDA_CODEC_MUTE("Beep Playback Switch", 0x23, 0, HDA_OUTPUT
),
216 static const struct snd_kcontrol_new cmi9880_ch_mode_mixer
[] = {
218 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
219 .name
= "Channel Mode",
220 .info
= cmi_ch_mode_info
,
221 .get
= cmi_ch_mode_get
,
222 .put
= cmi_ch_mode_put
,
227 /* AUD-in selections:
228 * 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x1f 0x20
230 static const struct hda_input_mux cmi9880_basic_mux
= {
233 { "Front Mic", 0x5 },
240 static const struct hda_input_mux cmi9880_no_line_mux
= {
243 { "Front Mic", 0x5 },
249 /* front, rear, clfe, rear_surr */
250 static const hda_nid_t cmi9880_dac_nids
[4] = {
251 0x03, 0x04, 0x05, 0x06
254 static const hda_nid_t cmi9880_adc_nids
[2] = {
258 #define CMI_DIG_OUT_NID 0x07
259 #define CMI_DIG_IN_NID 0x0a
263 static const struct hda_verb cmi9880_basic_init
[] = {
264 /* port-D for line out (rear panel) */
265 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
266 /* port-E for HP out (front panel) */
267 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
268 /* route front PCM to HP */
269 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
270 /* port-A for surround (rear panel) */
271 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
272 /* port-G for CLFE (rear panel) */
273 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
274 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x02 },
275 /* port-H for side (rear panel) */
276 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
277 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x01 },
278 /* port-C for line-in (rear panel) */
279 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
280 /* port-B for mic-in (rear panel) with vref */
281 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
282 /* port-F for mic-in (front panel) with vref */
283 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
285 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
286 /* route front mic to ADC1/2 */
287 { 0x08, AC_VERB_SET_CONNECT_SEL
, 0x05 },
288 { 0x09, AC_VERB_SET_CONNECT_SEL
, 0x05 },
292 static const struct hda_verb cmi9880_allout_init
[] = {
293 /* port-D for line out (rear panel) */
294 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
295 /* port-E for HP out (front panel) */
296 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
297 /* route front PCM to HP */
298 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
299 /* port-A for side (rear panel) */
300 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
301 /* port-G for CLFE (rear panel) */
302 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
303 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x02 },
304 /* port-H for side (rear panel) */
305 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
306 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x01 },
307 /* port-C for surround (rear panel) */
308 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
309 /* port-B for mic-in (rear panel) with vref */
310 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
311 /* port-F for mic-in (front panel) with vref */
312 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
314 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
315 /* route front mic to ADC1/2 */
316 { 0x08, AC_VERB_SET_CONNECT_SEL
, 0x05 },
317 { 0x09, AC_VERB_SET_CONNECT_SEL
, 0x05 },
323 static int cmi9880_build_controls(struct hda_codec
*codec
)
325 struct cmi_spec
*spec
= codec
->spec
;
326 struct snd_kcontrol
*kctl
;
329 err
= snd_hda_add_new_ctls(codec
, cmi9880_basic_mixer
);
332 if (spec
->channel_modes
) {
333 err
= snd_hda_add_new_ctls(codec
, cmi9880_ch_mode_mixer
);
337 if (spec
->multiout
.dig_out_nid
) {
338 err
= snd_hda_create_spdif_out_ctls(codec
,
339 spec
->multiout
.dig_out_nid
,
340 spec
->multiout
.dig_out_nid
);
343 err
= snd_hda_create_spdif_share_sw(codec
,
347 spec
->multiout
.share_spdif
= 1;
349 if (spec
->dig_in_nid
) {
350 err
= snd_hda_create_spdif_in_ctls(codec
, spec
->dig_in_nid
);
355 /* assign Capture Source enums to NID */
356 kctl
= snd_hda_find_mixer_ctl(codec
, "Capture Source");
357 for (i
= 0; kctl
&& i
< kctl
->count
; i
++) {
358 err
= snd_hda_add_nid(codec
, kctl
, i
, spec
->adc_nids
[i
]);
365 static int cmi9880_init(struct hda_codec
*codec
)
367 struct cmi_spec
*spec
= codec
->spec
;
368 if (spec
->board_config
== CMI_ALLOUT
)
369 snd_hda_sequence_write(codec
, cmi9880_allout_init
);
371 snd_hda_sequence_write(codec
, cmi9880_basic_init
);
372 if (spec
->board_config
== CMI_AUTO
)
373 snd_hda_sequence_write(codec
, spec
->multi_init
);
378 * Analog playback callbacks
380 static int cmi9880_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
381 struct hda_codec
*codec
,
382 struct snd_pcm_substream
*substream
)
384 struct cmi_spec
*spec
= codec
->spec
;
385 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
389 static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
390 struct hda_codec
*codec
,
391 unsigned int stream_tag
,
393 struct snd_pcm_substream
*substream
)
395 struct cmi_spec
*spec
= codec
->spec
;
396 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
, stream_tag
,
400 static int cmi9880_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
401 struct hda_codec
*codec
,
402 struct snd_pcm_substream
*substream
)
404 struct cmi_spec
*spec
= codec
->spec
;
405 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
411 static int cmi9880_dig_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
412 struct hda_codec
*codec
,
413 struct snd_pcm_substream
*substream
)
415 struct cmi_spec
*spec
= codec
->spec
;
416 return snd_hda_multi_out_dig_open(codec
, &spec
->multiout
);
419 static int cmi9880_dig_playback_pcm_close(struct hda_pcm_stream
*hinfo
,
420 struct hda_codec
*codec
,
421 struct snd_pcm_substream
*substream
)
423 struct cmi_spec
*spec
= codec
->spec
;
424 return snd_hda_multi_out_dig_close(codec
, &spec
->multiout
);
427 static int cmi9880_dig_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
428 struct hda_codec
*codec
,
429 unsigned int stream_tag
,
431 struct snd_pcm_substream
*substream
)
433 struct cmi_spec
*spec
= codec
->spec
;
434 return snd_hda_multi_out_dig_prepare(codec
, &spec
->multiout
, stream_tag
,
441 static int cmi9880_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
442 struct hda_codec
*codec
,
443 unsigned int stream_tag
,
445 struct snd_pcm_substream
*substream
)
447 struct cmi_spec
*spec
= codec
->spec
;
449 snd_hda_codec_setup_stream(codec
, spec
->adc_nids
[substream
->number
],
450 stream_tag
, 0, format
);
454 static int cmi9880_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
455 struct hda_codec
*codec
,
456 struct snd_pcm_substream
*substream
)
458 struct cmi_spec
*spec
= codec
->spec
;
460 snd_hda_codec_cleanup_stream(codec
, spec
->adc_nids
[substream
->number
]);
467 static const struct hda_pcm_stream cmi9880_pcm_analog_playback
= {
471 .nid
= 0x03, /* NID to query formats and rates */
473 .open
= cmi9880_playback_pcm_open
,
474 .prepare
= cmi9880_playback_pcm_prepare
,
475 .cleanup
= cmi9880_playback_pcm_cleanup
479 static const struct hda_pcm_stream cmi9880_pcm_analog_capture
= {
483 .nid
= 0x08, /* NID to query formats and rates */
485 .prepare
= cmi9880_capture_pcm_prepare
,
486 .cleanup
= cmi9880_capture_pcm_cleanup
490 static const struct hda_pcm_stream cmi9880_pcm_digital_playback
= {
494 /* NID is set in cmi9880_build_pcms */
496 .open
= cmi9880_dig_playback_pcm_open
,
497 .close
= cmi9880_dig_playback_pcm_close
,
498 .prepare
= cmi9880_dig_playback_pcm_prepare
502 static const struct hda_pcm_stream cmi9880_pcm_digital_capture
= {
506 /* NID is set in cmi9880_build_pcms */
509 static int cmi9880_build_pcms(struct hda_codec
*codec
)
511 struct cmi_spec
*spec
= codec
->spec
;
512 struct hda_pcm
*info
= spec
->pcm_rec
;
515 codec
->pcm_info
= info
;
517 info
->name
= "CMI9880";
518 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = cmi9880_pcm_analog_playback
;
519 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = cmi9880_pcm_analog_capture
;
521 if (spec
->multiout
.dig_out_nid
|| spec
->dig_in_nid
) {
524 info
->name
= "CMI9880 Digital";
525 info
->pcm_type
= HDA_PCM_TYPE_SPDIF
;
526 if (spec
->multiout
.dig_out_nid
) {
527 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = cmi9880_pcm_digital_playback
;
528 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dig_out_nid
;
530 if (spec
->dig_in_nid
) {
531 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = cmi9880_pcm_digital_capture
;
532 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->dig_in_nid
;
539 static void cmi9880_free(struct hda_codec
*codec
)
547 static const char * const cmi9880_models
[CMI_MODELS
] = {
548 [CMI_MINIMAL
] = "minimal",
549 [CMI_MIN_FP
] = "min_fp",
551 [CMI_FULL_DIG
] = "full_dig",
552 [CMI_ALLOUT
] = "allout",
556 static const struct snd_pci_quirk cmi9880_cfg_tbl
[] = {
557 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG
),
558 SND_PCI_QUIRK(0x1854, 0x002b, "LG LS75", CMI_MINIMAL
),
559 SND_PCI_QUIRK(0x1854, 0x0032, "LG", CMI_FULL_DIG
),
563 static const struct hda_codec_ops cmi9880_patch_ops
= {
564 .build_controls
= cmi9880_build_controls
,
565 .build_pcms
= cmi9880_build_pcms
,
566 .init
= cmi9880_init
,
567 .free
= cmi9880_free
,
571 * stuff for auto-parser
573 static const struct hda_codec_ops cmi_auto_patch_ops
= {
574 .build_controls
= snd_hda_gen_build_controls
,
575 .build_pcms
= snd_hda_gen_build_pcms
,
576 .init
= snd_hda_gen_init
,
577 .free
= snd_hda_gen_free
,
578 .unsol_event
= snd_hda_jack_unsol_event
,
581 static int cmi_parse_auto_config(struct hda_codec
*codec
)
583 struct cmi_spec
*spec
= codec
->spec
;
584 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
587 snd_hda_gen_spec_init(&spec
->gen
);
589 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, NULL
, 0);
592 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
596 codec
->patch_ops
= cmi_auto_patch_ops
;
600 static int patch_cmi9880(struct hda_codec
*codec
)
602 struct cmi_spec
*spec
;
604 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
609 spec
->board_config
= snd_hda_check_board_config(codec
, CMI_MODELS
,
612 if (spec
->board_config
< 0) {
613 snd_printdd(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
615 spec
->board_config
= CMI_AUTO
; /* try everything */
618 if (spec
->board_config
== CMI_AUTO
) {
619 int err
= cmi_parse_auto_config(codec
);
621 snd_hda_gen_free(codec
);
627 /* copy default DAC NIDs */
628 memcpy(spec
->dac_nids
, cmi9880_dac_nids
, sizeof(spec
->dac_nids
));
631 switch (spec
->board_config
) {
634 spec
->channel_modes
= cmi9880_channel_modes
;
635 if (spec
->board_config
== CMI_MINIMAL
)
636 spec
->num_channel_modes
= 2;
638 spec
->front_panel
= 1;
639 spec
->num_channel_modes
= 3;
641 spec
->multiout
.max_channels
= cmi9880_channel_modes
[0].channels
;
642 spec
->input_mux
= &cmi9880_basic_mux
;
646 spec
->front_panel
= 1;
647 spec
->multiout
.max_channels
= 8;
648 spec
->input_mux
= &cmi9880_basic_mux
;
649 if (spec
->board_config
== CMI_FULL_DIG
) {
650 spec
->multiout
.dig_out_nid
= CMI_DIG_OUT_NID
;
651 spec
->dig_in_nid
= CMI_DIG_IN_NID
;
656 spec
->front_panel
= 1;
657 spec
->multiout
.max_channels
= 8;
658 spec
->no_line_in
= 1;
659 spec
->input_mux
= &cmi9880_no_line_mux
;
660 spec
->multiout
.dig_out_nid
= CMI_DIG_OUT_NID
;
664 spec
->multiout
.num_dacs
= spec
->num_dacs
;
665 spec
->multiout
.dac_nids
= spec
->dac_nids
;
667 spec
->adc_nids
= cmi9880_adc_nids
;
669 codec
->patch_ops
= cmi9880_patch_ops
;
677 static const struct hda_codec_preset snd_hda_preset_cmedia
[] = {
678 { .id
= 0x13f69880, .name
= "CMI9880", .patch
= patch_cmi9880
},
679 { .id
= 0x434d4980, .name
= "CMI9880", .patch
= patch_cmi9880
},
683 MODULE_ALIAS("snd-hda-codec-id:13f69880");
684 MODULE_ALIAS("snd-hda-codec-id:434d4980");
686 MODULE_LICENSE("GPL");
687 MODULE_DESCRIPTION("C-Media HD-audio codec");
689 static struct hda_codec_preset_list cmedia_list
= {
690 .preset
= snd_hda_preset_cmedia
,
691 .owner
= THIS_MODULE
,
694 static int __init
patch_cmedia_init(void)
696 return snd_hda_add_codec_preset(&cmedia_list
);
699 static void __exit
patch_cmedia_exit(void)
701 snd_hda_delete_codec_preset(&cmedia_list
);
704 module_init(patch_cmedia_init
)
705 module_exit(patch_cmedia_exit
)