Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wm8900.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/spi/spi.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 "wm8900.h"

Go to the source code of this file.

Data Structures

struct  wm8900_priv
 
struct  _fll_div
 

Macros

#define WM8900_REG_RESET   0x0
 
#define WM8900_REG_ID   0x0
 
#define WM8900_REG_POWER1   0x1
 
#define WM8900_REG_POWER2   0x2
 
#define WM8900_REG_POWER3   0x3
 
#define WM8900_REG_AUDIO1   0x4
 
#define WM8900_REG_AUDIO2   0x5
 
#define WM8900_REG_CLOCKING1   0x6
 
#define WM8900_REG_CLOCKING2   0x7
 
#define WM8900_REG_AUDIO3   0x8
 
#define WM8900_REG_AUDIO4   0x9
 
#define WM8900_REG_DACCTRL   0xa
 
#define WM8900_REG_LDAC_DV   0xb
 
#define WM8900_REG_RDAC_DV   0xc
 
#define WM8900_REG_SIDETONE   0xd
 
#define WM8900_REG_ADCCTRL   0xe
 
#define WM8900_REG_LADC_DV   0xf
 
#define WM8900_REG_RADC_DV   0x10
 
#define WM8900_REG_GPIO   0x12
 
#define WM8900_REG_INCTL   0x15
 
#define WM8900_REG_LINVOL   0x16
 
#define WM8900_REG_RINVOL   0x17
 
#define WM8900_REG_INBOOSTMIX1   0x18
 
#define WM8900_REG_INBOOSTMIX2   0x19
 
#define WM8900_REG_ADCPATH   0x1a
 
#define WM8900_REG_AUXBOOST   0x1b
 
#define WM8900_REG_ADDCTL   0x1e
 
#define WM8900_REG_FLLCTL1   0x24
 
#define WM8900_REG_FLLCTL2   0x25
 
#define WM8900_REG_FLLCTL3   0x26
 
#define WM8900_REG_FLLCTL4   0x27
 
#define WM8900_REG_FLLCTL5   0x28
 
#define WM8900_REG_FLLCTL6   0x29
 
#define WM8900_REG_LOUTMIXCTL1   0x2c
 
#define WM8900_REG_ROUTMIXCTL1   0x2d
 
#define WM8900_REG_BYPASS1   0x2e
 
#define WM8900_REG_BYPASS2   0x2f
 
#define WM8900_REG_AUXOUT_CTL   0x30
 
#define WM8900_REG_LOUT1CTL   0x33
 
#define WM8900_REG_ROUT1CTL   0x34
 
#define WM8900_REG_LOUT2CTL   0x35
 
#define WM8900_REG_ROUT2CTL   0x36
 
#define WM8900_REG_HPCTL1   0x3a
 
#define WM8900_REG_OUTBIASCTL   0x73
 
#define WM8900_MAXREG   0x80
 
#define WM8900_REG_ADDCTL_OUT1_DIS   0x80
 
#define WM8900_REG_ADDCTL_OUT2_DIS   0x40
 
#define WM8900_REG_ADDCTL_VMID_DIS   0x20
 
#define WM8900_REG_ADDCTL_BIAS_SRC   0x10
 
#define WM8900_REG_ADDCTL_VMID_SOFTST   0x04
 
#define WM8900_REG_ADDCTL_TEMP_SD   0x02
 
#define WM8900_REG_GPIO_TEMP_ENA   0x2
 
#define WM8900_REG_POWER1_STARTUP_BIAS_ENA   0x0100
 
#define WM8900_REG_POWER1_BIAS_ENA   0x0008
 
#define WM8900_REG_POWER1_VMID_BUF_ENA   0x0004
 
#define WM8900_REG_POWER1_FLL_ENA   0x0040
 
#define WM8900_REG_POWER2_SYSCLK_ENA   0x8000
 
#define WM8900_REG_POWER2_ADCL_ENA   0x0002
 
#define WM8900_REG_POWER2_ADCR_ENA   0x0001
 
