Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
jack.c File Reference
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/jack.h>
#include <sound/core.h>

Go to the source code of this file.

Functions

int snd_jack_new (struct snd_card *card, const char *id, int type, struct snd_jack **jjack)
 
 EXPORT_SYMBOL (snd_jack_new)
 
void snd_jack_set_parent (struct snd_jack *jack, struct device *parent)
 
 EXPORT_SYMBOL (snd_jack_set_parent)
 
int snd_jack_set_key (struct snd_jack *jack, enum snd_jack_types type, int keytype)
 
 EXPORT_SYMBOL (snd_jack_set_key)
 
void snd_jack_report (struct snd_jack *jack, int status)
 
 EXPORT_SYMBOL (snd_jack_report)
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_DESCRIPTION ("Jack detection support for ALSA")
 
 MODULE_LICENSE ("GPL")
 

Function Documentation

EXPORT_SYMBOL ( snd_jack_new  )
EXPORT_SYMBOL ( snd_jack_set_parent  )
EXPORT_SYMBOL ( snd_jack_set_key  )
EXPORT_SYMBOL ( snd_jack_report  )
MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "Jack detection support for ALSA"  )
MODULE_LICENSE ( "GPL"  )
int snd_jack_new ( struct snd_card card,
const char id,
int  type,
struct snd_jack **  jjack 
)

snd_jack_new - Create a new jack : the card instance : an identifying string for this jack : a bitmask of enum snd_jack_type values that can be detected by this jack : Used to provide the allocated jack object to the caller.

Creates a new jack object.

Returns zero if successful, or a negative error code on failure. On success jjack will be initialised.

Definition at line 104 of file jack.c.

void snd_jack_report ( struct snd_jack jack,
int  status 
)

snd_jack_report - Report the current status of a jack

: The jack to report status for : The current status of the jack

Definition at line 216 of file jack.c.

int snd_jack_set_key ( struct snd_jack jack,
enum snd_jack_types  type,
int  keytype 
)

snd_jack_set_key - Set a key mapping on a jack

: The jack to configure : Jack report type for this key : Input layer key type to be reported

Map a SND_JACK_BTN_ button type to an input layer key, allowing reporting of keys on accessories via the jack abstraction. If no mapping is provided but keys are enabled in the jack type then BTN_n numeric buttons will be reported.

If jacks are not reporting via the input API this call will have no effect.

Note that this is intended to be use by simple devices with small numbers of keys that can be reported. It is also possible to access the input device directly - devices with complex input capabilities on accessories should consider doing this rather than using this abstraction.

This function may only be called prior to registration of the jack.

Definition at line 193 of file jack.c.

void snd_jack_set_parent ( struct snd_jack jack,
struct device parent 
)

snd_jack_set_parent - Set the parent device for a jack

: The jack to configure : The device to set as parent for the jack.

Set the parent for the jack devices in the device tree. This function is only valid prior to registration of the jack. If no parent is configured then the parent device will be the sound card.

Definition at line 162 of file jack.c.