#ifndef __SOUND_JACK_H1#define __SOUND_JACK_H23/*4* Jack abstraction layer5*6* Copyright 2008 Wolfson Microelectronics plc7*8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License as published by11* the Free Software Foundation; either version 2 of the License, or12* (at your option) any later version.13*14* This program is distributed in the hope that it will be useful,15* but WITHOUT ANY WARRANTY; without even the implied warranty of16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17* GNU General Public License for more details.18*19* You should have received a copy of the GNU General Public License20* along with this program; if not, write to the Free Software21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22*23*/2425#include <sound/core.h>2627struct input_dev;2829/**30* Jack types which can be reported. These values are used as a31* bitmask.32*33* Note that this must be kept in sync with the lookup table in34* sound/core/jack.c.35*/36enum snd_jack_types {37SND_JACK_HEADPHONE = 0x0001,38SND_JACK_MICROPHONE = 0x0002,39SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE,40SND_JACK_LINEOUT = 0x0004,41SND_JACK_MECHANICAL = 0x0008, /* If detected separately */42SND_JACK_VIDEOOUT = 0x0010,43SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,4445/* Kept separate from switches to facilitate implementation */46SND_JACK_BTN_0 = 0x4000,47SND_JACK_BTN_1 = 0x2000,48SND_JACK_BTN_2 = 0x1000,49SND_JACK_BTN_3 = 0x0800,50SND_JACK_BTN_4 = 0x0400,51SND_JACK_BTN_5 = 0x0200,52};5354struct snd_jack {55struct input_dev *input_dev;56int registered;57int type;58const char *id;59char name[100];60unsigned int key[6]; /* Keep in sync with definitions above */61void *private_data;62void (*private_free)(struct snd_jack *);63};6465#ifdef CONFIG_SND_JACK6667int snd_jack_new(struct snd_card *card, const char *id, int type,68struct snd_jack **jack);69void snd_jack_set_parent(struct snd_jack *jack, struct device *parent);70int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type,71int keytype);7273void snd_jack_report(struct snd_jack *jack, int status);7475#else7677static inline int snd_jack_new(struct snd_card *card, const char *id, int type,78struct snd_jack **jack)79{80return 0;81}8283static inline void snd_jack_set_parent(struct snd_jack *jack,84struct device *parent)85{86}8788static inline void snd_jack_report(struct snd_jack *jack, int status)89{90}9192#endif9394#endif959697