>From 99eeccf9207811eb07986f441020b61beffa759b Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Tue, 25 Mar 2025 21:02:57 +0100 Subject: [PATCH] Revert "ALSA: hda: Fix headset detection failure due to unstable sort" This reverts commit 3b4309546b48fc167aa615a2d881a09c0a97971f. --- sound/pci/hda/hda_auto_parser.c | 8 +------- sound/pci/hda/hda_auto_parser.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index 58b2e25c448e..7c6b1fe8dfcc 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c @@ -80,11 +80,7 @@ static int compare_input_type(const void *ap, const void *bp) /* In case one has boost and the other one has not, pick the one with boost first. */ - if (a->has_boost_on_pin != b->has_boost_on_pin) - return (int)(b->has_boost_on_pin - a->has_boost_on_pin); - - /* Keep the original order */ - return a->order - b->order; + return (int)(b->has_boost_on_pin - a->has_boost_on_pin); } /* Reorder the surround channels @@ -404,8 +400,6 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, reorder_outputs(cfg->speaker_outs, cfg->speaker_pins); /* sort inputs in the order of AUTO_PIN_* type */ - for (i = 0; i < cfg->num_inputs; i++) - cfg->inputs[i].order = i; sort(cfg->inputs, cfg->num_inputs, sizeof(cfg->inputs[0]), compare_input_type, NULL); diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h index 8bb8202cf284..df63d66af1ab 100644 --- a/sound/pci/hda/hda_auto_parser.h +++ b/sound/pci/hda/hda_auto_parser.h @@ -35,7 +35,6 @@ struct auto_pin_cfg_item { unsigned int is_headset_mic:1; unsigned int is_headphone_mic:1; /* Mic-only in headphone jack */ unsigned int has_boost_on_pin:1; - int order; }; struct auto_pin_cfg; -- 2.49.0