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

Go to the source code of this file.

Data Structures

struct  ak4642_priv
 

Macros

#define PW_MGMT1   0x00
 
#define PW_MGMT2   0x01
 
#define SG_SL1   0x02
 
#define SG_SL2   0x03
 
#define MD_CTL1   0x04
 
#define MD_CTL2   0x05
 
#define TIMER   0x06
 
#define ALC_CTL1   0x07
 
#define ALC_CTL2   0x08
 
#define L_IVC   0x09
 
#define L_DVC   0x0a
 
#define ALC_CTL3   0x0b
 
#define R_IVC   0x0c
 
#define R_DVC   0x0d
 
#define MD_CTL3   0x0e
 
#define MD_CTL4   0x0f
 
#define PW_MGMT3   0x10
 
#define DF_S   0x11
 
#define FIL3_0   0x12
 
#define FIL3_1   0x13
 
#define FIL3_2   0x14
 
#define FIL3_3   0x15
 
#define EQ_0   0x16
 
#define EQ_1   0x17
 
#define EQ_2   0x18
 
#define EQ_3   0x19
 
#define EQ_4   0x1a
 
#define EQ_5   0x1b
 
#define FIL1_0   0x1c
 
#define FIL1_1   0x1d
 
#define FIL1_2   0x1e
 
#define FIL1_3   0x1f
 
#define PW_MGMT4   0x20
 
#define MD_CTL5   0x21
 
#define LO_MS   0x22
 
#define HP_MS   0x23
 
#define SPK_MS   0x24
 
#define PMVCM   (1 << 6) /* VCOM Power Management */
 
#define PMMIN   (1 << 5) /* MIN Input Power Management */
 
#define PMDAC   (1 << 2) /* DAC Power Management */
 
#define PMADL   (1 << 0) /* MIC Amp Lch and ADC Lch Power Management */
 
#define HPMTN   (1 << 6)
 
#define PMHPL   (1 << 5)
 
#define PMHPR   (1 << 4)
 
#define MS   (1 << 3) /* master/slave select */
 
#define MCKO   (1 << 1)
 
#define PMPLL   (1 << 0)
 
#define PMHP_MASK   (PMHPL | PMHPR)
 
#define PMHP   PMHP_MASK
 
#define PMADR   (1 << 0) /* MIC L / ADC R Power Management */
 
#define MINS   (1 << 6) /* Switch from MIN to Speaker */
 
#define DACL   (1 << 4) /* Switch from DAC to Stereo or Receiver */
 
#define PMMP   (1 << 2) /* MPWR pin Power Management */
 
#define MGAIN0   (1 << 0) /* MIC amp gain*/
 
#define ZTM(param)   ((param & 0x3) << 4) /* ALC Zoro Crossing TimeOut */
 
#define WTM(param)   (((param & 0x4) << 4) | ((param & 0x3) << 2))
 
#define ALC   (1 << 5) /* ALC Enable */
 
#define LMTH0   (1 << 0) /* ALC Limiter / Recovery Level */
 
#define PLL3   (1 << 7)
 
#define PLL2   (1 << 6)
 
#define PLL1   (1 << 5)
 
#define PLL0   (1 << 4)
 
#define PLL_MASK   (PLL3 | PLL2 | PLL1 | PLL0)
 
#define BCKO_MASK   (1 << 3)
 
#define BCKO_64   BCKO_MASK
 
#define DIF_MASK   (3 << 0)
 
#define DSP   (0 << 0)
 
#define RIGHT_J   (1 << 0)
 
#define LEFT_J   (2 << 0)
 
#define I2S   (3 << 0)
 
#define FS0   (1 << 0)
 
#define FS1   (1 << 1)
 
#define FS2   (1 << 2)
 
#define FS3   (1 << 5)
 
#define FS_MASK   (FS0 | FS1 | FS2 | FS3)
 
#define BST1   (1 << 3)
 
#define DACH   (1 << 0)
 

