Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cs4270.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/regulator/consumer.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>

Go to the source code of this file.

Data Structures

struct  cs4270_private
 
struct  cs4270_mode_ratios
 

Macros

#define CS4270_FORMATS
 
#define CS4270_CHIPID   0x01 /* Chip ID */
 
#define CS4270_PWRCTL   0x02 /* Power Control */
 
#define CS4270_MODE   0x03 /* Mode Control */
 
#define CS4270_FORMAT   0x04 /* Serial Format, ADC/DAC Control */
 
#define CS4270_TRANS   0x05 /* Transition Control */
 
#define CS4270_MUTE   0x06 /* Mute Control */
 
#define CS4270_VOLA   0x07 /* DAC Channel A Volume Control */
 
#define CS4270_VOLB   0x08 /* DAC Channel B Volume Control */
 
#define CS4270_FIRSTREG   0x01
 
#define CS4270_LASTREG   0x08
 
#define CS4270_NUMREGS   (CS4270_LASTREG - CS4270_FIRSTREG + 1)
 
#define CS4270_I2C_INCR   0x80
 
#define CS4270_CHIPID_ID   0xF0
 
#define CS4270_CHIPID_REV   0x0F
 
#define CS4270_PWRCTL_FREEZE   0x80
 
#define CS4270_PWRCTL_PDN_ADC   0x20
 
#define CS4270_PWRCTL_PDN_DAC   0x02
 
#define CS4270_PWRCTL_PDN   0x01
 
#define CS4270_PWRCTL_PDN_ALL   (CS4270_PWRCTL_PDN_ADC | CS4270_PWRCTL_PDN_DAC | CS4270_PWRCTL_PDN)
 
#define CS4270_MODE_SPEED_MASK   0x30
 
#define CS4270_MODE_1X   0x00
 
#define CS4270_MODE_2X   0x10
 
#define CS4270_MODE_4X   0x20
 
#define CS4270_MODE_SLAVE   0x30
 
#define CS4270_MODE_DIV_MASK   0x0E
 
#define CS4270_MODE_DIV1   0x00
 
#define CS4270_MODE_DIV15   0x02
 
#define CS4270_MODE_DIV2   0x04
 
#define CS4270_MODE_DIV3   0x06
 
#define CS4270_MODE_DIV4   0x08
 
#define CS4270_MODE_POPGUARD   0x01
 
#define CS4270_FORMAT_FREEZE_A   0x80
 
#define CS4270_FORMAT_FREEZE_B   0x40
 
#define CS4270_FORMAT_LOOPBACK   0x20
 
#define CS4270_FORMAT_DAC_MASK   0x18
 
#define CS4270_FORMAT_DAC_LJ   0x00
 
#define CS4270_FORMAT_DAC_I2S   0x08
 
#define CS4270_FORMAT_DAC_RJ16   0x18
 
#define CS4270_FORMAT_DAC_RJ24   0x10
 
#define CS4270_FORMAT_ADC_MASK   0x01
 
#define CS4270_FORMAT_ADC_LJ   0x00
 
#define CS4270_FORMAT_ADC_I2S   0x01
 
#define CS4270_TRANS_ONE_VOL   0x80
 
#define CS4270_TRANS_SOFT   0x40
 
#define CS4270_TRANS_ZERO   0x20
 
#define CS4270_TRANS_INV_ADC_A   0x08
 
#define CS4270_TRANS_INV_ADC_B   0x10
 
#define CS4270_TRANS_INV_DAC_A   0x02
 
#define CS4270_TRANS_INV_DAC_B   0x04
 
#define CS4270_TRANS_DEEMPH   0x01
 
#define CS4270_MUTE_AUTO   0x20
 
#define CS4270_MUTE_ADC_A   0x08
 
#define CS4270_MUTE_ADC_B   0x10
 
#define CS4270_MUTE_POLARITY   0x04
 
#define CS4270_MUTE_DAC_A   0x01
 
#define CS4270_MUTE_DAC_B   0x02
 
#define NUM_MCLK_RATIOS   ARRAY_SIZE(cs4270_mode_ratios)
 
#define cs4270_soc_suspend   NULL
 
#define cs4270_soc_resume   NULL
 

Functions

 MODULE_DEVICE_TABLE (of, cs4270_of_match)
 
 MODULE_DEVICE_TABLE (i2c, cs4270_id)
 
 module_i2c_driver (cs4270_i2c_driver)
 
 MODULE_AUTHOR ("Timur Tabi <[email protected]>")
 
 MODULE_DESCRIPTION ("Cirrus Logic CS4270 ALSA SoC Codec Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CS4270_CHIPID   0x01 /* Chip ID */

Definition at line 49 of file cs4270.c.

#define CS4270_CHIPID_ID   0xF0

Definition at line 64 of file cs4270.c.

#define CS4270_CHIPID_REV   0x0F

Definition at line 65 of file cs4270.c.

#define CS4270_FIRSTREG   0x01

Definition at line 58 of file cs4270.c.

#define CS4270_FORMAT   0x04 /* Serial Format, ADC/DAC Control */

Definition at line 52 of file cs4270.c.

#define CS4270_FORMAT_ADC_I2S   0x01

Definition at line 94 of file cs4270.c.

#define CS4270_FORMAT_ADC_LJ   0x00

Definition at line 93 of file cs4270.c.

#define CS4270_FORMAT_ADC_MASK   0x01

Definition at line 92 of file cs4270.c.

#define CS4270_FORMAT_DAC_I2S   0x08

Definition at line 89 of file cs4270.c.

#define CS4270_FORMAT_DAC_LJ   0x00

Definition at line 88 of file cs4270.c.

#define CS4270_FORMAT_DAC_MASK   0x18

Definition at line 87 of file cs4270.c.

#define CS4270_FORMAT_DAC_RJ16   0x18

Definition at line 90 of file cs4270.c.

#define CS4270_FORMAT_DAC_RJ24   0x10

Definition at line 91 of file cs4270.c.

#define CS4270_FORMAT_FREEZE_A   0x80

Definition at line 84 of file cs4270.c.

#define CS4270_FORMAT_FREEZE_B   0x40

Definition at line 85 of file cs4270.c.

#define CS4270_FORMAT_LOOPBACK   0x20

Definition at line 86 of file cs4270.c.

#define CS4270_FORMATS
Value:
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE)

