diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-22 10:40:24 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-22 10:48:17 -0400 |
commit | 8a5354140a86b6d4057793a9ed28d29ac8ce6ba6 (patch) | |
tree | c8f8dc2e4ff1df1c47db26b61083c4379c0886a9 /sound | |
parent | f9933487468c760b8cd9b4e9f7ec4e494f711a0a (diff) |
ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.c
Instead of calling the jack sync in the init callback of each codec,
call it generically at initialization and resume. By calling it at
the last of resume sequence, a possible race between the jack sync and
the unsol event enablement in the current code will be closed, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 1 |
7 files changed, 2 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index a6c34dc6dac1..4efd2711acd9 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3618,6 +3618,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
3618 | snd_hda_codec_resume_amp(codec); | 3618 | snd_hda_codec_resume_amp(codec); |
3619 | snd_hda_codec_resume_cache(codec); | 3619 | snd_hda_codec_resume_cache(codec); |
3620 | } | 3620 | } |
3621 | snd_hda_jack_report_sync(codec); | ||
3621 | snd_hda_power_down(codec); /* flag down before returning */ | 3622 | snd_hda_power_down(codec); /* flag down before returning */ |
3622 | } | 3623 | } |
3623 | #endif /* CONFIG_PM */ | 3624 | #endif /* CONFIG_PM */ |
@@ -3663,6 +3664,7 @@ int snd_hda_codec_build_controls(struct hda_codec *codec) | |||
3663 | err = codec->patch_ops.build_controls(codec); | 3664 | err = codec->patch_ops.build_controls(codec); |
3664 | if (err < 0) | 3665 | if (err < 0) |
3665 | return err; | 3666 | return err; |
3667 | snd_hda_jack_report_sync(codec); /* call at the last init point */ | ||
3666 | return 0; | 3668 | return 0; |
3667 | } | 3669 | } |
3668 | 3670 | ||
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 0c4c1a61b378..0bddb3ee1101 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -1193,7 +1193,6 @@ static int cs_init(struct hda_codec *codec) | |||
1193 | init_output(codec); | 1193 | init_output(codec); |
1194 | init_input(codec); | 1194 | init_input(codec); |
1195 | init_digital(codec); | 1195 | init_digital(codec); |
1196 | snd_hda_jack_report_sync(codec); | ||
1197 | 1196 | ||
1198 | return 0; | 1197 | return 0; |
1199 | } | 1198 | } |
@@ -1643,7 +1642,6 @@ static int cs421x_init(struct hda_codec *codec) | |||
1643 | init_output(codec); | 1642 | init_output(codec); |
1644 | init_input(codec); | 1643 | init_input(codec); |
1645 | init_cs421x_digital(codec); | 1644 | init_cs421x_digital(codec); |
1646 | snd_hda_jack_report_sync(codec); | ||
1647 | 1645 | ||
1648 | return 0; | 1646 | return 0; |
1649 | } | 1647 | } |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 5e22a8f43d2e..172895a8add4 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -4061,7 +4061,6 @@ static int cx_auto_init(struct hda_codec *codec) | |||
4061 | cx_auto_init_output(codec); | 4061 | cx_auto_init_output(codec); |
4062 | cx_auto_init_input(codec); | 4062 | cx_auto_init_input(codec); |
4063 | cx_auto_init_digital(codec); | 4063 | cx_auto_init_digital(codec); |
4064 | snd_hda_jack_report_sync(codec); | ||
4065 | snd_hda_sync_vmaster_hook(&spec->vmaster_mute); | 4064 | snd_hda_sync_vmaster_hook(&spec->vmaster_mute); |
4066 | return 0; | 4065 | return 0; |
4067 | } | 4066 | } |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 8f23374fa642..d9439c59bb8b 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1311,7 +1311,6 @@ static int generic_hdmi_init(struct hda_codec *codec) | |||
1311 | hdmi_init_pin(codec, pin_nid); | 1311 | hdmi_init_pin(codec, pin_nid); |
1312 | snd_hda_jack_detect_enable(codec, pin_nid, pin_nid); | 1312 | snd_hda_jack_detect_enable(codec, pin_nid, pin_nid); |
1313 | } | 1313 | } |
1314 | snd_hda_jack_report_sync(codec); | ||
1315 | return 0; | 1314 | return 0; |
1316 | } | 1315 | } |
1317 | 1316 | ||
@@ -1428,7 +1427,6 @@ static int simple_playback_init(struct hda_codec *codec) | |||
1428 | snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 1427 | snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
1429 | AMP_OUT_UNMUTE); | 1428 | AMP_OUT_UNMUTE); |
1430 | snd_hda_jack_detect_enable(codec, pin, pin); | 1429 | snd_hda_jack_detect_enable(codec, pin, pin); |
1431 | snd_hda_jack_report_sync(codec); | ||
1432 | return 0; | 1430 | return 0; |
1433 | } | 1431 | } |
1434 | 1432 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4f81dd44c837..ce99cc955326 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2053,8 +2053,6 @@ static int alc_init(struct hda_codec *codec) | |||
2053 | 2053 | ||
2054 | alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT); | 2054 | alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT); |
2055 | 2055 | ||
2056 | snd_hda_jack_report_sync(codec); | ||
2057 | |||
2058 | hda_call_check_power_status(codec, 0x01); | 2056 | hda_call_check_power_status(codec, 0x01); |
2059 | return 0; | 2057 | return 0; |
2060 | } | 2058 | } |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index ea5775a1a7db..435295402efa 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4418,8 +4418,6 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4418 | stac_toggle_power_map(codec, nid, 0); | 4418 | stac_toggle_power_map(codec, nid, 0); |
4419 | } | 4419 | } |
4420 | 4420 | ||
4421 | snd_hda_jack_report_sync(codec); | ||
4422 | |||
4423 | /* sync mute LED */ | 4421 | /* sync mute LED */ |
4424 | if (spec->gpio_led) { | 4422 | if (spec->gpio_led) { |
4425 | if (spec->vmaster_mute.hook) | 4423 | if (spec->vmaster_mute.hook) |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 430771776915..4b0796b30f78 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -2815,7 +2815,6 @@ static int via_init(struct hda_codec *codec) | |||
2815 | 2815 | ||
2816 | via_hp_automute(codec); | 2816 | via_hp_automute(codec); |
2817 | vt1708_update_hp_work(spec); | 2817 | vt1708_update_hp_work(spec); |
2818 | snd_hda_jack_report_sync(codec); | ||
2819 | 2818 | ||
2820 | return 0; | 2819 | return 0; |
2821 | } | 2820 | } |