Functions

 module_init (ak4642_modinit)
 
 module_exit (ak4642_exit)
 
 MODULE_DESCRIPTION ("Soc AK4642 driver")
 
 MODULE_AUTHOR ("Kuninori Morimoto <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ALC   (1 << 5) /* ALC Enable */

Definition at line 103 of file ak4642.c.

#define ALC_CTL1   0x07

Definition at line 41 of file ak4642.c.

#define ALC_CTL2   0x08

Definition at line 42 of file ak4642.c.

#define ALC_CTL3   0x0b

Definition at line 45 of file ak4642.c.

#define BCKO_64   BCKO_MASK

Definition at line 114 of file ak4642.c.

#define BCKO_MASK   (1 << 3)

Definition at line 113 of file ak4642.c.

#define BST1   (1 << 3)

Definition at line 130 of file ak4642.c.

#define DACH   (1 << 0)

Definition at line 133 of file ak4642.c.

#define DACL   (1 << 4) /* Switch from DAC to Stereo or Receiver */

Definition at line 94 of file ak4642.c.

#define DF_S   0x11

Definition at line 51 of file ak4642.c.

#define DIF_MASK   (3 << 0)

Definition at line 116 of file ak4642.c.

#define DSP   (0 << 0)

Definition at line 117 of file ak4642.c.

#define EQ_0   0x16

Definition at line 56 of file ak4642.c.

#define EQ_1   0x17

Definition at line 57 of file ak4642.c.

#define EQ_2   0x18

Definition at line 58 of file ak4642.c.

#define EQ_3   0x19

Definition at line 59 of file ak4642.c.

#define EQ_4   0x1a

Definition at line 60 of file ak4642.c.

#define EQ_5   0x1b

Definition at line 61 of file ak4642.c.

#define FIL1_0   0x1c

Definition at line 62 of file ak4642.c.

#define FIL1_1   0x1d

Definition at line 63 of file ak4642.c.

#define FIL1_2   0x1e

Definition at line 64 of file ak4642.c.

#define FIL1_3   0x1f

Definition at line 65 of file ak4642.c.

#define FIL3_0   0x12

Definition at line 52 of file ak4642.c.

#define FIL3_1   0x13

Definition at line 53 of file ak4642.c.

#define FIL3_2   0x14

Definition at line 54 of file ak4642.c.

#define FIL3_3   0x15

Definition at line 55 of file ak4642.c.

#define FS0   (1 << 0)

Definition at line 123 of file ak4642.c.

#define FS1   (1 << 1)

Definition at line 124 of file ak4642.c.

#define FS2   (1 << 2)

Definition at line 125 of file ak4642.c.

#define FS3   (1 << 5)

Definition at line 126 of file ak4642.c.

#define FS_MASK   (FS0 | FS1 | FS2 | FS3)

Definition at line 127 of file ak4642.c.

#define HP_MS   0x23

Definition at line 69 of file ak4642.c.

#define HPMTN   (1 << 6)

Definition at line 79 of file ak4642.c.

#define I2S   (3 << 0)

Definition at line 120 of file ak4642.c.

#define L_DVC   0x0a

Definition at line 44 of file ak4642.c.

#define L_IVC   0x09

Definition at line 43 of file ak4642.c.

#define LEFT_J   (2 << 0)

Definition at line 119 of file ak4642.c.

#define LMTH0   (1 << 0) /* ALC Limiter / Recovery Level */

Definition at line 104 of file ak4642.c.

#define LO_MS   0x22

Definition at line 68 of file ak4642.c.

#define MCKO   (1 << 1)

Definition at line 83 of file ak4642.c.

#define MD_CTL1   0x04

Definition at line 38 of file ak4642.c.

#define MD_CTL2   0x05

Definition at line 39 of file ak4642.c.

#define MD_CTL3   0x0e

Definition at line 48 of file ak4642.c.

#define MD_CTL4   0x0f

Definition at line 49 of file ak4642.c.

#define MD_CTL5   0x21

Definition at line 67 of file ak4642.c.

#define MGAIN0   (1 << 0) /* MIC amp gain*/

Definition at line 96 of file ak4642.c.

#define MINS   (1 << 6) /* Switch from MIN to Speaker */

Definition at line 93 of file ak4642.c.

#define MS   (1 << 3) /* master/slave select */

Definition at line 82 of file ak4642.c.

#define PLL0   (1 << 4)

Definition at line 110 of file ak4642.c.

#define PLL1   (1 << 5)

Definition at line 109 of file ak4642.c.

#define PLL2   (1 << 6)

Definition at line 108 of file ak4642.c.

#define PLL3   (1 << 7)

Definition at line 107 of file ak4642.c.

#define PLL_MASK   (PLL3 | PLL2 | PLL1 | PLL0)

Definition at line 111 of file ak4642.c.

#define PMADL   (1 << 0) /* MIC Amp Lch and ADC Lch Power Management */

Definition at line 76 of file ak4642.c.

#define PMADR   (1 << 0) /* MIC L / ADC R Power Management */

Definition at line 90 of file ak4642.c.

#define PMDAC   (1 << 2) /* DAC Power Management */

Definition at line 75 of file ak4642.c.

#define PMHP   PMHP_MASK

Definition at line 87 of file ak4642.c.

#define PMHP_MASK   (PMHPL | PMHPR)

Definition at line 86 of file ak4642.c.

#define PMHPL   (1 << 5)

Definition at line 80 of file ak4642.c.

#define PMHPR   (1 << 4)

Definition at line 81 of file ak4642.c.

#define PMMIN   (1 << 5) /* MIN Input Power Management */

Definition at line 74 of file ak4642.c.

#define PMMP   (1 << 2) /* MPWR pin Power Management */

Definition at line 95 of file ak4642.c.

#define PMPLL   (1 << 0)

Definition at line 84 of file ak4642.c.

#define PMVCM   (1 << 6) /* VCOM Power Management */

Definition at line 73 of file ak4642.c.

#define PW_MGMT1   0x00

Definition at line 34 of file ak4642.c.

#define PW_MGMT2   0x01

Definition at line 35 of file ak4642.c.

#define PW_MGMT3   0x10

Definition at line 50 of file ak4642.c.

#define PW_MGMT4   0x20

Definition at line 66 of file ak4642.c.

#define R_DVC   0x0d

Definition at line 47 of file ak4642.c.

#define R_IVC   0x0c

Definition at line 46 of file ak4642.c.

#define RIGHT_J   (1 << 0)

Definition at line 118 of file ak4642.c.

#define SG_SL1   0x02

Definition at line 36 of file ak4642.c.

#define SG_SL2   0x03

Definition at line 37 of file ak4642.c.

#define SPK_MS   0x24

Definition at line 70 of file ak4642.c.

#define TIMER   0x06

Definition at line 40 of file ak4642.c.

#define WTM (   param)    (((param & 0x4) << 4) | ((param & 0x3) << 2))

Definition at line 100 of file ak4642.c.

#define ZTM (   param)    ((param & 0x3) << 4) /* ALC Zoro Crossing TimeOut */

Definition at line 99 of file ak4642.c.

Function Documentation

MODULE_AUTHOR ( "Kuninori Morimoto <[email protected]>"  )
MODULE_DESCRIPTION ( "Soc AK4642 driver )
module_exit ( ak4642_exit  )
module_init ( ak4642_modinit  )
MODULE_LICENSE ( "GPL"  )