Definition at line 41 of file cs4270.c.

#define CS4270_I2C_INCR   0x80

Definition at line 61 of file cs4270.c.

#define CS4270_LASTREG   0x08

Definition at line 59 of file cs4270.c.

#define CS4270_MODE   0x03 /* Mode Control */

Definition at line 51 of file cs4270.c.

#define CS4270_MODE_1X   0x00

Definition at line 73 of file cs4270.c.

#define CS4270_MODE_2X   0x10

Definition at line 74 of file cs4270.c.

#define CS4270_MODE_4X   0x20

Definition at line 75 of file cs4270.c.

#define CS4270_MODE_DIV1   0x00

Definition at line 78 of file cs4270.c.

#define CS4270_MODE_DIV15   0x02

Definition at line 79 of file cs4270.c.

#define CS4270_MODE_DIV2   0x04

Definition at line 80 of file cs4270.c.

#define CS4270_MODE_DIV3   0x06

Definition at line 81 of file cs4270.c.

#define CS4270_MODE_DIV4   0x08

Definition at line 82 of file cs4270.c.

#define CS4270_MODE_DIV_MASK   0x0E

Definition at line 77 of file cs4270.c.

#define CS4270_MODE_POPGUARD   0x01

Definition at line 83 of file cs4270.c.

#define CS4270_MODE_SLAVE   0x30

Definition at line 76 of file cs4270.c.

#define CS4270_MODE_SPEED_MASK   0x30

Definition at line 72 of file cs4270.c.

#define CS4270_MUTE   0x06 /* Mute Control */

Definition at line 54 of file cs4270.c.

#define CS4270_MUTE_ADC_A   0x08

Definition at line 104 of file cs4270.c.

#define CS4270_MUTE_ADC_B   0x10

Definition at line 105 of file cs4270.c.

#define CS4270_MUTE_AUTO   0x20

Definition at line 103 of file cs4270.c.

#define CS4270_MUTE_DAC_A   0x01

Definition at line 107 of file cs4270.c.

#define CS4270_MUTE_DAC_B   0x02

Definition at line 108 of file cs4270.c.

#define CS4270_MUTE_POLARITY   0x04

Definition at line 106 of file cs4270.c.

#define CS4270_NUMREGS   (CS4270_LASTREG - CS4270_FIRSTREG + 1)

Definition at line 60 of file cs4270.c.

#define CS4270_PWRCTL   0x02 /* Power Control */

Definition at line 50 of file cs4270.c.

#define CS4270_PWRCTL_FREEZE   0x80

Definition at line 66 of file cs4270.c.

#define CS4270_PWRCTL_PDN   0x01

Definition at line 69 of file cs4270.c.

#define CS4270_PWRCTL_PDN_ADC   0x20

Definition at line 67 of file cs4270.c.

#define CS4270_PWRCTL_PDN_ALL   (CS4270_PWRCTL_PDN_ADC | CS4270_PWRCTL_PDN_DAC | CS4270_PWRCTL_PDN)

Definition at line 70 of file cs4270.c.

#define CS4270_PWRCTL_PDN_DAC   0x02

Definition at line 68 of file cs4270.c.

#define cs4270_soc_resume   NULL

Definition at line 601 of file cs4270.c.

#define cs4270_soc_suspend   NULL

Definition at line 600 of file cs4270.c.

#define CS4270_TRANS   0x05 /* Transition Control */

Definition at line 53 of file cs4270.c.

#define CS4270_TRANS_DEEMPH   0x01

Definition at line 102 of file cs4270.c.

#define CS4270_TRANS_INV_ADC_A   0x08

Definition at line 98 of file cs4270.c.

#define CS4270_TRANS_INV_ADC_B   0x10

Definition at line 99 of file cs4270.c.

#define CS4270_TRANS_INV_DAC_A   0x02

Definition at line 100 of file cs4270.c.

#define CS4270_TRANS_INV_DAC_B   0x04

Definition at line 101 of file cs4270.c.

#define CS4270_TRANS_ONE_VOL   0x80

Definition at line 95 of file cs4270.c.

#define CS4270_TRANS_SOFT   0x40

Definition at line 96 of file cs4270.c.

#define CS4270_TRANS_ZERO   0x20

Definition at line 97 of file cs4270.c.

#define CS4270_VOLA   0x07 /* DAC Channel A Volume Control */

Definition at line 55 of file cs4270.c.

#define CS4270_VOLB   0x08 /* DAC Channel B Volume Control */

Definition at line 56 of file cs4270.c.

#define NUM_MCLK_RATIOS   ARRAY_SIZE(cs4270_mode_ratios)

Definition at line 195 of file cs4270.c.

Function Documentation

MODULE_AUTHOR ( "Timur Tabi <[email protected]>"  )
MODULE_DESCRIPTION ( "Cirrus Logic CS4270 ALSA SoC Codec Driver"  )
MODULE_DEVICE_TABLE ( of  ,
cs4270_of_match   
)
MODULE_DEVICE_TABLE ( i2c  ,
cs4270_id   
)
module_i2c_driver ( cs4270_i2c_driver  )
MODULE_LICENSE ( "GPL"  )