[alsa-devel] [PATCH 1/2] ALSA: Add jack reporting API

Takashi Iwai tiwai at suse.de
Mon Jul 28 19:01:19 CEST 2008


At Mon, 28 Jul 2008 17:50:35 +0100,
Mark Brown wrote:
> 
> +/**
> + * Jack types which can be reported.  These values are used as a
> + * bitmask.
> + */
> +enum snd_jack_types {
> +	SND_JACK_HEADPHONE	= 0x0001,
> +	SND_JACK_MICROPHONE	= 0x0002,
> +	SND_JACK_HEADSET	= 0x0003,  /* Both microphone and headphone */

They are bitmask, so HEADSET should be better defined as
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE ?

> +void snd_jack_set_parent(struct snd_jack *jack, struct device *parent)
> +{
> +	BUG_ON(jack->registered);

I'm afraid BUG_ON() is brutal for this kind of check.


Takashi


More information about the Alsa-devel mailing list