Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wm8580.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/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/of_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <sound/initval.h>
#include <asm/div64.h>
#include "wm8580.h"

Go to the source code of this file.

Data Structures

struct  pll_state
 
struct  wm8580_priv
 
struct  _pll_div
 

Macros

#define WM8580_PLLA1   0x00
 
#define WM8580_PLLA2   0x01
 
#define WM8580_PLLA3   0x02
 
#define WM8580_PLLA4   0x03
 
#define WM8580_PLLB1   0x04
 
#define WM8580_PLLB2   0x05
 
#define WM8580_PLLB3   0x06
 
#define WM8580_PLLB4   0x07
 
#define WM8580_CLKSEL   0x08
 
#define WM8580_PAIF1   0x09
 
#define WM8580_PAIF2   0x0A
 
#define WM8580_SAIF1   0x0B
 
#define WM8580_PAIF3   0x0C
 
#define WM8580_PAIF4   0x0D
 
#define WM8580_SAIF2   0x0E
 
#define WM8580_DAC_CONTROL1   0x0F
 
#define WM8580_DAC_CONTROL2   0x10
 
#define WM8580_DAC_CONTROL3   0x11
 
#define WM8580_DAC_CONTROL4   0x12
 
#define WM8580_DAC_CONTROL5   0x13
 
#define WM8580_DIGITAL_ATTENUATION_DACL1   0x14
 
#define WM8580_DIGITAL_ATTENUATION_DACR1   0x15
 
#define WM8580_DIGITAL_ATTENUATION_DACL2   0x16
 
#define WM8580_DIGITAL_ATTENUATION_DACR2   0x17
 
#define WM8580_DIGITAL_ATTENUATION_DACL3   0x18
 
#define WM8580_DIGITAL_ATTENUATION_DACR3   0x19
 
#define WM8580_MASTER_DIGITAL_ATTENUATION   0x1C
 
#define WM8580_ADC_CONTROL1   0x1D
 
#define WM8580_SPDTXCHAN0   0x1E
 
#define WM8580_SPDTXCHAN1   0x1F
 
#define WM8580_SPDTXCHAN2   0x20
 
#define WM8580_SPDTXCHAN3   0x21
 
#define WM8580_SPDTXCHAN4   0x22
 
#define WM8580_SPDTXCHAN5   0x23
 
#define WM8580_SPDMODE   0x24
 
#define WM8580_INTMASK   0x25
 
#define WM8580_GPO1   0x26
 
#define WM8580_GPO2   0x27
 
#define WM8580_GPO3   0x28
 
#define WM8580_GPO4   0x29
 
#define WM8580_GPO5   0x2A
 
#define WM8580_INTSTAT   0x2B
 
#define WM8580_SPDRXCHAN1   0x2C
 
#define WM8580_SPDRXCHAN2   0x2D
 
#define WM8580_SPDRXCHAN3   0x2E
 
#define WM8580_SPDRXCHAN4   0x2F
 
#define WM8580_SPDRXCHAN5   0x30
 
#define WM8580_SPDSTAT   0x31
 
#define WM8580_PWRDN1   0x32
 
#define WM8580_PWRDN2   0x33
 
#define WM8580_READBACK   0x34
 
#define WM8580_RESET   0x35
 
#define WM8580_MAX_REGISTER   0x35
 
#define WM8580_DACOSR   0x40
 
#define WM8580_PLLB4_MCLKOUTSRC_MASK   0x60
 
#define WM8580_PLLB4_MCLKOUTSRC_PLLA   0x20
 
#define WM8580_PLLB4_MCLKOUTSRC_PLLB   0x40
 
#define WM8580_PLLB4_MCLKOUTSRC_OSC   0x60
 
#define WM8580_PLLB4_CLKOUTSRC_MASK   0x180
 
#define WM8580_PLLB4_CLKOUTSRC_PLLACLK   0x080
 
#define WM8580_PLLB4_CLKOUTSRC_PLLBCLK   0x100
 
#define WM8580_PLLB4_CLKOUTSRC_OSCCLK   0x180
 
#define WM8580_CLKSEL_DAC_CLKSEL_MASK   0x03
 
