On 08/22/2012 04:49 PM, Takashi Iwai wrote:
> From: Takashi Iwai <email address hidden>
> Subject: [PATCH] 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 <email address hidden>
Acked-by: David Henningsson <email address hidden>
On 08/22/2012 04:49 PM, Takashi Iwai wrote: jack_report_ sync() generically in hda_codec.c
> From: Takashi Iwai <email address hidden>
> Subject: [PATCH] ALSA: hda - Call snd_hda_
>
> 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 <email address hidden>
Acked-by: David Henningsson <email address hidden>
> --- hda/hda_ codec.c | 2 ++ hda/patch_ cirrus. c | 2 -- hda/patch_ conexant. c | 1 - hda/patch_ hdmi.c | 2 -- hda/patch_ realtek. c | 2 -- hda/patch_ sigmatel. c | 2 -- hda/patch_ via.c | 1 - pci/hda/ hda_codec. c b/sound/ pci/hda/ hda_codec. c pci/hda/ hda_codec. c pci/hda/ hda_codec. c codec_resume( struct hda_codec *codec) codec_resume_ amp(codec) ; codec_resume_ cache(codec) ; jack_report_ sync(codec) ; power_down( codec); /* flag down before returning */ codec_build_ controls( struct hda_codec *codec) patch_ops. build_controls( codec); jack_report_ sync(codec) ; /* call at the last init point */ pci/hda/ patch_cirrus. c b/sound/ pci/hda/ patch_cirrus. c pci/hda/ patch_cirrus. c pci/hda/ patch_cirrus. c codec); jack_report_ sync(codec) ; digital( codec); jack_report_ sync(codec) ; pci/hda/ patch_conexant. c b/sound/ pci/hda/ patch_conexant. c pci/hda/ patch_conexant. c pci/hda/ patch_conexant. c init_output( codec); init_input( codec); init_digital( codec); jack_report_ sync(codec) ; sync_vmaster_ hook(&spec- >vmaster_ mute); pci/hda/ patch_hdmi. c b/sound/ pci/hda/ patch_hdmi. c pci/hda/ patch_hdmi. c pci/hda/ patch_hdmi. c hdmi_init( struct hda_codec *codec) pin(codec, pin_nid); jack_detect_ enable( codec, pin_nid, pin_nid); jack_report_ sync(codec) ; playback_ init(struct hda_codec *codec) codec_write( codec, pin, 0, AC_VERB_ SET_AMP_ GAIN_MUTE, jack_detect_ enable( codec, pin, pin); jack_report_ sync(codec) ; pci/hda/ patch_realtek. c b/sound/ pci/hda/ patch_realtek. c pci/hda/ patch_realtek. c pci/hda/ patch_realtek. c fixup(codec, ALC_FIXUP_ ACT_INIT) ; jack_report_ sync(codec) ; check_power_ status( codec, 0x01); pci/hda/ patch_sigmatel. c b/sound/ pci/hda/ patch_sigmatel. c pci/hda/ patch_sigmatel. c pci/hda/ patch_sigmatel. c init(struct hda_codec *codec) power_map( codec, nid, 0); jack_report_ sync(codec) ; vmaster_ mute.hook) pci/hda/ patch_via. c b/sound/ pci/hda/ patch_via. c pci/hda/ patch_via. c pci/hda/ patch_via. c automute( codec); update_ hp_work( spec); jack_report_ sync(codec) ;
> sound/pci/
> sound/pci/
> sound/pci/
> sound/pci/
> sound/pci/
> sound/pci/
> sound/pci/
> 7 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/sound/
> index a6c34dc..4efd271 100644
> --- a/sound/
> +++ b/sound/
> @@ -3618,6 +3618,7 @@ static void hda_call_
> snd_hda_
> snd_hda_
> }
> + snd_hda_
> snd_hda_
> }
> #endif /* CONFIG_PM */
> @@ -3663,6 +3664,7 @@ int snd_hda_
> err = codec->
> if (err < 0)
> return err;
> + snd_hda_
> return 0;
> }
>
> diff --git a/sound/
> index 0c4c1a6..0bddb3e 100644
> --- a/sound/
> +++ b/sound/
> @@ -1193,7 +1193,6 @@ static int cs_init(struct hda_codec *codec)
> init_output(codec);
> init_input(codec);
> init_digital(
> - snd_hda_
>
> return 0;
> }
> @@ -1643,7 +1642,6 @@ static int cs421x_init(struct hda_codec *codec)
> init_output(codec);
> init_input(codec);
> init_cs421x_
> - snd_hda_
>
> return 0;
> }
> diff --git a/sound/
> index 5e22a8f..172895a 100644
> --- a/sound/
> +++ b/sound/
> @@ -4061,7 +4061,6 @@ static int cx_auto_init(struct hda_codec *codec)
> cx_auto_
> cx_auto_
> cx_auto_
> - snd_hda_
> snd_hda_
> return 0;
> }
> diff --git a/sound/
> index 8f23374..d9439c5 100644
> --- a/sound/
> +++ b/sound/
> @@ -1311,7 +1311,6 @@ static int generic_
> hdmi_init_
> snd_hda_
> }
> - snd_hda_
> return 0;
> }
>
> @@ -1428,7 +1427,6 @@ static int simple_
> snd_hda_
> AMP_OUT_UNMUTE);
> snd_hda_
> - snd_hda_
> return 0;
> }
>
> diff --git a/sound/
> index 4f81dd4..ce99cc9 100644
> --- a/sound/
> +++ b/sound/
> @@ -2053,8 +2053,6 @@ static int alc_init(struct hda_codec *codec)
>
> alc_apply_
>
> - snd_hda_
> -
> hda_call_
> return 0;
> }
> diff --git a/sound/
> index ea5775a..4352954 100644
> --- a/sound/
> +++ b/sound/
> @@ -4418,8 +4418,6 @@ static int stac92xx_
> stac_toggle_
> }
>
> - snd_hda_
> -
> /* sync mute LED */
> if (spec->gpio_led) {
> if (spec->
> diff --git a/sound/
> index 4307717..4b0796b 100644
> --- a/sound/
> +++ b/sound/
> @@ -2815,7 +2815,6 @@ static int via_init(struct hda_codec *codec)
>
> via_hp_
> vt1708_
> - snd_hda_
>
> return 0;
> }
>
-- /launchpad. net/~diwic
David Henningsson, Canonical Ltd.
https:/