Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cs4271.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <sound/cs4271.h>

Go to the source code of this file.

Data Structures

struct  cs4271_private
 
struct  cs4271_clk_cfg
 

Macros

#define CS4271_PCM_FORMATS
 
#define CS4271_PCM_RATES   SNDRV_PCM_RATE_8000_192000
 
#define CS4271_MODE1   0x2001 /* Mode Control 1 */
 
#define CS4271_DACCTL   0x2002 /* DAC Control */
 
#define CS4271_DACVOL   0x2003 /* DAC Volume & Mixing Control */
 
#define CS4271_VOLA   0x2004 /* DAC Channel A Volume Control */
 
#define CS4271_VOLB   0x2005 /* DAC Channel B Volume Control */
 
#define CS4271_ADCCTL   0x2006 /* ADC Control */
 
#define CS4271_MODE2   0x2007 /* Mode Control 2 */
 
#define CS4271_CHIPID   0x2008 /* Chip ID */
 
#define CS4271_FIRSTREG   CS4271_MODE1
 
#define CS4271_LASTREG   CS4271_MODE2
 
#define CS4271_NR_REGS   ((CS4271_LASTREG & 0xFF) + 1)
 
#define CS4271_MODE1_MODE_MASK   0xC0
 
#define CS4271_MODE1_MODE_1X   0x00
 
#define CS4271_MODE1_MODE_2X   0x80
 
#define CS4271_MODE1_MODE_4X   0xC0
 
#define CS4271_MODE1_DIV_MASK   0x30
 
#define CS4271_MODE1_DIV_1   0x00
 
#define CS4271_MODE1_DIV_15   0x10
 
#define CS4271_MODE1_DIV_2   0x20
 
#define CS4271_MODE1_DIV_3   0x30
 
#define CS4271_MODE1_MASTER   0x08
 
#define CS4271_MODE1_DAC_DIF_MASK   0x07
 
#define CS4271_MODE1_DAC_DIF_LJ   0x00
 
#define CS4271_MODE1_DAC_DIF_I2S   0x01
 
#define CS4271_MODE1_DAC_DIF_RJ16   0x02
 
#define CS4271_MODE1_DAC_DIF_RJ24   0x03
 
#define CS4271_MODE1_DAC_DIF_RJ20   0x04
 
#define CS4271_MODE1_DAC_DIF_RJ18   0x05
 
#define CS4271_DACCTL_AMUTE   0x80
 
#define CS4271_DACCTL_IF_SLOW   0x40
 
#define CS4271_DACCTL_DEM_MASK   0x30
 
#define CS4271_DACCTL_DEM_DIS   0x00
 
#define CS4271_DACCTL_DEM_441   0x10
 
#define CS4271_DACCTL_DEM_48   0x20
 
#define CS4271_DACCTL_DEM_32   0x30
 
#define CS4271_DACCTL_SVRU   0x08
 
#define CS4271_DACCTL_SRD   0x04
 
#define CS4271_DACCTL_INVA   0x02
 
#define CS4271_DACCTL_INVB   0x01
 
#define CS4271_DACVOL_BEQUA   0x40
 
#define CS4271_DACVOL_SOFT   0x20
 
#define CS4271_DACVOL_ZEROC   0x10
 
#define CS4271_DACVOL_ATAPI_MASK   0x0F
 
#define CS4271_DACVOL_ATAPI_M_M   0x00
 
#define CS4271_DACVOL_ATAPI_M_BR   0x01
 
#define CS4271_DACVOL_ATAPI_M_BL   0x02
 
#define CS4271_DACVOL_ATAPI_M_BLR2   0x03
 
#define CS4271_DACVOL_ATAPI_AR_M   0x04
 
#define CS4271_DACVOL_ATAPI_AR_BR   0x05
 
#define CS4271_DACVOL_ATAPI_AR_BL   0x06
 
#define CS4271_DACVOL_ATAPI_AR_BLR2   0x07
 
#define CS4271_DACVOL_ATAPI_AL_M   0x08
 
#define CS4271_DACVOL_ATAPI_AL_BR   0x09
 
#define CS4271_DACVOL_ATAPI_AL_BL   0x0A
 
#define CS4271_DACVOL_ATAPI_AL_BLR2   0x0B
 
#define CS4271_DACVOL_ATAPI_ALR2_M   0x0C
 
#define CS4271_DACVOL_ATAPI_ALR2_BR   0x0D
 
#define CS4271_DACVOL_ATAPI_ALR2_BL   0x0E
 
#define CS4271_DACVOL_ATAPI_ALR2_BLR2   0x0F
 
#define CS4271_VOLA_MUTE   0x80
 
#define CS4271_VOLA_VOL_MASK   0x7F
 
#define CS4271_VOLB_MUTE   0x80
 