#define WM8580_CLKSEL_DAC_CLKSEL_PLLA   0x01
 
#define WM8580_CLKSEL_DAC_CLKSEL_PLLB   0x02
 
#define WM8580_AIF_RATE_MASK   0x7
 
#define WM8580_AIF_BCLKSEL_MASK   0x18
 
#define WM8580_AIF_MS   0x20
 
#define WM8580_AIF_CLKSRC_MASK   0xc0
 
#define WM8580_AIF_CLKSRC_PLLA   0x40
 
#define WM8580_AIF_CLKSRC_PLLB   0x40
 
#define WM8580_AIF_CLKSRC_MCLK   0xc0
 
#define WM8580_AIF_FMT_MASK   0x03
 
#define WM8580_AIF_FMT_RIGHTJ   0x00
 
#define WM8580_AIF_FMT_LEFTJ   0x01
 
#define WM8580_AIF_FMT_I2S   0x02
 
#define WM8580_AIF_FMT_DSP   0x03
 
#define WM8580_AIF_LENGTH_MASK   0x0c
 
#define WM8580_AIF_LENGTH_16   0x00
 
#define WM8580_AIF_LENGTH_20   0x04
 
#define WM8580_AIF_LENGTH_24   0x08
 
#define WM8580_AIF_LENGTH_32   0x0c
 
#define WM8580_AIF_LRP   0x10
 
#define WM8580_AIF_BCP   0x20
 
#define WM8580_PWRDN1_PWDN   0x001
 
#define WM8580_PWRDN1_ALLDACPD   0x040
 
#define WM8580_PWRDN2_OSSCPD   0x001
 
#define WM8580_PWRDN2_PLLAPD   0x002
 
#define WM8580_PWRDN2_PLLBPD   0x004
 
#define WM8580_PWRDN2_SPDIFPD   0x008
 
#define WM8580_PWRDN2_SPDIFTXD   0x010
 
#define WM8580_PWRDN2_SPDIFRXD   0x020
 
#define WM8580_DAC_CONTROL5_MUTEALL   0x10
 
#define WM8580_NUM_SUPPLIES   3
 
#define FIXED_PLL_SIZE   (1 << 22)
 
#define WM8580_FORMATS
 

