linux/sound/core/ctljack.c
<<
val12 val12>> v val ="+search" method="post" onsubmit="return do_search(this);"> val12 "> val12 val12Search val12Prefs3 12 v ="ajax+*" method="post" onsubmit="return false;"> v "> al12 23
2 21/*2 22 * Helper func> s for jack-detec> kcontrols2 23 *2 24 * Copyright (c) 2011 Takashi Iwai <tiwai@suse.de>2 25 *2 26 * This program is free software; you ca redistribute it and/or modify it2 27 * under the terms of the GNU General Public License as published by the Free2 28 * Software Founda> ; either vers 2 of the License, or (at your > )2 29 * any later vers .2 0" a> */2 1132 12#include <linux/kernel.h>32 13#include <linux/export.h>32 14#include <sound/core.h>32 15#include <sound/control.h>32 1632 17#define2jack_detec>_kctl_info 2snd_ctl_boolean_mono_info32 1832 19static int2jack_detec>_kctl_get(struct2snd_kcontrol *kcontrol,32 20 222222222222222222222222222222struct2snd_ctl_elem_> *ucontrol)32 21{32 22 222222ucontrol->> .integer.> [0] =2kcontrol->private_> ;32 23 222222return 0;32 24}32 2532 26static struct2snd_kcontrol_new jack_detec>_kctl = {32 27 222222/* nam is filled later */2 28 222222.ifac = SNDRV_CTL_ELEM_IFACE_CARD,32 29 222222.access = SNDRV_CTL_ELEM_ACCESS_READ,32 30 222222.info = jack_detec>_kctl_info,32 31 222222.get = jack_detec>_kctl_get,32 32};32 3332 34struct2snd_kcontrol *32 35snd_kctl_jack_new(const char *nam , int2idx, void *private_data)32 36{32 37 222222struct2snd_kcontrol *kctl;32 38 222222kctl = snd_ctl_new1(&jack_detec>_kctl, private_data);32 39 222222if (!kctl)32 40 22222222222222return NULL;32 41 222222snprintf(kctl->id.nam , sizeof(kctl->id.nam ),2"%s Jack"nam );32 42 222222kctl->id.index = idx;32 43 222222kctl->private_> = 0;32 44 222222return kctl;32 45}32 46EXPORT_SYMBOL_GPL(snd_kctl_jack_new);32 4732 48void snd_kctl_jack_report(struct2snd_card *card,32 49 222222222222222222222222struct2snd_kcontrol *kctl, bool status)32 50{32 51 222222if (kctl->private_> == status)32 52 22222222222222return;32 53 222222kctl->private_> = status;32 54 222222snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);32 55}32 56EXPORT_SYMBOL_GPL(snd_kctl_jack_report);32 57 The original LXR software by the LXR community, this experimental vers by lxr@linux.no. lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and opera> s services since 1995.