Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wm8903.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/irq.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/wm8903.h>
#include <trace/events/asoc.h>
#include "wm8903.h"

Go to the source code of this file.

Data Structures

struct  wm8903_priv
 

Macros

#define WM8903_DCS_MODE_WRITE_STOP   0
 
#define WM8903_DCS_MODE_START_STOP   2
 
#define SOC_DAPM_SINGLE_W(xname, reg, shift, max, invert)
 
#define WM8903_PLAYBACK_RATES
 
#define WM8903_CAPTURE_RATES
 
#define WM8903_FORMATS
 

Functions

int wm8903_mic_detect (struct snd_soc_codec *codec, struct snd_soc_jack *jack, int det, int shrt)
 
 EXPORT_SYMBOL_GPL (wm8903_mic_detect)
 
 MODULE_DEVICE_TABLE (of, wm8903_of_match)
 
 MODULE_DEVICE_TABLE (i2c, wm8903_i2c_id)
 
 module_i2c_driver (wm8903_i2c_driver)
 
 MODULE_DESCRIPTION ("ASoC WM8903 driver")
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define SOC_DAPM_SINGLE_W (   xname,
  reg,
  shift,
  max,
  invert 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_volsw, \
.get = snd_soc_dapm_get_volsw, .put = wm8903_class_w_put, \
.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }

Definition at line 405 of file wm8903.c.

#define WM8903_CAPTURE_RATES
Value:
SNDRV_PCM_RATE_11025 | \
SNDRV_PCM_RATE_16000 | \
SNDRV_PCM_RATE_22050 | \
SNDRV_PCM_RATE_32000 | \
SNDRV_PCM_RATE_44100 | \
SNDRV_PCM_RATE_48000)

Definition at line 1720 of file wm8903.c.

#define WM8903_DCS_MODE_START_STOP   2

Definition at line 279 of file wm8903.c.

#define WM8903_DCS_MODE_WRITE_STOP   0

Definition at line 278 of file wm8903.c.

#define WM8903_FORMATS
Value:
SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE)

Definition at line 1728 of file wm8903.c.

#define WM8903_PLAYBACK_RATES
Value:
SNDRV_PCM_RATE_11025 | \
SNDRV_PCM_RATE_16000 | \
SNDRV_PCM_RATE_22050 | \
SNDRV_PCM_RATE_32000 | \
SNDRV_PCM_RATE_44100 | \
SNDRV_PCM_RATE_48000 | \
SNDRV_PCM_RATE_88200 | \
SNDRV_PCM_RATE_96000)

Definition at line 1710 of file wm8903.c.

Function Documentation

EXPORT_SYMBOL_GPL ( wm8903_mic_detect  )
MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC WM8903 driver )
MODULE_DEVICE_TABLE ( of  ,
wm8903_of_match   
)
MODULE_DEVICE_TABLE ( i2c  ,
wm8903_i2c_id   
)
module_i2c_driver ( wm8903_i2c_driver  )
MODULE_LICENSE ( "GPL"  )
int wm8903_mic_detect ( struct snd_soc_codec codec,
struct snd_soc_jack jack,
int  det,
int  shrt 
)

wm8903_mic_detect - Enable microphone detection via the WM8903 IRQ

: WM8903 codec : jack to report detection events on : value to report for presence detection : value to report for short detection

Enable microphone detection via IRQ on the WM8903. If GPIOs are being used to bring out signals to the processor then only platform data configuration is needed for WM8903 and processor GPIOs should be configured using snd_soc_jack_add_gpios() instead.

The current threasholds for detection should be configured using micdet_cfg in the platform data. Using this function will force on the microphone bias for the device.

Definition at line 1597 of file wm8903.c.

Variable Documentation

int div

Definition at line 1325 of file wm8903.c.

int mclk_div

Definition at line 1328 of file wm8903.c.

int mode

Definition at line 1327 of file wm8903.c.

int rate

Definition at line 1326 of file wm8903.c.

int ratio

Definition at line 1391 of file wm8903.c.

int value

Definition at line 1416 of file wm8903.c.