#define WM8900_REG_POWER3_DACL_ENA   0x0002
 
#define WM8900_REG_POWER3_DACR_ENA   0x0001
 
#define WM8900_REG_AUDIO1_AIF_FMT_MASK   0x0018
 
#define WM8900_REG_AUDIO1_LRCLK_INV   0x0080
 
#define WM8900_REG_AUDIO1_BCLK_INV   0x0100
 
#define WM8900_REG_CLOCKING1_BCLK_DIR   0x1
 
#define WM8900_REG_CLOCKING1_MCLK_SRC   0x100
 
#define WM8900_REG_CLOCKING1_BCLK_MASK   0x01e
 
#define WM8900_REG_CLOCKING1_OPCLK_MASK   0x7000
 
#define WM8900_REG_CLOCKING2_ADC_CLKDIV   0xe0
 
#define WM8900_REG_CLOCKING2_DAC_CLKDIV   0x1c
 
#define WM8900_REG_DACCTRL_MUTE   0x004
 
#define WM8900_REG_DACCTRL_DAC_SB_FILT   0x100
 
#define WM8900_REG_DACCTRL_AIF_LRCLKRATE   0x400
 
#define WM8900_REG_AUDIO3_ADCLRC_DIR   0x0800
 
#define WM8900_REG_AUDIO4_DACLRC_DIR   0x0800
 
#define WM8900_REG_FLLCTL1_OSC_ENA   0x100
 
#define WM8900_REG_FLLCTL6_FLL_SLOW_LOCK_REF   0x100
 
#define WM8900_REG_HPCTL1_HP_IPSTAGE_ENA   0x80
 
#define WM8900_REG_HPCTL1_HP_OPSTAGE_ENA   0x40
 
#define WM8900_REG_HPCTL1_HP_CLAMP_IP   0x20
 
#define WM8900_REG_HPCTL1_HP_CLAMP_OP   0x10
 
#define WM8900_REG_HPCTL1_HP_SHORT   0x08
 
#define WM8900_REG_HPCTL1_HP_SHORT2   0x04
 
#define WM8900_LRC_MASK   0x03ff
 
#define FIXED_FLL_SIZE   ((1 << 16) * 10)
 
#define WM8900_RATES
 
#define WM8900_PCM_FORMATS
 

Functions

 module_init (wm8900_modinit)
 
 module_exit (wm8900_exit)
 
 MODULE_DESCRIPTION ("ASoC WM8900 driver")
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define FIXED_FLL_SIZE   ((1 << 16) * 10)

Definition at line 685 of file wm8900.c.

#define WM8900_LRC_MASK   0x03ff

Definition at line 138 of file wm8900.c.

#define WM8900_MAXREG   0x80

Definition at line 84 of file wm8900.c.

#define WM8900_PCM_FORMATS
Value:
SNDRV_PCM_FORMAT_S24_LE)

Definition at line 997 of file wm8900.c.

#define WM8900_RATES
Value:
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)

Definition at line 993 of file wm8900.c.

#define WM8900_REG_ADCCTRL   0xe

Definition at line 54 of file wm8900.c.

#define WM8900_REG_ADCPATH   0x1a

Definition at line 63 of file wm8900.c.

#define WM8900_REG_ADDCTL   0x1e

Definition at line 65 of file wm8900.c.

#define WM8900_REG_ADDCTL_BIAS_SRC   0x10

Definition at line 89 of file wm8900.c.

#define WM8900_REG_ADDCTL_OUT1_DIS   0x80

Definition at line 86 of file wm8900.c.

#define WM8900_REG_ADDCTL_OUT2_DIS   0x40

Definition at line 87 of file wm8900.c.

#define WM8900_REG_ADDCTL_TEMP_SD   0x02

Definition at line 91 of file wm8900.c.

#define WM8900_REG_ADDCTL_VMID_DIS   0x20

Definition at line 88 of file wm8900.c.

#define WM8900_REG_ADDCTL_VMID_SOFTST   0x04

