ALSA: hda - Minor code optimization for patch_realtek.c
No functional change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
929559be6d
commit
58c57cfa0d
|
@ -469,9 +469,7 @@ static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
|
||||||
* 7 ~ 0 : Assembly ID
|
* 7 ~ 0 : Assembly ID
|
||||||
* port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
|
* port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
|
||||||
*/
|
*/
|
||||||
static int alc_subsystem_id(struct hda_codec *codec,
|
static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
|
||||||
hda_nid_t porta, hda_nid_t porte,
|
|
||||||
hda_nid_t portd, hda_nid_t porti)
|
|
||||||
{
|
{
|
||||||
unsigned int ass, tmp, i;
|
unsigned int ass, tmp, i;
|
||||||
unsigned nid;
|
unsigned nid;
|
||||||
|
@ -561,14 +559,7 @@ static int alc_subsystem_id(struct hda_codec *codec,
|
||||||
spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) {
|
spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) {
|
||||||
hda_nid_t nid;
|
hda_nid_t nid;
|
||||||
tmp = (ass >> 11) & 0x3; /* HP to chassis */
|
tmp = (ass >> 11) & 0x3; /* HP to chassis */
|
||||||
if (tmp == 0)
|
nid = ports[tmp];
|
||||||
nid = porta;
|
|
||||||
else if (tmp == 1)
|
|
||||||
nid = porte;
|
|
||||||
else if (tmp == 2)
|
|
||||||
nid = portd;
|
|
||||||
else if (tmp == 3)
|
|
||||||
nid = porti;
|
|
||||||
if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
|
if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
|
||||||
spec->gen.autocfg.line_outs))
|
spec->gen.autocfg.line_outs))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -581,7 +572,7 @@ static int alc_subsystem_id(struct hda_codec *codec,
|
||||||
* ports contains an array of 4 pin NIDs for port-A, E, D and I */
|
* ports contains an array of 4 pin NIDs for port-A, E, D and I */
|
||||||
static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
|
static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
|
||||||
{
|
{
|
||||||
if (!alc_subsystem_id(codec, ports[0], ports[1], ports[2], ports[3])) {
|
if (!alc_subsystem_id(codec, ports)) {
|
||||||
struct alc_spec *spec = codec->spec;
|
struct alc_spec *spec = codec->spec;
|
||||||
snd_printd("realtek: "
|
snd_printd("realtek: "
|
||||||
"Enable default setup for auto mode as fallback\n");
|
"Enable default setup for auto mode as fallback\n");
|
||||||
|
|
Loading…
Reference in New Issue