summaryrefslogtreecommitdiffstats
path: root/include/sound/jack.h
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: jack: Allow building the jack layer without input deviceTakashi Iwai2016-02-231-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | Since the recent integration of kctl jack and input jack layers, we can basically build the jack layer even without input devices. That is, the jack layer itself can be built with conditional to enable the input device support or not, while the users may enable always CONFIG_SND_JACK unconditionally. For achieving it, this patch changes the following: - A new Kconfig, CONFIG_SND_JACK_INPUT_DEV, was introduced to indicate whether the jack layer supports the input device, - A few items in snd_jack struct and relevant codes are conditionally built upon CONFIG_SND_JACK_INPUT_DEV, - The users of CONFIG_SND_JACK drop the messy dependency on CONFIG_INPUT. This change also automagically fixes a potential bug in HD-audio driver Arnd reported, where the NULL or uninitialized jack instance is dereferenced. Reported-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack: extend snd_jack_new to support phantom jackJie Yang2015-04-271-2/+2
| | | | | | | | | | | | | | | Dont create input devices for phantom jacks. Here, we extend snd_jack_new() to support phantom jack creating: pass in a bool param for [non-]phantom flag, and a bool param initial_jack to indicate whether we need to create a kctl at this stage. We can also add a kctl to the jack after its created meaning we can now integrate the HDA and ASoC jacks. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack: implement kctl creating for jack devicesJie Yang2015-04-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Currently the ALSA jack core registers only input devices for each jack registered. These jack input devices are not readable by userspace devices that run as non root. This patch series will implement kctls inside the core jack part, including kctls creating, status changing report, for both HD-Audio and ASoC jack. This allows non root userspace to read jack status and act on it. This patch adds a new API called snd_jack_add_new_kctl(), which will create a kcontrol, add it to the card, and also attach it to the jack kctl list. This patch also initialises the jack kctl list after jack is newed, and reports kctl status when jack insertion/removal events occur. snd_jack_new() is updated in the following patches to also support creating phantom jacks and jack kcontrols. We then remove these duplicated features from HDA jack and have jack kctls handled by core throughout HDA and ASoC. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Modified-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Jie Yang <yang.jie@intel.com> Reveiwed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack: Add dummy snd_jack_set_key() definitionTakashi Iwai2014-12-081-0/+7
| | | | | | | For fixing a build error with CONFIG_SND_JACK=n sound/soc/codecs/ts3a227e.c:223:2: error: implicit declaration of function ‘snd_jack_set_key’ [-Werror=implicit-function-declaration] Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: doc: Fix enum snd_jack_types commentsTakashi Iwai2014-10-291-1/+15
| | | | | | Follow the proper kerneldoc rule, and complete enum item comments. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack: Fix kerneldoc commentsTakashi Iwai2014-10-281-2/+3
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Use a define for the number of jack switch typesMark Brown2012-02-271-0/+3
| | | | | | | | This is intended to facilitate the merge of the two jack detection mechanisms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack - Add "Line In" input jack constantsDavid Henningsson2011-10-051-0/+1
| | | | | | | | | Similar to Line Out, these constants form the base for future patches enabling input jack reporting for Line in jacks. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add more jack button slotsMark Brown2010-09-071-1/+4
| | | | | | | | Some devices have more flexible microphone detection and can detect a wider range of buttons. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add support for key reporting via the jack interfaceMark Brown2010-03-171-0/+8
| | | | | | | | | | | | | | | | | | | | Some devices provide support for detection of a small number of buttons on their jacks. One common implementation provides a single button, implemented by shorting the microphone to ground and detected along with microphone presence detection by detecting varying current draws on the microphone bias signal. Provide support for up to three buttons via the jack interface. These default to reporting BTN_n but an API is provided to allow these to be remapped to other keys by the machine driver where it knows what the keys are. More keys can be added with ease if required. This is only intended to support simple accessory button designs. If the interface is limiting then either creating a child device for the accessory or accessing the input device in the jack directly is recommended. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ALSA: add private_data to struct snd_jackTakashi Iwai2009-04-141-0/+2
| | | | | | | | Added private_data and private_free fields to struct snd_jack so that the caller can assign the data. It'll be helpful for avoiding the double-free of the jack instance. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add support for video out to the jack reporting APIJani Nikula2009-01-071-0/+2
| | | | | | | | | | | | Add support for reporting new jack types SND_JACK_VIDEOOUT and SND_JACK_AVOUT (a combination of LINEOUT and VIDEOOUT) to the jack reporting API. Also add the corresponding SW_VIDEOOUT_INSERT switch to the input system header. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ALSA: Reduce boilerplate for new jack typesMark Brown2009-01-031-0/+3
| | | | | | | Use a lookup table rather than explicit code to map input subsystem jack types into ASoC ones, implemented as suggested by Takashi Iwai. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ALSA: Add support for mechanical jack insertionMark Brown2008-12-101-0/+1
| | | | | | | | | | | | Some systems support both mechanical and electrical jack detection, allowing them to report that a jack is physically present but does not have any functioning connections. Add a new jack type for these, allowing user space to report faulty connections. Thanks to Guillem Jover for the suggestion. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: jack: lineout support to jack abstraction layerMatthew Ranostay2008-10-271-0/+1
| | | | | | | | | | | | This patch introduces support for reporting SW_LINEOUT_INSERT detection events via the jack abstraction layer. Also adds a SND_JACK_LINEOUT define to the input system header. Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com> Cc: Dmitry Torokhov <dtor@mail.ru> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add jack reporting APIMark Brown2008-07-291-0/+75
Currently very few systems provide information about jack status to user space, even though many have hardware facilities to do detection. Those systems that do use an input device with the existing SW_HEADPHONE_INSERT switch type to do so, often independently of ALSA. This patch introduces a standard method for representing jacks to user space into ALSA. It allows drivers to register jacks for a sound card with the input subsystem, binding the input device to the card to help user space associate the input devices with their sound cards. The created input devices are named in the form "card longname jack" where jack is provided by the driver when allocating a jack. By default the parent for the input device is the sound card but this can be overridden by the card driver. The existing user space API with SW_HEADPHONE_INSERT is preserved. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
OpenPOWER on IntegriCloud