Skip to content

Commit

Permalink
ALSA: hda - Record all detected ADCs in hda_gen_spec
Browse files Browse the repository at this point in the history
Since the generic parser reduces the ADC list, copy the list of the
all detected ADCs and keep it.

This list can be later referred by the codec driver for finer power
controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jan 17, 2013
1 parent 7a71bbf commit 0ffd534
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,11 @@ static int fill_adc_nids(struct hda_codec *codec)
break;
}
spec->num_adc_nids = nums;

/* copy the detected ADCs to all_adcs[] */
spec->num_all_adcs = nums;
memcpy(spec->all_adcs, spec->adc_nids, nums * sizeof(hda_nid_t));

return nums;
}

Expand Down
4 changes: 3 additions & 1 deletion sound/pci/hda/hda_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ struct hda_gen_spec {
unsigned int dyn_adc_idx[HDA_MAX_NUM_INPUTS];
hda_nid_t shared_mic_vref_pin;

/* DAC list */
/* DAC/ADC lists */
int num_all_dacs;
hda_nid_t all_dacs[16];
int num_all_adcs;
hda_nid_t all_adcs[AUTO_CFG_MAX_OUTS];

/* path list */
struct snd_array paths;
Expand Down

0 comments on commit 0ffd534

Please sign in to comment.