#define CS4271_VOLB_VOL_MASK   0x7F
 
#define CS4271_ADCCTL_DITHER16   0x20
 
#define CS4271_ADCCTL_ADC_DIF_MASK   0x10
 
#define CS4271_ADCCTL_ADC_DIF_LJ   0x00
 
#define CS4271_ADCCTL_ADC_DIF_I2S   0x10
 
#define CS4271_ADCCTL_MUTEA   0x08
 
#define CS4271_ADCCTL_MUTEB   0x04
 
#define CS4271_ADCCTL_HPFDA   0x02
 
#define CS4271_ADCCTL_HPFDB   0x01
 
#define CS4271_MODE2_LOOP   0x10
 
#define CS4271_MODE2_MUTECAEQUB   0x08
 
#define CS4271_MODE2_FREEZE   0x04
 
#define CS4271_MODE2_CPEN   0x02
 
#define CS4271_MODE2_PDN   0x01
 
#define CS4271_CHIPID_PART_MASK   0xF0
 
#define CS4271_CHIPID_REV_MASK   0x0F
 
#define CS4171_NR_RATIOS   ARRAY_SIZE(cs4271_clk_tab)
 
#define cs4271_soc_suspend   NULL
 
#define cs4271_soc_resume   NULL
 

Functions

 module_init (cs4271_modinit)
 
 module_exit (cs4271_modexit)
 
 MODULE_AUTHOR ("Alexander Sverdlin <[email protected]>")
 
 MODULE_DESCRIPTION ("Cirrus Logic CS4271 ALSA SoC Codec Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CS4171_NR_RATIOS   ARRAY_SIZE(cs4271_clk_tab)

Definition at line 317 of file cs4271.c.

#define CS4271_ADCCTL   0x2006 /* ADC Control */

Definition at line 50 of file cs4271.c.

#define CS4271_ADCCTL_ADC_DIF_I2S   0x10

Definition at line 125 of file cs4271.c.

#define CS4271_ADCCTL_ADC_DIF_LJ   0x00

Definition at line 124 of file cs4271.c.

#define CS4271_ADCCTL_ADC_DIF_MASK   0x10

Definition at line 123 of file cs4271.c.

#define CS4271_ADCCTL_DITHER16   0x20

Definition at line 121 of file cs4271.c.

#define CS4271_ADCCTL_HPFDA   0x02

Definition at line 129 of file cs4271.c.

#define CS4271_ADCCTL_HPFDB   0x01

Definition at line 130 of file cs4271.c.

#define CS4271_ADCCTL_MUTEA   0x08

Definition at line 127 of file cs4271.c.

#define CS4271_ADCCTL_MUTEB   0x04

Definition at line 128 of file cs4271.c.

#define CS4271_CHIPID   0x2008 /* Chip ID */

Definition at line 52 of file cs4271.c.

#define CS4271_CHIPID_PART_MASK   0xF0

Definition at line 138 of file cs4271.c.

#define CS4271_CHIPID_REV_MASK   0x0F

Definition at line 139 of file cs4271.c.

#define CS4271_DACCTL   0x2002 /* DAC Control */

Definition at line 46 of file cs4271.c.

#define CS4271_DACCTL_AMUTE   0x80

Definition at line 80 of file cs4271.c.

#define CS4271_DACCTL_DEM_32   0x30

Definition at line 87 of file cs4271.c.

#define CS4271_DACCTL_DEM_441   0x10

Definition at line 85 of file cs4271.c.

#define CS4271_DACCTL_DEM_48   0x20

Definition at line 86 of file cs4271.c.

#define CS4271_DACCTL_DEM_DIS   0x00

Definition at line 84 of file cs4271.c.

#define CS4271_DACCTL_DEM_MASK   0x30

Definition at line 83 of file cs4271.c.

#define CS4271_DACCTL_IF_SLOW   0x40

Definition at line 81 of file cs4271.c.

#define CS4271_DACCTL_INVA   0x02

Definition at line 91 of file cs4271.c.

#define CS4271_DACCTL_INVB   0x01

Definition at line 92 of file cs4271.c.

#define CS4271_DACCTL_SRD   0x04

Definition at line 90 of file cs4271.c.

#define CS4271_DACCTL_SVRU   0x08

Definition at line 89 of file cs4271.c.

#define CS4271_DACVOL   0x2003 /* DAC Volume & Mixing Control */

Definition at line 47 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AL_BL   0x0A

Definition at line 109 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AL_BLR2   0x0B

Definition at line 110 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AL_BR   0x09

Definition at line 108 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AL_M   0x08

Definition at line 107 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_ALR2_BL   0x0E

Definition at line 113 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_ALR2_BLR2   0x0F

Definition at line 114 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_ALR2_BR   0x0D

Definition at line 112 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_ALR2_M   0x0C

Definition at line 111 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AR_BL   0x06

Definition at line 105 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AR_BLR2   0x07

Definition at line 106 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AR_BR   0x05

Definition at line 104 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_AR_M   0x04

Definition at line 103 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_M_BL   0x02

Definition at line 101 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_M_BLR2   0x03

Definition at line 102 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_M_BR   0x01

Definition at line 100 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_M_M   0x00

Definition at line 99 of file cs4271.c.

#define CS4271_DACVOL_ATAPI_MASK   0x0F

Definition at line 98 of file cs4271.c.

#define CS4271_DACVOL_BEQUA   0x40

Definition at line 94 of file cs4271.c.

#define CS4271_DACVOL_SOFT   0x20

Definition at line 95 of file cs4271.c.

#define CS4271_DACVOL_ZEROC   0x10

Definition at line 96 of file cs4271.c.

#define CS4271_FIRSTREG   CS4271_MODE1

Definition at line 54 of file cs4271.c.

#define CS4271_LASTREG   CS4271_MODE2

Definition at line 55 of file cs4271.c.

#define CS4271_MODE1   0x2001 /* Mode Control 1 */

Definition at line 45 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_I2S   0x01

Definition at line 74 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_LJ   0x00

Definition at line 73 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_MASK   0x07

Definition at line 72 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_RJ16   0x02

Definition at line 75 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_RJ18   0x05

Definition at line 78 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_RJ20   0x04

Definition at line 77 of file cs4271.c.

#define CS4271_MODE1_DAC_DIF_RJ24   0x03

Definition at line 76 of file cs4271.c.

#define CS4271_MODE1_DIV_1   0x00

Definition at line 65 of file cs4271.c.

#define CS4271_MODE1_DIV_15   0x10

Definition at line 66 of file cs4271.c.

#define CS4271_MODE1_DIV_2   0x20

Definition at line 67 of file cs4271.c.

#define CS4271_MODE1_DIV_3   0x30

Definition at line 68 of file cs4271.c.

#define CS4271_MODE1_DIV_MASK   0x30

Definition at line 64 of file cs4271.c.

#define CS4271_MODE1_MASTER   0x08

Definition at line 70 of file cs4271.c.

#define CS4271_MODE1_MODE_1X   0x00

Definition at line 60 of file cs4271.c.

#define CS4271_MODE1_MODE_2X   0x80

Definition at line 61 of file cs4271.c.

#define CS4271_MODE1_MODE_4X   0xC0

Definition at line 62 of file cs4271.c.

#define CS4271_MODE1_MODE_MASK   0xC0

Definition at line 59 of file cs4271.c.

#define CS4271_MODE2   0x2007 /* Mode Control 2 */

Definition at line 51 of file cs4271.c.

#define CS4271_MODE2_CPEN   0x02

Definition at line 135 of file cs4271.c.

#define CS4271_MODE2_FREEZE   0x04

Definition at line 134 of file cs4271.c.

#define CS4271_MODE2_LOOP   0x10

Definition at line 132 of file cs4271.c.

#define CS4271_MODE2_MUTECAEQUB   0x08

Definition at line 133 of file cs4271.c.

#define CS4271_MODE2_PDN   0x01

Definition at line 136 of file cs4271.c.

#define CS4271_NR_REGS   ((CS4271_LASTREG & 0xFF) + 1)

Definition at line 56 of file cs4271.c.

#define CS4271_PCM_FORMATS
Value:
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

Definition at line 35 of file cs4271.c.

#define CS4271_PCM_RATES   SNDRV_PCM_RATE_8000_192000

Definition at line 38 of file cs4271.c.

#define cs4271_soc_resume   NULL

Definition at line 460 of file cs4271.c.

#define cs4271_soc_suspend   NULL

Definition at line 459 of file cs4271.c.

#define CS4271_VOLA   0x2004 /* DAC Channel A Volume Control */

Definition at line 48 of file cs4271.c.

#define CS4271_VOLA_MUTE   0x80

Definition at line 116 of file cs4271.c.

#define CS4271_VOLA_VOL_MASK   0x7F

Definition at line 117 of file cs4271.c.

#define CS4271_VOLB   0x2005 /* DAC Channel B Volume Control */

Definition at line 49 of file cs4271.c.

#define CS4271_VOLB_MUTE   0x80

Definition at line 118 of file cs4271.c.

#define CS4271_VOLB_VOL_MASK   0x7F

Definition at line 119 of file cs4271.c.

Function Documentation

MODULE_AUTHOR ( "Alexander Sverdlin <[email protected]>"  )
MODULE_DESCRIPTION ( "Cirrus Logic CS4271 ALSA SoC Codec Driver"  )
module_exit ( cs4271_modexit  )
module_init ( cs4271_modinit  )
MODULE_LICENSE ( "GPL"  )