Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
twl4030.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/of.h>
#include <linux/of_gpio.h>
#include <linux/i2c/twl.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <linux/mfd/twl4030-audio.h>

Go to the source code of this file.

Data Structures

struct  twl4030_priv
 

Macros

#define TWL4030_REG_SW_SHADOW   0x4A
 
#define TWL4030_CACHEREGNUM   (TWL4030_REG_SW_SHADOW + 1)
 
#define TWL4030_HFL_EN   0x01
 
#define TWL4030_HFR_EN   0x02
 
#define TWL4030_OUTPUT_PGA(pin_name, reg, mask)
 
#define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
 
#define TWL4030_FORMATS   (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
 

Functions

 TWL4030_OUTPUT_PGA (earpiece, TWL4030_REG_EAR_CTL, TWL4030_EAR_GAIN)
 
 TWL4030_OUTPUT_PGA (predrivel, TWL4030_REG_PREDL_CTL, TWL4030_PREDL_GAIN)
 
 TWL4030_OUTPUT_PGA (predriver, TWL4030_REG_PREDR_CTL, TWL4030_PREDR_GAIN)
 
 TWL4030_OUTPUT_PGA (carkitl, TWL4030_REG_PRECKL_CTL, TWL4030_PRECKL_GAIN)
 
 TWL4030_OUTPUT_PGA (carkitr, TWL4030_REG_PRECKR_CTL, TWL4030_PRECKR_GAIN)
 
 MODULE_ALIAS ("platform:twl4030-codec")
 
 module_platform_driver (twl4030_codec_driver)
 
 MODULE_DESCRIPTION ("ASoC TWL4030 codec driver")
 
 MODULE_AUTHOR ("Steve Sakoman")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define TWL4030_CACHEREGNUM   (TWL4030_REG_SW_SHADOW + 1)

Definition at line 46 of file twl4030.c.

#define TWL4030_FORMATS   (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)

Definition at line 2213 of file twl4030.c.

#define TWL4030_HFL_EN   0x01

Definition at line 49 of file twl4030.c.

#define TWL4030_HFR_EN   0x02

Definition at line 50 of file twl4030.c.

#define TWL4030_OUTPUT_PGA (   pin_name,
  reg,
  mask 
)
Value:
static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \
struct snd_kcontrol *kcontrol, int event) \
{ \
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); \
\
switch (event) { \
twl4030->pin_name##_enabled = 1; \
twl4030_write(w->codec, reg, \
twl4030_read_reg_cache(w->codec, reg)); \
break; \
twl4030->pin_name##_enabled = 0; \
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, \
0, reg); \
break; \
} \
return 0; \
}

Definition at line 664 of file twl4030.c.

#define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)

Definition at line 2212 of file twl4030.c.

#define TWL4030_REG_SW_SHADOW   0x4A

Definition at line 45 of file twl4030.c.

Function Documentation

MODULE_ALIAS ( "platform:twl4030-codec )
MODULE_AUTHOR ( "Steve Sakoman"  )
MODULE_DESCRIPTION ( "ASoC TWL4030 codec driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( twl4030_codec_driver  )
TWL4030_OUTPUT_PGA ( earpiece  ,
TWL4030_REG_EAR_CTL  ,
TWL4030_EAR_GAIN   
)
TWL4030_OUTPUT_PGA ( predrivel  ,
TWL4030_REG_PREDL_CTL  ,
TWL4030_PREDL_GAIN   
)
TWL4030_OUTPUT_PGA ( predriver  ,
TWL4030_REG_PREDR_CTL  ,
TWL4030_PREDR_GAIN   
)
TWL4030_OUTPUT_PGA ( carkitl  ,
TWL4030_REG_PRECKL_CTL  ,
TWL4030_PRECKL_GAIN   
)
TWL4030_OUTPUT_PGA ( carkitr  ,
TWL4030_REG_PRECKR_CTL  ,
TWL4030_PRECKR_GAIN   
)