Definition at line 90 of file wm8900.c.

#define WM8900_REG_AUDIO1   0x4

Definition at line 44 of file wm8900.c.

#define WM8900_REG_AUDIO1_AIF_FMT_MASK   0x0018

Definition at line 107 of file wm8900.c.

#define WM8900_REG_AUDIO1_BCLK_INV   0x0100

Definition at line 109 of file wm8900.c.

#define WM8900_REG_AUDIO1_LRCLK_INV   0x0080

Definition at line 108 of file wm8900.c.

#define WM8900_REG_AUDIO2   0x5

Definition at line 45 of file wm8900.c.

#define WM8900_REG_AUDIO3   0x8

Definition at line 48 of file wm8900.c.

#define WM8900_REG_AUDIO3_ADCLRC_DIR   0x0800

Definition at line 123 of file wm8900.c.

#define WM8900_REG_AUDIO4   0x9

Definition at line 49 of file wm8900.c.

#define WM8900_REG_AUDIO4_DACLRC_DIR   0x0800

Definition at line 125 of file wm8900.c.

#define WM8900_REG_AUXBOOST   0x1b

Definition at line 64 of file wm8900.c.

#define WM8900_REG_AUXOUT_CTL   0x30

Definition at line 76 of file wm8900.c.

#define WM8900_REG_BYPASS1   0x2e

Definition at line 74 of file wm8900.c.

#define WM8900_REG_BYPASS2   0x2f

Definition at line 75 of file wm8900.c.

#define WM8900_REG_CLOCKING1   0x6

Definition at line 46 of file wm8900.c.

#define WM8900_REG_CLOCKING1_BCLK_DIR   0x1

Definition at line 111 of file wm8900.c.

#define WM8900_REG_CLOCKING1_BCLK_MASK   0x01e

Definition at line 113 of file wm8900.c.

#define WM8900_REG_CLOCKING1_MCLK_SRC   0x100

Definition at line 112 of file wm8900.c.

#define WM8900_REG_CLOCKING1_OPCLK_MASK   0x7000

Definition at line 114 of file wm8900.c.

#define WM8900_REG_CLOCKING2   0x7

Definition at line 47 of file wm8900.c.

#define WM8900_REG_CLOCKING2_ADC_CLKDIV   0xe0

Definition at line 116 of file wm8900.c.

#define WM8900_REG_CLOCKING2_DAC_CLKDIV   0x1c

Definition at line 117 of file wm8900.c.

#define WM8900_REG_DACCTRL   0xa

Definition at line 50 of file wm8900.c.

#define WM8900_REG_DACCTRL_AIF_LRCLKRATE   0x400

Definition at line 121 of file wm8900.c.

#define WM8900_REG_DACCTRL_DAC_SB_FILT   0x100

Definition at line 120 of file wm8900.c.

#define WM8900_REG_DACCTRL_MUTE   0x004

Definition at line 119 of file wm8900.c.

#define WM8900_REG_FLLCTL1   0x24

Definition at line 66 of file wm8900.c.

#define WM8900_REG_FLLCTL1_OSC_ENA   0x100

Definition at line 127 of file wm8900.c.

#define WM8900_REG_FLLCTL2   0x25

Definition at line 67 of file wm8900.c.

#define WM8900_REG_FLLCTL3   0x26

Definition at line 68 of file wm8900.c.

#define WM8900_REG_FLLCTL4   0x27

Definition at line 69 of file wm8900.c.

#define WM8900_REG_FLLCTL5   0x28

Definition at line 70 of file wm8900.c.

#define WM8900_REG_FLLCTL6   0x29

Definition at line 71 of file wm8900.c.

#define WM8900_REG_FLLCTL6_FLL_SLOW_LOCK_REF   0x100

Definition at line 129 of file wm8900.c.

#define WM8900_REG_GPIO   0x12

Definition at line 57 of file wm8900.c.

#define WM8900_REG_GPIO_TEMP_ENA   0x2

Definition at line 93 of file wm8900.c.

