Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wm5100.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/gcd.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/fixed.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/wm5100.h>
#include "wm5100.h"

Go to the source code of this file.

Data Structures

struct  wm5100_fll
 
struct  wm5100_priv
 
struct  _fll_div
 

Macros

#define WM5100_NUM_CORE_SUPPLIES   2
 
#define WM5100_AIFS   3
 
#define WM5100_SYNC_SRS   3
 
#define WM5100_MIXER_CONTROLS(name, base)
 
#define WM5100_MUX_ENUM_DECL(name, reg)
 
#define WM5100_MUX_CTL_DECL(name)
 
#define WM5100_MIXER_ENUMS(name, base_reg)
 
#define WM5100_MUX(name, ctrl)   SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl)
 
#define WM5100_MIXER_WIDGETS(name, name_str)
 
#define WM5100_MIXER_INPUT_ROUTES(name)
 
#define WM5100_MIXER_ROUTES(widget, name)
 
#define WM5100_NUM_BCLK_RATES   19
 
#define WM5100_RATES   SNDRV_PCM_RATE_8000_192000
 
#define WM5100_FORMATS
 

Functions

 WM5100_MIXER_ENUMS (HPOUT1L, WM5100_OUT1LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (HPOUT1R, WM5100_OUT1RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (HPOUT2L, WM5100_OUT2LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (HPOUT2R, WM5100_OUT2RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (HPOUT3L, WM5100_OUT3LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (HPOUT3R, WM5100_OUT3RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKOUTL, WM5100_OUT4LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKOUTR, WM5100_OUT4RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKDAT1L, WM5100_OUT5LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKDAT1R, WM5100_OUT5RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKDAT2L, WM5100_OUT6LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (SPKDAT2R, WM5100_OUT6RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (PWM1, WM5100_PWM1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (PWM2, WM5100_PWM1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX1, WM5100_AIF1TX1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX2, WM5100_AIF1TX2MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX3, WM5100_AIF1TX3MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX4, WM5100_AIF1TX4MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX5, WM5100_AIF1TX5MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX6, WM5100_AIF1TX6MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX7, WM5100_AIF1TX7MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF1TX8, WM5100_AIF1TX8MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF2TX1, WM5100_AIF2TX1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF2TX2, WM5100_AIF2TX2MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF3TX1, WM5100_AIF1TX1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (AIF3TX2, WM5100_AIF1TX2MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (EQ1, WM5100_EQ1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (EQ2, WM5100_EQ2MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (EQ3, WM5100_EQ3MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (EQ4, WM5100_EQ4MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (DRC1L, WM5100_DRC1LMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (DRC1R, WM5100_DRC1RMIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (LHPF1, WM5100_HPLP1MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (LHPF2, WM5100_HPLP2MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (LHPF3, WM5100_HPLP3MIX_INPUT_1_SOURCE)
 
 WM5100_MIXER_ENUMS (LHPF4, WM5100_HPLP4MIX_INPUT_1_SOURCE)
 
int wm5100_detect (struct snd_soc_codec *codec, struct snd_soc_jack *jack)
 
 MODULE_DEVICE_TABLE (i2c, wm5100_i2c_id)
 
 module_i2c_driver (wm5100_i2c_driver)
 
 MODULE_DESCRIPTION ("ASoC WM5100 driver")
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define WM5100_AIFS   3

Definition at line 42 of file wm5100.c.

#define WM5100_FORMATS
Value:

Definition at line 1875 of file wm5100.c.

#define WM5100_MIXER_CONTROLS (   name,
  base 
)
Value:
SOC_SINGLE_TLV(name " Input 1 Volume", base + 1 , \
WM5100_MIXER_VOL_SHIFT, 80, 0, mixer_tlv), \
SOC_SINGLE_TLV(name " Input 2 Volume", base + 3 , \
WM5100_MIXER_VOL_SHIFT, 80, 0, mixer_tlv), \
SOC_SINGLE_TLV(name " Input 3 Volume", base + 5 , \
WM5100_MIXER_VOL_SHIFT, 80, 0, mixer_tlv), \
SOC_SINGLE_TLV(name " Input 4 Volume", base + 7 , \
WM5100_MIXER_VOL_SHIFT, 80, 0, mixer_tlv)

Definition at line 376 of file wm5100.c.

#define WM5100_MIXER_ENUMS (   name,
  base_reg 
)
Value:
static WM5100_MUX_ENUM_DECL(name##_in1_enum, base_reg); \
static WM5100_MUX_ENUM_DECL(name##_in2_enum, base_reg + 2); \
static WM5100_MUX_ENUM_DECL(name##_in3_enum, base_reg + 4); \
static WM5100_MUX_ENUM_DECL(name##_in4_enum, base_reg + 6); \
static WM5100_MUX_CTL_DECL(name##_in1); \
static WM5100_MUX_CTL_DECL(name##_in2); \
static WM5100_MUX_CTL_DECL(name##_in3); \
static WM5100_MUX_CTL_DECL(name##_in4)

Definition at line 394 of file wm5100.c.

#define WM5100_MIXER_INPUT_ROUTES (   name)

Definition at line 459 of file wm5100.c.

#define WM5100_MIXER_ROUTES (   widget,
  name 
)
Value:
{ widget, NULL, name " Mixer" }, \
{ name " Mixer", NULL, name " Input 1" }, \
{ name " Mixer", NULL, name " Input 2" }, \
{ name " Mixer", NULL, name " Input 3" }, \
{ name " Mixer", NULL, name " Input 4" }, \
WM5100_MIXER_INPUT_ROUTES(name " Input 1"), \
WM5100_MIXER_INPUT_ROUTES(name " Input 2"), \
WM5100_MIXER_INPUT_ROUTES(name " Input 3"), \
WM5100_MIXER_INPUT_ROUTES(name " Input 4")

Definition at line 493 of file wm5100.c.

#define WM5100_MIXER_WIDGETS (   name,
  name_str 
)
Value:
WM5100_MUX(name_str " Input 1", &name##_in1_mux), \
WM5100_MUX(name_str " Input 2", &name##_in2_mux), \
WM5100_MUX(name_str " Input 3", &name##_in3_mux), \
WM5100_MUX(name_str " Input 4", &name##_in4_mux), \
SND_SOC_DAPM_MIXER(name_str " Mixer", SND_SOC_NOPM, 0, 0, NULL, 0)

Definition at line 452 of file wm5100.c.

#define WM5100_MUX (   name,
  ctrl 
)    SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl)

Definition at line 449 of file wm5100.c.

#define WM5100_MUX_CTL_DECL (   name)
Value:
const struct snd_kcontrol_new name##_mux = \
SOC_DAPM_VALUE_ENUM("Route", name##_enum)

Definition at line 390 of file wm5100.c.

#define WM5100_MUX_ENUM_DECL (   name,
  reg 
)
Value:
wm5100_mixer_texts, wm5100_mixer_values)

Definition at line 386 of file wm5100.c.

#define WM5100_NUM_BCLK_RATES   19

Definition at line 1344 of file wm5100.c.

#define WM5100_NUM_CORE_SUPPLIES   2

Definition at line 36 of file wm5100.c.

#define WM5100_RATES   SNDRV_PCM_RATE_8000_192000

Definition at line 1873 of file wm5100.c.

#define WM5100_SYNC_SRS   3

Definition at line 43 of file wm5100.c.

Function Documentation

MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC WM5100 driver )
MODULE_DEVICE_TABLE ( i2c  ,
wm5100_i2c_id   
)
module_i2c_driver ( wm5100_i2c_driver  )
MODULE_LICENSE ( "GPL"  )
int wm5100_detect ( struct snd_soc_codec codec,
struct snd_soc_jack jack 
)

Definition at line 2091 of file wm5100.c.

WM5100_MIXER_ENUMS ( HPOUT1L  ,
WM5100_OUT1LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( HPOUT1R  ,
WM5100_OUT1RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( HPOUT2L  ,
WM5100_OUT2LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( HPOUT2R  ,
WM5100_OUT2RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( HPOUT3L  ,
WM5100_OUT3LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( HPOUT3R  ,
WM5100_OUT3RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKOUTL  ,
WM5100_OUT4LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKOUTR  ,
WM5100_OUT4RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKDAT1L  ,
WM5100_OUT5LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKDAT1R  ,
WM5100_OUT5RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKDAT2L  ,
WM5100_OUT6LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( SPKDAT2R  ,
WM5100_OUT6RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( PWM1  ,
WM5100_PWM1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( PWM2  ,
WM5100_PWM1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX1  ,
WM5100_AIF1TX1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX2  ,
WM5100_AIF1TX2MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX3  ,
WM5100_AIF1TX3MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX4  ,
WM5100_AIF1TX4MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX5  ,
WM5100_AIF1TX5MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX6  ,
WM5100_AIF1TX6MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX7  ,
WM5100_AIF1TX7MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF1TX8  ,
WM5100_AIF1TX8MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF2TX1  ,
WM5100_AIF2TX1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF2TX2  ,
WM5100_AIF2TX2MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF3TX1  ,
WM5100_AIF1TX1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( AIF3TX2  ,
WM5100_AIF1TX2MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( EQ1  ,
WM5100_EQ1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( EQ2  ,
WM5100_EQ2MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( EQ3  ,
WM5100_EQ3MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( EQ4  ,
WM5100_EQ4MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( DRC1L  ,
WM5100_DRC1LMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( DRC1R  ,
WM5100_DRC1RMIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( LHPF1  ,
WM5100_HPLP1MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( LHPF2  ,
WM5100_HPLP2MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( LHPF3  ,
WM5100_HPLP3MIX_INPUT_1_SOURCE   
)
WM5100_MIXER_ENUMS ( LHPF4  ,
WM5100_HPLP4MIX_INPUT_1_SOURCE   
)

Variable Documentation

u16 fll_fratio

Definition at line 1662 of file wm5100.c.

unsigned int max

Definition at line 1661 of file wm5100.c.

unsigned int min

Definition at line 1660 of file wm5100.c.

int ratio

Definition at line 1663 of file wm5100.c.