At Wed, 3 Oct 2012 11:12:53 +0200,
David Henningsson wrote:
>
> In case there is one "Headphone Jack" and one "Dock Headphone Jack",
> one of them will get an index, even though that is not needed.
> This patch fixes that issue.
>
> BugLink: https://bugs.launchpad.net/bugs/1060729
> Signed-off-by: David Henningsson <email address hidden>
Applied. This one doesn't need to go to stable, right?
At Wed, 3 Oct 2012 11:12:53 +0200, /bugs.launchpad .net/bugs/ 1060729
David Henningsson wrote:
>
> In case there is one "Headphone Jack" and one "Dock Headphone Jack",
> one of them will get an index, even though that is not needed.
> This patch fixes that issue.
>
> BugLink: https:/
> Signed-off-by: David Henningsson <email address hidden>
Applied. This one doesn't need to go to stable, right?
Takashi
> --- hda/hda_ auto_parser. c | 49 +++++++ +++++++ +++++++ +++++++ +------ ---- /launchpadlibra rian.net/ 118211803/ AlsaInfo pci/hda/ hda_auto_ parser. c b/sound/ pci/hda/ hda_auto_ parser. c pci/hda/ hda_auto_ parser. c pci/hda/ hda_auto_ parser. c output_ sfx(hda_ nid_t nid, const hda_nid_t *pins, output_ pfx(struct hda_codec *codec, hda_nid_t nid) codec_get_ pincfg( codec, nid); get_input_ pin_attr( def_conf) ; ATTR_DOCK: ATTR_FRONT: label_index( struct hda_codec *codec, hda_nid_t nid, pfx(codec, nid); in_nid_ list(nid, pins, num_pins); pfx(codec, pins[j])) out_name( struct hda_codec *codec, hda_nid_t nid, out_name( struct hda_codec *codec, hda_nid_t nid, codec_get_ pincfg( codec, nid); get_input_ pin_attr( def_conf) ; ATTR_DOCK: ATTR_FRONT: pfx(codec, nid); sfx(nid, cfg->line_out_pins, cfg->line_outs, out_name( struct hda_codec *codec, hda_nid_t nid, in_nid_ list(nid, cfg->hp_pins, label_index( codec, nid, cfg->hp_pins,
> sound/pci/
> 1 file changed, 37 insertions(+), 12 deletions(-)
>
> Alsa-info at: https:/
>
> diff --git a/sound/
> index a98e25e..4ec6dc8 100644
> --- a/sound/
> +++ b/sound/
> @@ -498,6 +498,38 @@ static const char *check_
> return channel_sfx[i];
> }
>
> +static const char *check_
> +{
> + unsigned int def_conf = snd_hda_
> + int attr = snd_hda_
> +
> + /* check the location */
> + switch (attr) {
> + case INPUT_PIN_
> + return "Dock ";
> + case INPUT_PIN_
> + return "Front ";
> + }
> + return "";
> +}
> +
> +static int get_hp_
> + const hda_nid_t *pins, int num_pins)
> +{
> + int i, j, idx = 0;
> +
> + const char *pfx = check_output_
> +
> + i = find_idx_
> + if (i < 0)
> + return -1;
> + for (j = 0; j < i; j++)
> + if (pfx == check_output_
> + idx++;
> +
> + return idx;
> +}
> +
> static int fill_audio_
> const struct auto_pin_cfg *cfg,
> const char *name, char *label, int maxlen,
> @@ -505,20 +537,13 @@ static int fill_audio_
> {
> unsigned int def_conf = snd_hda_
> int attr = snd_hda_
> - const char *pfx = "", *sfx = "";
> + const char *pfx, *sfx = "";
>
> /* handle as a speaker if it's a fixed line-out */
> if (!strcmp(name, "Line Out") && attr == INPUT_PIN_ATTR_INT)
> name = "Speaker";
> - /* check the location */
> - switch (attr) {
> - case INPUT_PIN_
> - pfx = "Dock ";
> - break;
> - case INPUT_PIN_
> - pfx = "Front ";
> - break;
> - }
> + pfx = check_output_
> +
> if (cfg) {
> /* try to give a unique suffix if needed */
> sfx = check_output_
> @@ -528,8 +553,8 @@ static int fill_audio_
> indexp);
> if (!sfx) {
> /* don't add channel suffix for Headphone controls */
> - int idx = find_idx_
> - cfg->hp_outs);
> + int idx = get_hp_
> + cfg->hp_outs);
> if (idx >= 0)
> *indexp = idx;
> sfx = "";
> --
> 1.7.9.5
>