#define WM8900_REG_HPCTL1   0x3a

Definition at line 81 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_CLAMP_IP   0x20

Definition at line 133 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_CLAMP_OP   0x10

Definition at line 134 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_IPSTAGE_ENA   0x80

Definition at line 131 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_OPSTAGE_ENA   0x40

Definition at line 132 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_SHORT   0x08

Definition at line 135 of file wm8900.c.

#define WM8900_REG_HPCTL1_HP_SHORT2   0x04

Definition at line 136 of file wm8900.c.

#define WM8900_REG_ID   0x0

Definition at line 40 of file wm8900.c.

#define WM8900_REG_INBOOSTMIX1   0x18

Definition at line 61 of file wm8900.c.

#define WM8900_REG_INBOOSTMIX2   0x19

Definition at line 62 of file wm8900.c.

#define WM8900_REG_INCTL   0x15

Definition at line 58 of file wm8900.c.

#define WM8900_REG_LADC_DV   0xf

Definition at line 55 of file wm8900.c.

#define WM8900_REG_LDAC_DV   0xb

Definition at line 51 of file wm8900.c.

#define WM8900_REG_LINVOL   0x16

Definition at line 59 of file wm8900.c.

#define WM8900_REG_LOUT1CTL   0x33

Definition at line 77 of file wm8900.c.

#define WM8900_REG_LOUT2CTL   0x35

Definition at line 79 of file wm8900.c.

#define WM8900_REG_LOUTMIXCTL1   0x2c

Definition at line 72 of file wm8900.c.

#define WM8900_REG_OUTBIASCTL   0x73

Definition at line 82 of file wm8900.c.

#define WM8900_REG_POWER1   0x1

Definition at line 41 of file wm8900.c.

#define WM8900_REG_POWER1_BIAS_ENA   0x0008

Definition at line 96 of file wm8900.c.

#define WM8900_REG_POWER1_FLL_ENA   0x0040

Definition at line 98 of file wm8900.c.

#define WM8900_REG_POWER1_STARTUP_BIAS_ENA   0x0100

Definition at line 95 of file wm8900.c.

#define WM8900_REG_POWER1_VMID_BUF_ENA   0x0004

Definition at line 97 of file wm8900.c.

#define WM8900_REG_POWER2   0x2

Definition at line 42 of file wm8900.c.

#define WM8900_REG_POWER2_ADCL_ENA   0x0002

Definition at line 101 of file wm8900.c.

#define WM8900_REG_POWER2_ADCR_ENA   0x0001

Definition at line 102 of file wm8900.c.

#define WM8900_REG_POWER2_SYSCLK_ENA   0x8000

Definition at line 100 of file wm8900.c.

#define WM8900_REG_POWER3   0x3

Definition at line 43 of file wm8900.c.

#define WM8900_REG_POWER3_DACL_ENA   0x0002

Definition at line 104 of file wm8900.c.

#define WM8900_REG_POWER3_DACR_ENA   0x0001

Definition at line 105 of file wm8900.c.

#define WM8900_REG_RADC_DV   0x10

Definition at line 56 of file wm8900.c.

#define WM8900_REG_RDAC_DV   0xc

Definition at line 52 of file wm8900.c.

#define WM8900_REG_RESET   0x0

Definition at line 39 of file wm8900.c.

#define WM8900_REG_RINVOL   0x17

Definition at line 60 of file wm8900.c.

#define WM8900_REG_ROUT1CTL   0x34

Definition at line 78 of file wm8900.c.

#define WM8900_REG_ROUT2CTL   0x36

Definition at line 80 of file wm8900.c.

#define WM8900_REG_ROUTMIXCTL1   0x2d

Definition at line 73 of file wm8900.c.

#define WM8900_REG_SIDETONE   0xd

Definition at line 53 of file wm8900.c.

Function Documentation

MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC WM8900 driver )
module_exit ( wm8900_exit  )
module_init ( wm8900_modinit  )
MODULE_LICENSE ( "GPL"  )