Re: [PATCH] hda: add support for jack detection on IDT/Sigmatel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 15, 2008 at 10:43:28AM -0400, Matthew Ranostay wrote:

> @@ -3639,6 +3640,12 @@ static int stac92xx_init(struct hda_codec *codec)
>  		stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
>  					 AC_PINCTL_OUT_EN);
>  		stac92xx_auto_init_hp_out(codec);
> +		/* jack detection */
> +		err = snd_jack_new(codec->bus->card,
> +			"Headphone Jack Detection",
> +			SND_JACK_HEADPHONE, &codec->jack);
> +		if (err < 0)

That should probably just be "Headphone Jack".

> +			return err;

...

> +	if (codec->jack)
> +		snd_jack_report(codec->jack,
> +			presence ? SND_JACK_HEADPHONE : 0);
> +

Since you appear to fail init if you can't create the jack there should
be no need to check for the jack being initialised here.  For ease of
use I'll just submit a patch folding that check into snd_jack_report(),
though.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux