Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
soc-jack.c File Reference
#include <sound/jack.h>
#include <sound/soc.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <trace/events/asoc.h>

Go to the source code of this file.

Functions

int snd_soc_jack_new (struct snd_soc_codec *codec, const char *id, int type, struct snd_soc_jack *jack)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_new)
 
void snd_soc_jack_report (struct snd_soc_jack *jack, int status, int mask)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_report)
 
int snd_soc_jack_add_zones (struct snd_soc_jack *jack, int count, struct snd_soc_jack_zone *zones)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_add_zones)
 
int snd_soc_jack_get_type (struct snd_soc_jack *jack, int micbias_voltage)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_get_type)
 
int snd_soc_jack_add_pins (struct snd_soc_jack *jack, int count, struct snd_soc_jack_pin *pins)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_add_pins)
 
void snd_soc_jack_notifier_register (struct snd_soc_jack *jack, struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_notifier_register)
 
void snd_soc_jack_notifier_unregister (struct snd_soc_jack *jack, struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (snd_soc_jack_notifier_unregister)
 

Function Documentation

EXPORT_SYMBOL_GPL ( snd_soc_jack_new  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_report  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_add_zones  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_get_type  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_add_pins  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_notifier_register  )
EXPORT_SYMBOL_GPL ( snd_soc_jack_notifier_unregister  )
int snd_soc_jack_add_pins ( struct snd_soc_jack jack,
int  count,
struct snd_soc_jack_pin pins 
)

snd_soc_jack_add_pins - Associate DAPM pins with an ASoC jack

: ASoC jack : Number of pins : Array of pins

After this function has been called the DAPM pins specified in the pins array will have their status updated to reflect the current state of the jack whenever the jack status is updated.

Definition at line 168 of file soc-jack.c.

int snd_soc_jack_add_zones ( struct snd_soc_jack jack,
int  count,
struct snd_soc_jack_zone zones 
)

snd_soc_jack_add_zones - Associate voltage zones with jack

: ASoC jack : Number of zones : Array of zones

After this function has been called the zones specified in the array will be associated with the jack.

Definition at line 121 of file soc-jack.c.

int snd_soc_jack_get_type ( struct snd_soc_jack jack,
int  micbias_voltage 
)

snd_soc_jack_get_type - Based on the mic bias value, this function returns the type of jack from the zones declared in the jack type

: ASoC jack : mic bias voltage at adc channel when jack is plugged in

Based on the mic bias value passed, this function helps identify the type of jack from the already declared jack zones

Definition at line 144 of file soc-jack.c.

int snd_soc_jack_new ( struct snd_soc_codec codec,
const char id,
int  type,
struct snd_soc_jack jack 
)

snd_soc_jack_new - Create a new jack : ASoC codec : an identifying string for this jack : a bitmask of enum snd_jack_type values that can be detected by this jack : structure to use for the jack

Creates a new jack object.

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

Definition at line 36 of file soc-jack.c.

void snd_soc_jack_notifier_register ( struct snd_soc_jack jack,
struct notifier_block nb 
)

snd_soc_jack_notifier_register - Register a notifier for jack status

: ASoC jack : Notifier block to register

Register for notification of the current status of the jack. Note that it is not possible to report additional jack events in the callback from the notifier, this is intended to support applications such as enabling electrical detection only when a mechanical detection event has occurred.

Definition at line 212 of file soc-jack.c.

void snd_soc_jack_notifier_unregister ( struct snd_soc_jack jack,
struct notifier_block nb 
)

snd_soc_jack_notifier_unregister - Unregister a notifier for jack status

: ASoC jack : Notifier block to unregister

Stop notifying for status changes.

Definition at line 227 of file soc-jack.c.

void snd_soc_jack_report ( struct snd_soc_jack jack,
int  status,
int  mask 
)

snd_soc_jack_report - Report the current status for a jack

: the jack : a bitmask of enum snd_jack_type values that are currently detected. : a bitmask of enum snd_jack_type values that being reported.

If configured using snd_soc_jack_add_pins() then the associated DAPM pins will be enabled or disabled as appropriate and DAPM synchronised.

Note: This function uses mutexes and should be called from a context which can sleep (such as a workqueue).

Definition at line 63 of file soc-jack.c.