2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Universal Interface for Intel High Definition Audio Codec
|
|
|
|
*
|
|
|
|
* HD audio interface patch for C-Media CMI9880
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This driver is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This driver is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/pci.h>
|
2011-07-15 23:38:28 +07:00
|
|
|
#include <linux/module.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
#include <sound/core.h>
|
|
|
|
#include "hda_codec.h"
|
|
|
|
#include "hda_local.h"
|
2012-05-07 22:42:31 +07:00
|
|
|
#include "hda_auto_parser.h"
|
2012-12-19 23:35:47 +07:00
|
|
|
#include "hda_jack.h"
|
|
|
|
#include "hda_generic.h"
|
|
|
|
|
2005-04-08 20:05:13 +07:00
|
|
|
#define NUM_PINS 11
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
|
|
|
|
/* board config type */
|
|
|
|
enum {
|
|
|
|
CMI_MINIMAL, /* back 3-jack */
|
|
|
|
CMI_MIN_FP, /* back 3-jack + front-panel 2-jack */
|
|
|
|
CMI_FULL, /* back 6-jack + front-panel 2-jack */
|
|
|
|
CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */
|
|
|
|
CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */
|
2005-04-08 20:05:13 +07:00
|
|
|
CMI_AUTO, /* let driver guess it */
|
2006-11-24 23:07:44 +07:00
|
|
|
CMI_MODELS
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cmi_spec {
|
2012-12-19 23:35:47 +07:00
|
|
|
struct hda_gen_spec gen;
|
|
|
|
|
|
|
|
/* below are only for static models */
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
int board_config;
|
|
|
|
unsigned int no_line_in: 1; /* no line-in (5-jack) */
|
|
|
|
unsigned int front_panel: 1; /* has front-panel 2-jack */
|
|
|
|
|
|
|
|
/* playback */
|
|
|
|
struct hda_multi_out multiout;
|
2007-10-22 22:20:10 +07:00
|
|
|
hda_nid_t dac_nids[AUTO_CFG_MAX_OUTS]; /* NID for each DAC */
|
2005-06-13 19:16:38 +07:00
|
|
|
int num_dacs;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* capture */
|
2011-05-02 16:34:20 +07:00
|
|
|
const hda_nid_t *adc_nids;
|
2005-04-17 05:20:36 +07:00
|
|
|
hda_nid_t dig_in_nid;
|
|
|
|
|
|
|
|
/* capture source */
|
|
|
|
const struct hda_input_mux *input_mux;
|
|
|
|
unsigned int cur_mux[2];
|
|
|
|
|
|
|
|
/* channel mode */
|
2005-11-17 17:06:29 +07:00
|
|
|
int num_channel_modes;
|
|
|
|
const struct hda_channel_mode *channel_modes;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
struct hda_pcm pcm_rec[2]; /* PCM information */
|
2005-04-08 20:05:13 +07:00
|
|
|
|
tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-14 22:09:05 +07:00
|
|
|
/* pin default configuration */
|
2005-04-08 20:05:13 +07:00
|
|
|
hda_nid_t pin_nid[NUM_PINS];
|
|
|
|
unsigned int def_conf[NUM_PINS];
|
|
|
|
unsigned int pin_def_confs;
|
|
|
|
|
|
|
|
/* multichannel pins */
|
|
|
|
struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* input MUX
|
|
|
|
*/
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_input_mux_info(spec->input_mux, uinfo);
|
|
|
|
}
|
|
|
|
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
|
|
|
|
|
|
|
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
|
|
|
|
|
|
|
return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
|
|
|
|
spec->adc_nids[adc_idx], &spec->cur_mux[adc_idx]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared line-in, mic for surrounds
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* 3-stack / 2 channel */
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_verb cmi9880_ch2_init[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set line-in PIN for input */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set mic PIN for input, also enable vref */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front PCM (DAC1) to HP */
|
|
|
|
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 3-stack / 6 channel */
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_verb cmi9880_ch6_init[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set line-in PIN for output */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set mic PIN for output */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front PCM (DAC1) to HP */
|
|
|
|
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 3-stack+front / 8 channel */
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_verb cmi9880_ch8_init[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set line-in PIN for output */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* set mic PIN for output */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route rear-surround PCM (DAC4) to HP */
|
|
|
|
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x03 },
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_channel_mode cmi9880_channel_modes[3] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
{ 2, cmi9880_ch2_init },
|
|
|
|
{ 6, cmi9880_ch6_init },
|
|
|
|
{ 8, cmi9880_ch8_init },
|
|
|
|
};
|
|
|
|
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_ch_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
2005-11-17 17:06:29 +07:00
|
|
|
return snd_hda_ch_mode_info(codec, uinfo, spec->channel_modes,
|
|
|
|
spec->num_channel_modes);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_ch_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
2005-11-17 17:06:29 +07:00
|
|
|
return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_modes,
|
|
|
|
spec->num_channel_modes, spec->multiout.max_channels);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2005-11-17 20:57:47 +07:00
|
|
|
static int cmi_ch_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
2005-11-17 17:06:29 +07:00
|
|
|
return snd_hda_ch_mode_put(codec, ucontrol, spec->channel_modes,
|
|
|
|
spec->num_channel_modes, &spec->multiout.max_channels);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct snd_kcontrol_new cmi9880_basic_mixer[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* CMI9880 has no playback volumes! */
|
|
|
|
HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), /* front */
|
|
|
|
HDA_CODEC_MUTE("Surround Playback Switch", 0x04, 0x0, HDA_OUTPUT),
|
|
|
|
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT),
|
|
|
|
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT),
|
|
|
|
HDA_CODEC_MUTE("Side Playback Switch", 0x06, 0x0, HDA_OUTPUT),
|
|
|
|
{
|
|
|
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
|
|
/* The multiple "Capture Source" controls confuse alsamixer
|
|
|
|
* So call somewhat different..
|
|
|
|
*/
|
|
|
|
/* .name = "Capture Source", */
|
|
|
|
.name = "Input Source",
|
|
|
|
.count = 2,
|
|
|
|
.info = cmi_mux_enum_info,
|
|
|
|
.get = cmi_mux_enum_get,
|
|
|
|
.put = cmi_mux_enum_put,
|
|
|
|
},
|
|
|
|
HDA_CODEC_VOLUME("Capture Volume", 0x08, 0, HDA_INPUT),
|
|
|
|
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0, HDA_INPUT),
|
|
|
|
HDA_CODEC_MUTE("Capture Switch", 0x08, 0, HDA_INPUT),
|
|
|
|
HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0, HDA_INPUT),
|
2009-11-03 21:47:25 +07:00
|
|
|
HDA_CODEC_VOLUME("Beep Playback Volume", 0x23, 0, HDA_OUTPUT),
|
|
|
|
HDA_CODEC_MUTE("Beep Playback Switch", 0x23, 0, HDA_OUTPUT),
|
2005-04-17 05:20:36 +07:00
|
|
|
{ } /* end */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared I/O pins
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct snd_kcontrol_new cmi9880_ch_mode_mixer[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
|
|
|
.name = "Channel Mode",
|
|
|
|
.info = cmi_ch_mode_info,
|
|
|
|
.get = cmi_ch_mode_get,
|
|
|
|
.put = cmi_ch_mode_put,
|
|
|
|
},
|
|
|
|
{ } /* end */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* AUD-in selections:
|
|
|
|
* 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x1f 0x20
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_input_mux cmi9880_basic_mux = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.num_items = 4,
|
|
|
|
.items = {
|
|
|
|
{ "Front Mic", 0x5 },
|
|
|
|
{ "Rear Mic", 0x2 },
|
|
|
|
{ "Line", 0x1 },
|
|
|
|
{ "CD", 0x7 },
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_input_mux cmi9880_no_line_mux = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.num_items = 3,
|
|
|
|
.items = {
|
|
|
|
{ "Front Mic", 0x5 },
|
|
|
|
{ "Rear Mic", 0x2 },
|
|
|
|
{ "CD", 0x7 },
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* front, rear, clfe, rear_surr */
|
2011-05-02 16:34:20 +07:00
|
|
|
static const hda_nid_t cmi9880_dac_nids[4] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
0x03, 0x04, 0x05, 0x06
|
|
|
|
};
|
|
|
|
/* ADC0, ADC1 */
|
2011-05-02 16:34:20 +07:00
|
|
|
static const hda_nid_t cmi9880_adc_nids[2] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
0x08, 0x09
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CMI_DIG_OUT_NID 0x07
|
|
|
|
#define CMI_DIG_IN_NID 0x0a
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_verb cmi9880_basic_init[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-D for line out (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-E for HP out (front panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front PCM to HP */
|
|
|
|
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
|
|
|
|
/* port-A for surround (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-G for CLFE (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-03-25 02:47:35 +07:00
|
|
|
{ 0x1f, AC_VERB_SET_CONNECT_SEL, 0x02 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-H for side (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-03-25 02:47:35 +07:00
|
|
|
{ 0x20, AC_VERB_SET_CONNECT_SEL, 0x01 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-C for line-in (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-B for mic-in (rear panel) with vref */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-F for mic-in (front panel) with vref */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* CD-in */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front mic to ADC1/2 */
|
|
|
|
{ 0x08, AC_VERB_SET_CONNECT_SEL, 0x05 },
|
|
|
|
{ 0x09, AC_VERB_SET_CONNECT_SEL, 0x05 },
|
|
|
|
{} /* terminator */
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_verb cmi9880_allout_init[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-D for line out (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-E for HP out (front panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front PCM to HP */
|
|
|
|
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
|
|
|
|
/* port-A for side (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-G for CLFE (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-03-25 02:47:35 +07:00
|
|
|
{ 0x1f, AC_VERB_SET_CONNECT_SEL, 0x02 },
|
|
|
|
/* port-H for side (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-03-25 02:47:35 +07:00
|
|
|
{ 0x20, AC_VERB_SET_CONNECT_SEL, 0x01 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-C for surround (rear panel) */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-B for mic-in (rear panel) with vref */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* port-F for mic-in (front panel) with vref */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* CD-in */
|
2005-06-13 19:16:38 +07:00
|
|
|
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
|
2005-04-17 05:20:36 +07:00
|
|
|
/* route front mic to ADC1/2 */
|
|
|
|
{ 0x08, AC_VERB_SET_CONNECT_SEL, 0x05 },
|
|
|
|
{ 0x09, AC_VERB_SET_CONNECT_SEL, 0x05 },
|
|
|
|
{} /* terminator */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
static int cmi9880_build_controls(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
2009-12-08 22:13:32 +07:00
|
|
|
struct snd_kcontrol *kctl;
|
|
|
|
int i, err;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
err = snd_hda_add_new_ctls(codec, cmi9880_basic_mixer);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
2005-11-17 17:06:29 +07:00
|
|
|
if (spec->channel_modes) {
|
2005-04-17 05:20:36 +07:00
|
|
|
err = snd_hda_add_new_ctls(codec, cmi9880_ch_mode_mixer);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
if (spec->multiout.dig_out_nid) {
|
2011-06-02 00:14:18 +07:00
|
|
|
err = snd_hda_create_spdif_out_ctls(codec,
|
|
|
|
spec->multiout.dig_out_nid,
|
|
|
|
spec->multiout.dig_out_nid);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (err < 0)
|
|
|
|
return err;
|
2008-02-13 00:37:26 +07:00
|
|
|
err = snd_hda_create_spdif_share_sw(codec,
|
|
|
|
&spec->multiout);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
spec->multiout.share_spdif = 1;
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
if (spec->dig_in_nid) {
|
|
|
|
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
}
|
2009-12-08 22:13:32 +07:00
|
|
|
|
|
|
|
/* assign Capture Source enums to NID */
|
|
|
|
kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
|
|
|
|
for (i = 0; kctl && i < kctl->count; i++) {
|
2009-12-23 14:31:59 +07:00
|
|
|
err = snd_hda_add_nid(codec, kctl, i, spec->adc_nids[i]);
|
2009-12-08 22:13:32 +07:00
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cmi9880_init(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
if (spec->board_config == CMI_ALLOUT)
|
|
|
|
snd_hda_sequence_write(codec, cmi9880_allout_init);
|
|
|
|
else
|
|
|
|
snd_hda_sequence_write(codec, cmi9880_basic_init);
|
2005-04-08 20:05:13 +07:00
|
|
|
if (spec->board_config == CMI_AUTO)
|
|
|
|
snd_hda_sequence_write(codec, spec->multi_init);
|
2005-04-17 05:20:36 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Analog playback callbacks
|
|
|
|
*/
|
|
|
|
static int cmi9880_playback_pcm_open(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
2008-02-13 00:37:26 +07:00
|
|
|
return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
|
|
|
|
hinfo);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
|
|
|
unsigned int stream_tag,
|
|
|
|
unsigned int format,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag,
|
|
|
|
format, substream);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cmi9880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Digital out
|
|
|
|
*/
|
|
|
|
static int cmi9880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_multi_out_dig_open(codec, &spec->multiout);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cmi9880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_multi_out_dig_close(codec, &spec->multiout);
|
|
|
|
}
|
|
|
|
|
2007-04-05 19:51:48 +07:00
|
|
|
static int cmi9880_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
|
|
|
unsigned int stream_tag,
|
|
|
|
unsigned int format,
|
|
|
|
struct snd_pcm_substream *substream)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
|
|
|
|
format, substream);
|
|
|
|
}
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Analog capture
|
|
|
|
*/
|
|
|
|
static int cmi9880_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
|
|
|
unsigned int stream_tag,
|
|
|
|
unsigned int format,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
|
|
|
|
snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
|
|
|
|
stream_tag, 0, format);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cmi9880_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
|
|
|
|
struct hda_codec *codec,
|
2005-11-17 20:57:47 +07:00
|
|
|
struct snd_pcm_substream *substream)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
|
2008-03-18 15:57:50 +07:00
|
|
|
snd_hda_codec_cleanup_stream(codec, spec->adc_nids[substream->number]);
|
2005-04-17 05:20:36 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_pcm_stream cmi9880_pcm_analog_playback = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.substreams = 1,
|
|
|
|
.channels_min = 2,
|
|
|
|
.channels_max = 8,
|
|
|
|
.nid = 0x03, /* NID to query formats and rates */
|
|
|
|
.ops = {
|
|
|
|
.open = cmi9880_playback_pcm_open,
|
|
|
|
.prepare = cmi9880_playback_pcm_prepare,
|
|
|
|
.cleanup = cmi9880_playback_pcm_cleanup
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_pcm_stream cmi9880_pcm_analog_capture = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.substreams = 2,
|
|
|
|
.channels_min = 2,
|
|
|
|
.channels_max = 2,
|
|
|
|
.nid = 0x08, /* NID to query formats and rates */
|
|
|
|
.ops = {
|
|
|
|
.prepare = cmi9880_capture_pcm_prepare,
|
|
|
|
.cleanup = cmi9880_capture_pcm_cleanup
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_pcm_stream cmi9880_pcm_digital_playback = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.substreams = 1,
|
|
|
|
.channels_min = 2,
|
|
|
|
.channels_max = 2,
|
|
|
|
/* NID is set in cmi9880_build_pcms */
|
|
|
|
.ops = {
|
|
|
|
.open = cmi9880_dig_playback_pcm_open,
|
2007-04-05 19:51:48 +07:00
|
|
|
.close = cmi9880_dig_playback_pcm_close,
|
|
|
|
.prepare = cmi9880_dig_playback_pcm_prepare
|
2005-04-17 05:20:36 +07:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_pcm_stream cmi9880_pcm_digital_capture = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.substreams = 1,
|
|
|
|
.channels_min = 2,
|
|
|
|
.channels_max = 2,
|
|
|
|
/* NID is set in cmi9880_build_pcms */
|
|
|
|
};
|
|
|
|
|
|
|
|
static int cmi9880_build_pcms(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
struct hda_pcm *info = spec->pcm_rec;
|
|
|
|
|
|
|
|
codec->num_pcms = 1;
|
|
|
|
codec->pcm_info = info;
|
|
|
|
|
|
|
|
info->name = "CMI9880";
|
|
|
|
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = cmi9880_pcm_analog_playback;
|
|
|
|
info->stream[SNDRV_PCM_STREAM_CAPTURE] = cmi9880_pcm_analog_capture;
|
|
|
|
|
|
|
|
if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
|
|
|
|
codec->num_pcms++;
|
|
|
|
info++;
|
|
|
|
info->name = "CMI9880 Digital";
|
[ALSA] hda-intel - Fix PCM device number assignment
In the current scheme, PCM device numbers are assigned incrementally
in the order of codecs. This causes problems when the codec number
is irregular, e.g. codec #0 for HDMI and codec #1 for analog. Then
the HDMI becomes the first PCM, which is picked up as the default
output device. Unfortuantely this doesn't work well with normal
setups.
This patch introduced the fixed device numbers for the PCM types,
namely, analog, SPDIF, HDMI and modem. The PCM devices are assigned
according to the corresponding PCM type. After this patch, HDMI will
be always assigned to PCM #3, SPDIF to PCM #1, and the first analog
to PCM #0, etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-02-06 20:03:20 +07:00
|
|
|
info->pcm_type = HDA_PCM_TYPE_SPDIF;
|
2005-04-17 05:20:36 +07:00
|
|
|
if (spec->multiout.dig_out_nid) {
|
|
|
|
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = cmi9880_pcm_digital_playback;
|
|
|
|
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid;
|
|
|
|
}
|
|
|
|
if (spec->dig_in_nid) {
|
|
|
|
info->stream[SNDRV_PCM_STREAM_CAPTURE] = cmi9880_pcm_digital_capture;
|
|
|
|
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cmi9880_free(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
kfree(codec->spec);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
2011-01-17 17:29:34 +07:00
|
|
|
static const char * const cmi9880_models[CMI_MODELS] = {
|
2006-11-24 23:07:44 +07:00
|
|
|
[CMI_MINIMAL] = "minimal",
|
|
|
|
[CMI_MIN_FP] = "min_fp",
|
|
|
|
[CMI_FULL] = "full",
|
|
|
|
[CMI_FULL_DIG] = "full_dig",
|
|
|
|
[CMI_ALLOUT] = "allout",
|
|
|
|
[CMI_AUTO] = "auto",
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct snd_pci_quirk cmi9880_cfg_tbl[] = {
|
2006-11-24 23:07:44 +07:00
|
|
|
SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG),
|
2008-05-30 21:54:49 +07:00
|
|
|
SND_PCI_QUIRK(0x1854, 0x002b, "LG LS75", CMI_MINIMAL),
|
2008-04-14 18:26:53 +07:00
|
|
|
SND_PCI_QUIRK(0x1854, 0x0032, "LG", CMI_FULL_DIG),
|
2005-04-17 05:20:36 +07:00
|
|
|
{} /* terminator */
|
|
|
|
};
|
|
|
|
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_codec_ops cmi9880_patch_ops = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.build_controls = cmi9880_build_controls,
|
|
|
|
.build_pcms = cmi9880_build_pcms,
|
|
|
|
.init = cmi9880_init,
|
|
|
|
.free = cmi9880_free,
|
|
|
|
};
|
|
|
|
|
2012-12-19 23:35:47 +07:00
|
|
|
/*
|
|
|
|
* stuff for auto-parser
|
|
|
|
*/
|
|
|
|
static const struct hda_codec_ops cmi_auto_patch_ops = {
|
|
|
|
.build_controls = snd_hda_gen_build_controls,
|
|
|
|
.build_pcms = snd_hda_gen_build_pcms,
|
|
|
|
.init = snd_hda_gen_init,
|
|
|
|
.free = snd_hda_gen_free,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int cmi_parse_auto_config(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec = codec->spec;
|
|
|
|
struct auto_pin_cfg *cfg = &spec->gen.autocfg;
|
|
|
|
int err;
|
|
|
|
|
|
|
|
snd_hda_gen_spec_init(&spec->gen);
|
|
|
|
|
|
|
|
err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
err = snd_hda_gen_parse_auto_config(codec, cfg);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
codec->patch_ops = cmi_auto_patch_ops;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
static int patch_cmi9880(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
struct cmi_spec *spec;
|
|
|
|
|
[ALSA] Replace with kzalloc() - pci stuff
AD1889 driver,ATIIXP driver,ATIIXP-modem driver,AZT3328 driver
BT87x driver,CMIPCI driver,CS4281 driver,ENS1370/1+ driver
ES1938 driver,ES1968 driver,FM801 driver,Intel8x0 driver
Intel8x0-modem driver,Maestro3 driver,SonicVibes driver,VIA82xx driver
VIA82xx-modem driver,AC97 Codec,AK4531 codec,au88x0 driver
CA0106 driver,CS46xx driver,EMU10K1/EMU10K2 driver,HDA Codec driver
HDA generic driver,HDA Intel driver,ICE1712 driver,ICE1724 driver
KORG1212 driver,MIXART driver,NM256 driver,Trident driver,YMFPCI driver
Replace kcalloc(1,..) with kzalloc().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-09-09 19:21:46 +07:00
|
|
|
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (spec == NULL)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
codec->spec = spec;
|
2006-11-24 23:07:44 +07:00
|
|
|
spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
|
|
|
|
cmi9880_models,
|
|
|
|
cmi9880_cfg_tbl);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (spec->board_config < 0) {
|
2009-07-28 21:01:20 +07:00
|
|
|
snd_printdd(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
|
|
|
|
codec->chip_name);
|
2005-04-08 20:05:13 +07:00
|
|
|
spec->board_config = CMI_AUTO; /* try everything */
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2012-12-19 23:35:47 +07:00
|
|
|
if (spec->board_config == CMI_AUTO) {
|
|
|
|
int err = cmi_parse_auto_config(codec);
|
|
|
|
if (err < 0) {
|
|
|
|
snd_hda_gen_free(codec);
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-08 20:05:13 +07:00
|
|
|
/* copy default DAC NIDs */
|
|
|
|
memcpy(spec->dac_nids, cmi9880_dac_nids, sizeof(spec->dac_nids));
|
2005-06-13 19:16:38 +07:00
|
|
|
spec->num_dacs = 4;
|
2005-04-08 20:05:13 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
switch (spec->board_config) {
|
|
|
|
case CMI_MINIMAL:
|
|
|
|
case CMI_MIN_FP:
|
2005-11-17 17:06:29 +07:00
|
|
|
spec->channel_modes = cmi9880_channel_modes;
|
2005-04-17 05:20:36 +07:00
|
|
|
if (spec->board_config == CMI_MINIMAL)
|
2005-11-17 17:06:29 +07:00
|
|
|
spec->num_channel_modes = 2;
|
2005-04-17 05:20:36 +07:00
|
|
|
else {
|
|
|
|
spec->front_panel = 1;
|
2005-11-17 17:06:29 +07:00
|
|
|
spec->num_channel_modes = 3;
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
spec->multiout.max_channels = cmi9880_channel_modes[0].channels;
|
|
|
|
spec->input_mux = &cmi9880_basic_mux;
|
|
|
|
break;
|
|
|
|
case CMI_FULL:
|
|
|
|
case CMI_FULL_DIG:
|
|
|
|
spec->front_panel = 1;
|
|
|
|
spec->multiout.max_channels = 8;
|
|
|
|
spec->input_mux = &cmi9880_basic_mux;
|
|
|
|
if (spec->board_config == CMI_FULL_DIG) {
|
|
|
|
spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;
|
|
|
|
spec->dig_in_nid = CMI_DIG_IN_NID;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CMI_ALLOUT:
|
2012-12-19 23:35:47 +07:00
|
|
|
default:
|
2005-04-17 05:20:36 +07:00
|
|
|
spec->front_panel = 1;
|
|
|
|
spec->multiout.max_channels = 8;
|
|
|
|
spec->no_line_in = 1;
|
|
|
|
spec->input_mux = &cmi9880_no_line_mux;
|
|
|
|
spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-06-13 19:16:38 +07:00
|
|
|
spec->multiout.num_dacs = spec->num_dacs;
|
2005-04-08 20:05:13 +07:00
|
|
|
spec->multiout.dac_nids = spec->dac_nids;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
spec->adc_nids = cmi9880_adc_nids;
|
|
|
|
|
|
|
|
codec->patch_ops = cmi9880_patch_ops;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* patch entries
|
|
|
|
*/
|
2011-05-02 16:34:20 +07:00
|
|
|
static const struct hda_codec_preset snd_hda_preset_cmedia[] = {
|
2005-04-17 05:20:36 +07:00
|
|
|
{ .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 },
|
|
|
|
{ .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 },
|
|
|
|
{} /* terminator */
|
|
|
|
};
|
2008-11-27 21:47:11 +07:00
|
|
|
|
|
|
|
MODULE_ALIAS("snd-hda-codec-id:13f69880");
|
|
|
|
MODULE_ALIAS("snd-hda-codec-id:434d4980");
|
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_DESCRIPTION("C-Media HD-audio codec");
|
|
|
|
|
|
|
|
static struct hda_codec_preset_list cmedia_list = {
|
|
|
|
.preset = snd_hda_preset_cmedia,
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init patch_cmedia_init(void)
|
|
|
|
{
|
|
|
|
return snd_hda_add_codec_preset(&cmedia_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit patch_cmedia_exit(void)
|
|
|
|
{
|
|
|
|
snd_hda_delete_codec_preset(&cmedia_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(patch_cmedia_init)
|
|
|
|
module_exit(patch_cmedia_exit)
|