Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wm8994.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <trace/events/asoc.h>
#include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/registers.h>
#include <linux/mfd/wm8994/pdata.h>
#include <linux/mfd/wm8994/gpio.h>
#include "wm8994.h"
#include "wm_hubs.h"

Go to the source code of this file.

Data Structures

struct  fll_div
 

Macros

#define WM1811_JACKDET_MODE_NONE   0x0000
 
#define WM1811_JACKDET_MODE_JACK   0x0100
 
#define WM1811_JACKDET_MODE_MIC   0x0080
 
#define WM1811_JACKDET_MODE_AUDIO   0x0180
 
#define WM8994_NUM_DRC   3
 
#define WM8994_NUM_EQ   3
 
#define WM8994_DRC_SWITCH(xname, reg, shift)
 
#define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert)
 
#define FIXED_FLL_SIZE   ((1 << 16) * 10)
 
#define WM8994_RATES   SNDRV_PCM_RATE_8000_96000
 
#define WM8994_FORMATS
 
#define wm8994_codec_suspend   NULL
 
#define wm8994_codec_resume   NULL
 

Functions

int wm8994_vmid_mode (struct snd_soc_codec *codec, enum wm8994_vmid_mode mode)
 
int wm8994_mic_detect (struct snd_soc_codec *codec, struct snd_soc_jack *jack, int micbias)
 
 EXPORT_SYMBOL_GPL (wm8994_mic_detect)
 
int wm8958_mic_detect (struct snd_soc_codec *codec, struct snd_soc_jack *jack, wm8958_micdet_cb cb, void *cb_data)
 
 EXPORT_SYMBOL_GPL (wm8958_mic_detect)
 
 module_platform_driver (wm8994_codec_driver)
 
 MODULE_DESCRIPTION ("ASoC WM8994 driver")
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:wm8994-codec")
 

Macro Definition Documentation

#define FIXED_FLL_SIZE   ((1 << 16) * 10)

Definition at line 2017 of file wm8994.c.

#define WM1811_JACKDET_MODE_AUDIO   0x0180

Definition at line 44 of file wm8994.c.

#define WM1811_JACKDET_MODE_JACK   0x0100

Definition at line 42 of file wm8994.c.

#define WM1811_JACKDET_MODE_MIC   0x0080

Definition at line 43 of file wm8994.c.

#define WM1811_JACKDET_MODE_NONE   0x0000

Definition at line 41 of file wm8994.c.

#define WM8994_CLASS_W_SWITCH (   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 = wm8994_put_class_w, \
.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }

Definition at line 1444 of file wm8994.c.

#define wm8994_codec_resume   NULL

Definition at line 3079 of file wm8994.c.

#define wm8994_codec_suspend   NULL

Definition at line 3078 of file wm8994.c.

#define WM8994_DRC_SWITCH (   xname,
  reg,
  shift 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.put = wm8994_put_drc_sw, \
.private_value = SOC_SINGLE_VALUE(reg, shift, 1, 0) }

Definition at line 296 of file wm8994.c.

#define WM8994_FORMATS
Value:

Definition at line 2928 of file wm8994.c.

#define WM8994_NUM_DRC   3

Definition at line 46 of file wm8994.c.

#define WM8994_NUM_EQ   3

Definition at line 47 of file wm8994.c.

#define WM8994_RATES   SNDRV_PCM_RATE_8000_96000

Definition at line 2926 of file wm8994.c.

Function Documentation

EXPORT_SYMBOL_GPL ( wm8994_mic_detect  )
EXPORT_SYMBOL_GPL ( wm8958_mic_detect  )
MODULE_ALIAS ( "platform:wm8994-codec )
MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC WM8994 driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( wm8994_codec_driver  )
int wm8958_mic_detect ( struct snd_soc_codec codec,
struct snd_soc_jack jack,
wm8958_micdet_cb  cb,
void cb_data 
)

wm8958_mic_detect - Enable microphone detection via the WM8958 IRQ

: WM8958 codec : jack to report detection events on

Enable microphone detection functionality for the WM8958. By default simple detection which supports the detection of up to 6 buttons plus video and microphone functionality is supported.

The WM8958 has an advanced jack detection facility which is able to support complex accessory detection, especially when used in conjunction with external circuitry. In order to provide maximum flexiblity a callback is provided which allows a completely custom detection algorithm.

Definition at line 3601 of file wm8994.c.

int wm8994_mic_detect ( struct snd_soc_codec codec,
struct snd_soc_jack jack,
int  micbias 
)

wm8994_mic_detect - Enable microphone detection via the WM8994 IRQ

: WM8994 codec : jack to report detection events on : microphone bias to detect on

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

Configuration of detection levels is available via the micbias1_lvl and micbias2_lvl platform data members.

Definition at line 3244 of file wm8994.c.

Definition at line 2456 of file wm8994.c.

Variable Documentation

unsigned int mask

Definition at line 51 of file wm8994.c.

int rate

Definition at line 2620 of file wm8994.c.

unsigned int reg

Definition at line 50 of file wm8994.c.

int val

Definition at line 2620 of file wm8994.c.