[alsa-devel] hp_pin was NULL value
Hi Takashi,
Could I move the alc294_hp_init(codec) to below line. Because hp_pin = spec->gen.autocfg.hp_pins[0] was null value when alc294_hp_init(codec) at original line. Or move alc269_parse_auto_config() upward.
BR, Kailang --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7514,7 +7514,6 @@ static int patch_alc269(struct hda_codec *codec) spec->codec_variant = ALC269_TYPE_ALC294; spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ - alc294_hp_init(codec); break; case 0x10ec0300: spec->codec_variant = ALC269_TYPE_ALC300; @@ -7526,7 +7525,6 @@ static int patch_alc269(struct hda_codec *codec) spec->codec_variant = ALC269_TYPE_ALC700; spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ - alc294_hp_init(codec); break;
} @@ -7553,6 +7551,16 @@ static int patch_alc269(struct hda_codec *codec) if (err < 0) goto error;
+ switch (codec->core.vendor_id) { + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + case 0x10ec0700: + case 0x10ec0701: + case 0x10ec0703: + alc294_hp_init(codec); + break; + } if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); if (err < 0)
On Wed, 09 Jan 2019 10:31:33 +0100, Kailang wrote:
Hi Takashi,
Could I move the alc294_hp_init(codec) to below line. Because hp_pin = spec->gen.autocfg.hp_pins[0] was null value when alc294_hp_init(codec) at original line. Or move alc269_parse_auto_config() upward.
It looks OK to me. But this made me wonder whether we don't need to call this function at resume as well? Currently it's called only at probing.
thanks,
Takashi
But this made me wonder whether we don't need to call this function at resume as well? Currently it's called only at probing.
Yes, it only call at probing. Just need to call it at boot time.
-----Original Message----- From: Takashi Iwai tiwai@suse.de Sent: Wednesday, January 9, 2019 5:43 PM To: Kailang kailang@realtek.com Cc: (alsa-devel@alsa-project.org) alsa-devel@alsa-project.org Subject: Re: hp_pin was NULL value
On Wed, 09 Jan 2019 10:31:33 +0100, Kailang wrote:
Hi Takashi,
Could I move the alc294_hp_init(codec) to below line. Because hp_pin = spec->gen.autocfg.hp_pins[0] was null value when alc294_hp_init(codec) at original line. Or move alc269_parse_auto_config() upward.
It looks OK to me. But this made me wonder whether we don't need to call this function at resume as well? Currently it's called only at probing.
thanks,
Takashi
------Please consider the environment before printing this e-mail.
On Wed, 09 Jan 2019 10:45:25 +0100, Kailang wrote:
But this made me wonder whether we don't need to call this function at resume as well? Currently it's called only at probing.
Yes, it only call at probing. Just need to call it at boot time.
-----Original Message----- From: Takashi Iwai tiwai@suse.de Sent: Wednesday, January 9, 2019 5:43 PM To: Kailang kailang@realtek.com Cc: (alsa-devel@alsa-project.org) alsa-devel@alsa-project.org Subject: Re: hp_pin was NULL value
On Wed, 09 Jan 2019 10:31:33 +0100, Kailang wrote:
Hi Takashi,
Could I move the alc294_hp_init(codec) to below line. Because hp_pin = spec->gen.autocfg.hp_pins[0] was null value when alc294_hp_init(codec) at original line. Or move alc269_parse_auto_config() upward.
It looks OK to me. But this made me wonder whether we don't need to call this function at resume as well? Currently it's called only at probing.
Hrm, but it modifies many COEFs, and are these all preserved with suspend? For example, there is also hibernation (S4), which is a switch from the boot without the audio driver initialization. Then we'll resume from the uninitialized state. I guess other COEF changes in that area should be moved as the additional init hook as well.
Actually, if we do call this at resume, the change would be easier, a patch like below.
thanks,
Takashi
--- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7404,6 +7404,20 @@ static void alc294_hp_init(struct hda_codec *codec) msleep(50); }
+static void alc294_init(struct hda_codec *codec) +{ + /* UAJ MIC Vref control by verb */ + alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); + alc294_hp_init(codec); +} + +static void alc700_init(struct hda_codec *codec) +{ + /* Combo jack auto trigger control */ + alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); + alc294_hp_init(codec); +} + /* */ static int patch_alc269(struct hda_codec *codec) @@ -7528,8 +7542,7 @@ static int patch_alc269(struct hda_codec *codec) case 0x10ec0294: spec->codec_variant = ALC269_TYPE_ALC294; spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ - alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ - alc294_hp_init(codec); + spec->init_hook = alc294_init; break; case 0x10ec0300: spec->codec_variant = ALC269_TYPE_ALC300; @@ -7540,8 +7553,7 @@ static int patch_alc269(struct hda_codec *codec) case 0x10ec0703: spec->codec_variant = ALC269_TYPE_ALC700; spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ - alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ - alc294_hp_init(codec); + spec->init_hook = alc700_init; break;
}
participants (2)
-
Kailang
-
Takashi Iwai