Functions

 module_init (wm8580_modinit)
 
 module_exit (wm8580_exit)
 
 MODULE_DESCRIPTION ("ASoC WM8580 driver")
 
 MODULE_AUTHOR ("Mark Brown <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define FIXED_PLL_SIZE   (1 << 22)

Definition at line 351 of file wm8580.c.

#define WM8580_ADC_CONTROL1   0x1D

Definition at line 69 of file wm8580.c.

#define WM8580_AIF_BCLKSEL_MASK   0x18

Definition at line 117 of file wm8580.c.

#define WM8580_AIF_BCP   0x20

Definition at line 140 of file wm8580.c.

#define WM8580_AIF_CLKSRC_MASK   0xc0

Definition at line 121 of file wm8580.c.

#define WM8580_AIF_CLKSRC_MCLK   0xc0

Definition at line 124 of file wm8580.c.

#define WM8580_AIF_CLKSRC_PLLA   0x40

Definition at line 122 of file wm8580.c.

#define WM8580_AIF_CLKSRC_PLLB   0x40

Definition at line 123 of file wm8580.c.

#define WM8580_AIF_FMT_DSP   0x03

Definition at line 131 of file wm8580.c.

#define WM8580_AIF_FMT_I2S   0x02

Definition at line 130 of file wm8580.c.

#define WM8580_AIF_FMT_LEFTJ   0x01

Definition at line 129 of file wm8580.c.

#define WM8580_AIF_FMT_MASK   0x03

Definition at line 127 of file wm8580.c.

#define WM8580_AIF_FMT_RIGHTJ   0x00

Definition at line 128 of file wm8580.c.

#define WM8580_AIF_LENGTH_16   0x00

Definition at line 134 of file wm8580.c.

#define WM8580_AIF_LENGTH_20   0x04

Definition at line 135 of file wm8580.c.

#define WM8580_AIF_LENGTH_24   0x08

Definition at line 136 of file wm8580.c.

#define WM8580_AIF_LENGTH_32   0x0c

Definition at line 137 of file wm8580.c.

#define WM8580_AIF_LENGTH_MASK   0x0c

Definition at line 133 of file wm8580.c.

#define WM8580_AIF_LRP   0x10

Definition at line 139 of file wm8580.c.

#define WM8580_AIF_MS   0x20

Definition at line 119 of file wm8580.c.

#define WM8580_AIF_RATE_MASK   0x7

Definition at line 116 of file wm8580.c.

#define WM8580_CLKSEL   0x08

Definition at line 50 of file wm8580.c.

#define WM8580_CLKSEL_DAC_CLKSEL_MASK   0x03

Definition at line 111 of file wm8580.c.

#define WM8580_CLKSEL_DAC_CLKSEL_PLLA   0x01

Definition at line 112 of file wm8580.c.

#define WM8580_CLKSEL_DAC_CLKSEL_PLLB   0x02

Definition at line 113 of file wm8580.c.

#define WM8580_DAC_CONTROL1   0x0F

Definition at line 57 of file wm8580.c.

#define WM8580_DAC_CONTROL2   0x10

Definition at line 58 of file wm8580.c.

#define WM8580_DAC_CONTROL3   0x11

Definition at line 59 of file wm8580.c.

#define WM8580_DAC_CONTROL4   0x12

Definition at line 60 of file wm8580.c.

#define WM8580_DAC_CONTROL5   0x13

Definition at line 61 of file wm8580.c.

#define WM8580_DAC_CONTROL5_MUTEALL   0x10

Definition at line 154 of file wm8580.c.

#define WM8580_DACOSR   0x40

Definition at line 97 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACL1   0x14

Definition at line 62 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACL2   0x16

Definition at line 64 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACL3   0x18

Definition at line 66 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACR1   0x15

Definition at line 63 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACR2   0x17

Definition at line 65 of file wm8580.c.

#define WM8580_DIGITAL_ATTENUATION_DACR3   0x19

Definition at line 67 of file wm8580.c.

#define WM8580_FORMATS
Value:

Definition at line 820 of file wm8580.c.

#define WM8580_GPO1   0x26

Definition at line 78 of file wm8580.c.

#define WM8580_GPO2   0x27

Definition at line 79 of file wm8580.c.

#define WM8580_GPO3   0x28

Definition at line 80 of file wm8580.c.

#define WM8580_GPO4   0x29

Definition at line 81 of file wm8580.c.

#define WM8580_GPO5   0x2A

Definition at line 82 of file wm8580.c.

#define WM8580_INTMASK   0x25

Definition at line 77 of file wm8580.c.

#define WM8580_INTSTAT   0x2B

Definition at line 83 of file wm8580.c.

#define WM8580_MASTER_DIGITAL_ATTENUATION   0x1C

Definition at line 68 of file wm8580.c.

#define WM8580_MAX_REGISTER   0x35

Definition at line 95 of file wm8580.c.

#define WM8580_NUM_SUPPLIES   3

Definition at line 232 of file wm8580.c.

#define WM8580_PAIF1   0x09

Definition at line 51 of file wm8580.c.

#define WM8580_PAIF2   0x0A

Definition at line 52 of file wm8580.c.

#define WM8580_PAIF3   0x0C

Definition at line 54 of file wm8580.c.

#define WM8580_PAIF4   0x0D

Definition at line 55 of file wm8580.c.

#define WM8580_PLLA1   0x00

Definition at line 42 of file wm8580.c.

#define WM8580_PLLA2   0x01

Definition at line 43 of file wm8580.c.

#define WM8580_PLLA3   0x02

Definition at line 44 of file wm8580.c.

#define WM8580_PLLA4   0x03

Definition at line 45 of file wm8580.c.

#define WM8580_PLLB1   0x04

Definition at line 46 of file wm8580.c.

#define WM8580_PLLB2   0x05

Definition at line 47 of file wm8580.c.

#define WM8580_PLLB3   0x06

Definition at line 48 of file wm8580.c.

#define WM8580_PLLB4   0x07

Definition at line 49 of file wm8580.c.

#define WM8580_PLLB4_CLKOUTSRC_MASK   0x180

Definition at line 105 of file wm8580.c.

#define WM8580_PLLB4_CLKOUTSRC_OSCCLK   0x180

Definition at line 108 of file wm8580.c.

#define WM8580_PLLB4_CLKOUTSRC_PLLACLK   0x080

Definition at line 106 of file wm8580.c.

#define WM8580_PLLB4_CLKOUTSRC_PLLBCLK   0x100

Definition at line 107 of file wm8580.c.

#define WM8580_PLLB4_MCLKOUTSRC_MASK   0x60

Definition at line 100 of file wm8580.c.

#define WM8580_PLLB4_MCLKOUTSRC_OSC   0x60

Definition at line 103 of file wm8580.c.

#define WM8580_PLLB4_MCLKOUTSRC_PLLA   0x20

Definition at line 101 of file wm8580.c.

#define WM8580_PLLB4_MCLKOUTSRC_PLLB   0x40

Definition at line 102 of file wm8580.c.

#define WM8580_PWRDN1   0x32

Definition at line 90 of file wm8580.c.

#define WM8580_PWRDN1_ALLDACPD   0x040

Definition at line 144 of file wm8580.c.

#define WM8580_PWRDN1_PWDN   0x001

Definition at line 143 of file wm8580.c.

#define WM8580_PWRDN2   0x33

Definition at line 91 of file wm8580.c.

#define WM8580_PWRDN2_OSSCPD   0x001

Definition at line 147 of file wm8580.c.

#define WM8580_PWRDN2_PLLAPD   0x002

Definition at line 148 of file wm8580.c.

#define WM8580_PWRDN2_PLLBPD   0x004

Definition at line 149 of file wm8580.c.

#define WM8580_PWRDN2_SPDIFPD   0x008

Definition at line 150 of file wm8580.c.

#define WM8580_PWRDN2_SPDIFRXD   0x020

Definition at line 152 of file wm8580.c.

#define WM8580_PWRDN2_SPDIFTXD   0x010

Definition at line 151 of file wm8580.c.

#define WM8580_READBACK   0x34

Definition at line 92 of file wm8580.c.

#define WM8580_RESET   0x35

Definition at line 93 of file wm8580.c.

#define WM8580_SAIF1   0x0B

Definition at line 53 of file wm8580.c.

#define WM8580_SAIF2   0x0E

Definition at line 56 of file wm8580.c.

#define WM8580_SPDMODE   0x24

Definition at line 76 of file wm8580.c.

#define WM8580_SPDRXCHAN1   0x2C

Definition at line 84 of file wm8580.c.

#define WM8580_SPDRXCHAN2   0x2D

Definition at line 85 of file wm8580.c.

#define WM8580_SPDRXCHAN3   0x2E

Definition at line 86 of file wm8580.c.

#define WM8580_SPDRXCHAN4   0x2F

Definition at line 87 of file wm8580.c.

#define WM8580_SPDRXCHAN5   0x30

Definition at line 88 of file wm8580.c.

#define WM8580_SPDSTAT   0x31

Definition at line 89 of file wm8580.c.

#define WM8580_SPDTXCHAN0   0x1E

Definition at line 70 of file wm8580.c.

#define WM8580_SPDTXCHAN1   0x1F

Definition at line 71 of file wm8580.c.

#define WM8580_SPDTXCHAN2   0x20

Definition at line 72 of file wm8580.c.

#define WM8580_SPDTXCHAN3   0x21

Definition at line 73 of file wm8580.c.

#define WM8580_SPDTXCHAN4   0x22

Definition at line 74 of file wm8580.c.

#define WM8580_SPDTXCHAN5   0x23

Definition at line 75 of file wm8580.c.

Function Documentation

MODULE_AUTHOR ( "Mark Brown <[email protected]>"  )
MODULE_DESCRIPTION ( "ASoC WM8580 driver )
module_exit ( wm8580_exit  )
module_init ( wm8580_modinit  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

unsigned int div

Definition at line 355 of file wm8580.c.

unsigned int freqmode

Definition at line 356 of file wm8580.c.

unsigned int postscale

Definition at line 357 of file wm8580.c.