mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-18 16:44:33 +00:00
ALSA: hda - Drop unneeded pin argument from set_output_and_unmute()
Just a minor refactoring. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
ee79c69ac7
commit
d4156930b2
1 changed files with 13 additions and 28 deletions
|
@ -3753,16 +3753,18 @@ EXPORT_SYMBOL_HDA(snd_hda_gen_build_pcms);
|
||||||
* Standard auto-parser initializations
|
* Standard auto-parser initializations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* configure the path from the given dac to the pin as the proper output */
|
/* configure the given path as a proper output */
|
||||||
static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin,
|
static void set_output_and_unmute(struct hda_codec *codec,
|
||||||
int pin_type, int path_idx)
|
int pin_type, int path_idx)
|
||||||
{
|
{
|
||||||
struct nid_path *path;
|
struct nid_path *path;
|
||||||
|
hda_nid_t pin;
|
||||||
|
|
||||||
snd_hda_set_pin_ctl_cache(codec, pin, pin_type);
|
|
||||||
path = snd_hda_get_path_from_idx(codec, path_idx);
|
path = snd_hda_get_path_from_idx(codec, path_idx);
|
||||||
if (!path)
|
if (!path || !path->depth)
|
||||||
return;
|
return;
|
||||||
|
pin = path->path[path->depth - 1];
|
||||||
|
snd_hda_set_pin_ctl_cache(codec, pin, pin_type);
|
||||||
snd_hda_activate_path(codec, path, path->active, true);
|
snd_hda_activate_path(codec, path, path->active, true);
|
||||||
set_pin_eapd(codec, pin, path->active);
|
set_pin_eapd(codec, pin, path->active);
|
||||||
}
|
}
|
||||||
|
@ -3771,7 +3773,6 @@ static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin,
|
||||||
static void init_multi_out(struct hda_codec *codec)
|
static void init_multi_out(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct hda_gen_spec *spec = codec->spec;
|
struct hda_gen_spec *spec = codec->spec;
|
||||||
hda_nid_t nid;
|
|
||||||
int pin_type;
|
int pin_type;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -3780,27 +3781,18 @@ static void init_multi_out(struct hda_codec *codec)
|
||||||
else
|
else
|
||||||
pin_type = PIN_OUT;
|
pin_type = PIN_OUT;
|
||||||
|
|
||||||
for (i = 0; i < spec->autocfg.line_outs; i++) {
|
for (i = 0; i < spec->autocfg.line_outs; i++)
|
||||||
nid = spec->autocfg.line_out_pins[i];
|
set_output_and_unmute(codec, pin_type, spec->out_paths[i]);
|
||||||
if (nid)
|
|
||||||
set_output_and_unmute(codec, nid, pin_type,
|
|
||||||
spec->out_paths[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void __init_extra_out(struct hda_codec *codec, int num_outs,
|
static void __init_extra_out(struct hda_codec *codec, int num_outs,
|
||||||
hda_nid_t *pins, int *paths, int type)
|
int *paths, int type)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
hda_nid_t pin;
|
|
||||||
|
|
||||||
for (i = 0; i < num_outs; i++) {
|
for (i = 0; i < num_outs; i++)
|
||||||
pin = pins[i];
|
set_output_and_unmute(codec, type, paths[i]);
|
||||||
if (!pin)
|
|
||||||
break;
|
|
||||||
set_output_and_unmute(codec, pin, type, paths[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize hp and speaker paths */
|
/* initialize hp and speaker paths */
|
||||||
|
@ -3810,11 +3802,9 @@ static void init_extra_out(struct hda_codec *codec)
|
||||||
|
|
||||||
if (spec->autocfg.line_out_type != AUTO_PIN_HP_OUT)
|
if (spec->autocfg.line_out_type != AUTO_PIN_HP_OUT)
|
||||||
__init_extra_out(codec, spec->autocfg.hp_outs,
|
__init_extra_out(codec, spec->autocfg.hp_outs,
|
||||||
spec->autocfg.hp_pins,
|
|
||||||
spec->hp_paths, PIN_HP);
|
spec->hp_paths, PIN_HP);
|
||||||
if (spec->autocfg.line_out_type != AUTO_PIN_SPEAKER_OUT)
|
if (spec->autocfg.line_out_type != AUTO_PIN_SPEAKER_OUT)
|
||||||
__init_extra_out(codec, spec->autocfg.speaker_outs,
|
__init_extra_out(codec, spec->autocfg.speaker_outs,
|
||||||
spec->autocfg.speaker_pins,
|
|
||||||
spec->speaker_paths, PIN_OUT);
|
spec->speaker_paths, PIN_OUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3911,13 +3901,8 @@ static void init_digital(struct hda_codec *codec)
|
||||||
int i;
|
int i;
|
||||||
hda_nid_t pin;
|
hda_nid_t pin;
|
||||||
|
|
||||||
for (i = 0; i < spec->autocfg.dig_outs; i++) {
|
for (i = 0; i < spec->autocfg.dig_outs; i++)
|
||||||
pin = spec->autocfg.dig_out_pins[i];
|
set_output_and_unmute(codec, PIN_OUT, spec->digout_paths[i]);
|
||||||
if (!pin)
|
|
||||||
continue;
|
|
||||||
set_output_and_unmute(codec, pin, PIN_OUT,
|
|
||||||
spec->digout_paths[i]);
|
|
||||||
}
|
|
||||||
pin = spec->autocfg.dig_in_pin;
|
pin = spec->autocfg.dig_in_pin;
|
||||||
if (pin) {
|
if (pin) {
|
||||||
struct nid_path *path;
|
struct nid_path *path;
|
||||||
|
|
Loading…
Reference in a new issue