Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
tlv320dac33.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/interrupt.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.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 <sound/tlv320dac33-plat.h>
#include "tlv320dac33.h"

Go to the source code of this file.

Data Structures

struct  tlv320dac33_priv
 

Macros

#define DAC33_FIFO_SIZE_16BIT   6144
 
#define DAC33_FIFO_SIZE_24BIT   4096
 
#define DAC33_MODE7_MARGIN   10 /* Safety margin for FIFO in Mode7 */
 
#define BURST_BASEFREQ_HZ   49152000
 
#define SAMPLES_TO_US(rate, samples)   (1000000000 / (((rate) * 1000) / (samples)))
 
#define US_TO_SAMPLES(rate, us)   ((rate) / (1000000 / ((us) < 1000000 ? (us) : 1000000)))
 
#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate)   (((samples)*5000) / (((burstrate)*5000) / ((burstrate) - (playrate))))
 
#define DAC33_NUM_SUPPLIES   3
 
#define DAC33_I2C_ADDR_AUTOINC   0x80
 
#define CALC_BURST_RATE(bclkdiv, bclk_per_sample)   (BURST_BASEFREQ_HZ / bclkdiv / bclk_per_sample)
 
#define CALC_OSCSET(rate, refclk)
 
#define CALC_RATIOSET(rate, refclk)
 
#define DAC33_RATES
 
#define DAC33_FORMATS   (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
 

Enumerations

enum  dac33_state { DAC33_IDLE = 0, DAC33_PREFILL, DAC33_PLAYBACK, DAC33_FLUSH }
 
enum  dac33_fifo_modes { DAC33_FIFO_BYPASS = 0, DAC33_FIFO_MODE1, DAC33_FIFO_MODE7, DAC33_FIFO_LAST_MODE }
 

Functions

 MODULE_DEVICE_TABLE (i2c, tlv320dac33_i2c_id)
 
 module_i2c_driver (tlv320dac33_i2c_driver)
 
 MODULE_DESCRIPTION ("ASoC TLV320DAC33 codec driver")
 
 MODULE_AUTHOR ("Peter Ujfalusi <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BURST_BASEFREQ_HZ   49152000

Definition at line 54 of file tlv320dac33.c.

#define CALC_BURST_RATE (   bclkdiv,
  bclk_per_sample 
)    (BURST_BASEFREQ_HZ / bclkdiv / bclk_per_sample)

Definition at line 822 of file tlv320dac33.c.

#define CALC_OSCSET (   rate,
  refclk 
)
Value:
( \
((((rate * 10000) / refclk) * 4096) + 7000) / 10000)

Definition at line 860 of file tlv320dac33.c.

#define CALC_RATIOSET (   rate,
  refclk 
)
Value:
( \
((((refclk * 100000) / rate) * 16384) + 50000) / 100000)

Definition at line 862 of file tlv320dac33.c.

#define DAC33_FIFO_SIZE_16BIT   6144

Definition at line 50 of file tlv320dac33.c.

#define DAC33_FIFO_SIZE_24BIT   4096

Definition at line 51 of file tlv320dac33.c.

#define DAC33_FORMATS   (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)

Definition at line 1492 of file tlv320dac33.c.

#define DAC33_I2C_ADDR_AUTOINC   0x80

Definition at line 261 of file tlv320dac33.c.

#define DAC33_MODE7_MARGIN   10 /* Safety margin for FIFO in Mode7 */

Definition at line 52 of file tlv320dac33.c.

#define DAC33_NUM_SUPPLIES   3

Definition at line 84 of file tlv320dac33.c.

#define DAC33_RATES
Value:
SNDRV_PCM_RATE_48000)

Definition at line 1490 of file tlv320dac33.c.

#define SAMPLES_TO_US (   rate,
  samples 
)    (1000000000 / (((rate) * 1000) / (samples)))

Definition at line 56 of file tlv320dac33.c.

#define US_TO_SAMPLES (   rate,
  us 
)    ((rate) / (1000000 / ((us) < 1000000 ? (us) : 1000000)))

Definition at line 59 of file tlv320dac33.c.

#define UTHR_FROM_PERIOD_SIZE (   samples,
  playrate,
  burstrate 
)    (((samples)*5000) / (((burstrate)*5000) / ((burstrate) - (playrate))))

Definition at line 62 of file tlv320dac33.c.

Enumeration Type Documentation

Enumerator:
DAC33_FIFO_BYPASS 
DAC33_FIFO_MODE1 
DAC33_FIFO_MODE7 
DAC33_FIFO_LAST_MODE 

Definition at line 77 of file tlv320dac33.c.

Enumerator:
DAC33_IDLE 
DAC33_PREFILL 
DAC33_PLAYBACK 
DAC33_FLUSH 

Definition at line 70 of file tlv320dac33.c.

Function Documentation

MODULE_AUTHOR ( "Peter Ujfalusi <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC TLV320DAC33 codec driver )
MODULE_DEVICE_TABLE ( i2c  ,
tlv320dac33_i2c_id   
)
module_i2c_driver ( tlv320dac33_i2c_driver  )
MODULE_LICENSE ( "GPL"  )