/* codec parameterization */
const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
unsigned int num_mixers;
- const struct snd_kcontrol_new *cap_mixer; /* capture mixer */
unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */
char stream_name_analog[32]; /* analog PCM stream */
/* capture */
unsigned int num_adc_nids;
- const hda_nid_t *adc_nids;
- const hda_nid_t *capsrc_nids;
+ hda_nid_t adc_nids[AUTO_CFG_MAX_OUTS];
hda_nid_t dig_in_nid; /* digital-in NID; optional */
hda_nid_t mixer_nid; /* analog-mixer NID */
/* capture source */
unsigned int num_mux_defs;
- const struct hda_input_mux *input_mux;
+ struct hda_input_mux input_mux;
unsigned int cur_mux[3];
hda_nid_t ext_mic_pin;
hda_nid_t dock_mic_pin;
struct auto_pin_cfg autocfg;
struct alc_customize_define cdefine;
struct snd_array kctls;
- struct hda_input_mux private_imux[3];
hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
- hda_nid_t private_adc_nids[AUTO_CFG_MAX_OUTS];
- hda_nid_t private_capsrc_nids[AUTO_CFG_MAX_OUTS];
hda_nid_t imux_pins[HDA_MAX_NUM_INPUTS];
unsigned int dyn_adc_idx[HDA_MAX_NUM_INPUTS];
int int_mic_idx, ext_mic_idx, dock_mic_idx; /* for auto-mic */
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct alc_spec *spec = codec->spec;
- return snd_hda_input_mux_info(&spec->input_mux[0], uinfo);
+ return snd_hda_input_mux_info(&spec->input_mux, uinfo);
}
static int alc_mux_enum_get(struct snd_kcontrol *kcontrol,
const struct hda_input_mux *imux;
struct nid_path *path;
- imux = spec->input_mux;
- if (!imux || !imux->num_items)
+ imux = &spec->input_mux;
+ if (!imux->num_items)
return 0;
if (idx >= imux->num_items)
if (!spec->auto_mic || !spec->auto_mic_valid_imux)
return;
- if (snd_BUG_ON(!spec->adc_nids))
- return;
if (snd_BUG_ON(spec->int_mic_idx < 0 || spec->ext_mic_idx < 0))
return;
struct alc_spec *spec = codec->spec;
const struct hda_input_mux *imux;
- imux = spec->input_mux;
+ imux = &spec->input_mux;
spec->ext_mic_idx = find_idx_in_nid_list(spec->ext_mic_pin,
spec->imux_pins, imux->num_items);
spec->int_mic_idx = find_idx_in_nid_list(spec->int_mic_pin,
struct nid_path *path;
int i, adc_idx, err = 0;
- imux = spec->input_mux;
+ imux = &spec->input_mux;
adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
mutex_lock(&codec->control_mutex);
codec->cached_write = 1;
static void alc_inv_dmic_sync_adc(struct hda_codec *codec, int adc_idx)
{
struct alc_spec *spec = codec->spec;
- struct hda_input_mux *imux = &spec->private_imux[0];
+ struct hda_input_mux *imux = &spec->input_mux;
struct nid_path *path;
hda_nid_t nid;
int i, dir, parm;
if (err < 0)
return err;
}
- if (spec->cap_mixer) {
- err = snd_hda_add_new_ctls(codec, spec->cap_mixer);
- if (err < 0)
- return err;
- }
if (spec->multiout.dig_out_nid) {
err = snd_hda_create_dig_out_ctls(codec,
spec->multiout.dig_out_nid,
info->stream[SNDRV_PCM_STREAM_PLAYBACK].chmap =
snd_pcm_2_1_chmaps;
}
- if (spec->adc_nids) {
+ if (spec->num_adc_nids) {
p = spec->stream_analog_capture;
if (!p) {
if (spec->dyn_adc_switch)
* model, configure a second analog capture-only PCM.
*/
have_multi_adcs = (spec->num_adc_nids > 1) &&
- !spec->dyn_adc_switch && !spec->auto_mic &&
- (!spec->input_mux || spec->input_mux->num_items > 1);
+ !spec->dyn_adc_switch && !spec->auto_mic;
/* Additional Analaog capture for index #2 */
if (spec->alt_dac_nid || have_multi_adcs) {
codec->num_pcms = 3;
{
struct alc_spec *spec = codec->spec;
hda_nid_t nid;
- hda_nid_t *adc_nids = spec->private_adc_nids;
- int max_nums = ARRAY_SIZE(spec->private_adc_nids);
+ hda_nid_t *adc_nids = spec->adc_nids;
+ int max_nums = ARRAY_SIZE(spec->adc_nids);
int i, nums = 0;
nid = codec->start_nid;
if (++nums >= max_nums)
break;
}
- spec->adc_nids = spec->private_adc_nids;
spec->num_adc_nids = nums;
return nums;
}
static int check_dyn_adc_switch(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
- struct hda_input_mux *imux = &spec->private_imux[0];
- hda_nid_t adc_nids[ARRAY_SIZE(spec->private_adc_nids)];
+ struct hda_input_mux *imux = &spec->input_mux;
+ hda_nid_t adc_nids[ARRAY_SIZE(spec->adc_nids)];
int i, n, nums;
hda_nid_t pin, adc;
if (!nums) {
if (spec->shared_mic_hp) {
spec->shared_mic_hp = 0;
- spec->private_imux[0].num_items = 1;
+ imux->num_items = 1;
goto again;
}
snd_printdd("realtek: enabling ADC switching\n");
spec->dyn_adc_switch = 1;
} else if (nums != spec->num_adc_nids) {
- memcpy(spec->private_adc_nids, adc_nids,
- nums * sizeof(hda_nid_t));
+ memcpy(spec->adc_nids, adc_nids, nums * sizeof(hda_nid_t));
spec->num_adc_nids = nums;
}
- if (spec->input_mux->num_items == 1 || spec->shared_mic_hp) {
+ if (imux->num_items == 1 || spec->shared_mic_hp) {
snd_printdd("realtek: reducing to a single ADC\n");
spec->num_adc_nids = 1; /* reduce to a single ADC */
}
static int create_capture_mixers(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
- struct hda_input_mux *imux = &spec->private_imux[0];
+ struct hda_input_mux *imux = &spec->input_mux;
struct snd_kcontrol_new *knew;
int i, n, nums;
struct alc_spec *spec = codec->spec;
const struct auto_pin_cfg *cfg = &spec->autocfg;
hda_nid_t mixer = spec->mixer_nid;
- struct hda_input_mux *imux = &spec->private_imux[0];
+ struct hda_input_mux *imux = &spec->input_mux;
int num_adcs;
int i, c, err, type_idx = 0;
const char *prev_label = NULL;
}
}
- spec->input_mux = imux;
return 0;
}
static void alc_auto_init_input_src(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
- struct hda_input_mux *imux = &spec->private_imux[0];
+ struct hda_input_mux *imux = &spec->input_mux;
struct nid_path *path;
int i, c, nums;