Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
twl6040.h File Reference
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/regulator/consumer.h>

Go to the source code of this file.

Data Structures

struct  twl6040_codec_data
 
struct  twl6040_vibra_data
 
struct  twl6040_gpo_data
 
struct  twl6040_platform_data
 
struct  twl6040
 

Macros

#define TWL6040_REG_ASICID   0x01
 
#define TWL6040_REG_ASICREV   0x02
 
#define TWL6040_REG_INTID   0x03
 
#define TWL6040_REG_INTMR   0x04
 
#define TWL6040_REG_NCPCTL   0x05
 
#define TWL6040_REG_LDOCTL   0x06
 
#define TWL6040_REG_HPPLLCTL   0x07
 
#define TWL6040_REG_LPPLLCTL   0x08
 
#define TWL6040_REG_LPPLLDIV   0x09
 
#define TWL6040_REG_AMICBCTL   0x0A
 
#define TWL6040_REG_DMICBCTL   0x0B
 
#define TWL6040_REG_MICLCTL   0x0C
 
#define TWL6040_REG_MICRCTL   0x0D
 
#define TWL6040_REG_MICGAIN   0x0E
 
#define TWL6040_REG_LINEGAIN   0x0F
 
#define TWL6040_REG_HSLCTL   0x10
 
#define TWL6040_REG_HSRCTL   0x11
 
#define TWL6040_REG_HSGAIN   0x12
 
#define TWL6040_REG_EARCTL   0x13
 
#define TWL6040_REG_HFLCTL   0x14
 
#define TWL6040_REG_HFLGAIN   0x15
 
#define TWL6040_REG_HFRCTL   0x16
 
#define TWL6040_REG_HFRGAIN   0x17
 
#define TWL6040_REG_VIBCTLL   0x18
 
#define TWL6040_REG_VIBDATL   0x19
 
#define TWL6040_REG_VIBCTLR   0x1A
 
#define TWL6040_REG_VIBDATR   0x1B
 
#define TWL6040_REG_HKCTL1   0x1C
 
#define TWL6040_REG_HKCTL2   0x1D
 
#define TWL6040_REG_GPOCTL   0x1E
 
#define TWL6040_REG_ALB   0x1F
 
#define TWL6040_REG_DLB   0x20
 
#define TWL6040_REG_TRIM1   0x28
 
#define TWL6040_REG_TRIM2   0x29
 
#define TWL6040_REG_TRIM3   0x2A
 
#define TWL6040_REG_HSOTRIM   0x2B
 
#define TWL6040_REG_HFOTRIM   0x2C
 
#define TWL6040_REG_ACCCTL   0x2D
 
#define TWL6040_REG_STATUS   0x2E
 
#define TWL6040_THINT   0x01
 
#define TWL6040_PLUGINT   0x02
 
#define TWL6040_UNPLUGINT   0x04
 
#define TWL6040_HOOKINT   0x08
 
#define TWL6040_HFINT   0x10
 
#define TWL6040_VIBINT   0x20
 
#define TWL6040_READYINT   0x40
 
#define TWL6040_THMSK   0x01
 
#define TWL6040_PLUGMSK   0x02
 
#define TWL6040_HOOKMSK   0x08
 
#define TWL6040_HFMSK   0x10
 
#define TWL6040_VIBMSK   0x20
 
#define TWL6040_READYMSK   0x40
 
#define TWL6040_ALLINT_MSK   0x7B
 
#define TWL6040_NCPENA   0x01
 
#define TWL6040_NCPOPEN   0x40
 
#define TWL6040_LSLDOENA   0x01
 
#define TWL6040_HSLDOENA   0x04
 
#define TWL6040_REFENA   0x40
 
#define TWL6040_OSCENA   0x80
 
#define TWL6040_HPLLENA   0x01
 
#define TWL6040_HPLLRST   0x02
 
#define TWL6040_HPLLBP   0x04
 
#define TWL6040_HPLLSQRENA   0x08
 
#define TWL6040_MCLK_12000KHZ   (0 << 5)
 
#define TWL6040_MCLK_19200KHZ   (1 << 5)
 
#define TWL6040_MCLK_26000KHZ   (2 << 5)
 
#define TWL6040_MCLK_38400KHZ   (3 << 5)
 
#define TWL6040_MCLK_MSK   0x60
 
#define TWL6040_LPLLENA   0x01
 
#define TWL6040_LPLLRST   0x02
 
#define TWL6040_LPLLSEL   0x04
 
#define TWL6040_LPLLFIN   0x08
 
#define TWL6040_HPLLSEL   0x10
 
#define TWL6040_HSDACENA   (1 << 0)
 
#define TWL6040_HSDACMODE   (1 << 1)
 
#define TWL6040_HSDRVMODE   (1 << 3)
 
#define TWL6040_VIBENA   (1 << 0)
 
#define TWL6040_VIBSEL   (1 << 1)
 
#define TWL6040_VIBCTRL   (1 << 2)
 
#define TWL6040_VIBCTRL_P   (1 << 3)
 
#define TWL6040_VIBCTRL_N   (1 << 4)
 
#define TWL6040_VIBDAT_MAX   0x64
 
#define TWL6040_GPO1   0x01
 
#define TWL6040_GPO2   0x02
 
#define TWL6040_GPO3   0x04
 
#define TWL6040_I2CSEL   0x01
 
#define TWL6040_RESETSPLIT   0x04
 
#define TWL6040_INTCLRMODE   0x08
 
#define TWL6040_PLUGCOMP   0x02
 
#define TWL6040_VIBLOCDET   0x10
 
#define TWL6040_VIBROCDET   0x20
 
#define TWL6040_TSHUTDET   0x40
 
#define TWL6040_CELLS   3
 
#define TWL6040_REV_ES1_0   0x00
 
#define TWL6040_REV_ES1_1   0x01 /* Rev ES1.1 and ES1.2 */
 
#define TWL6040_REV_ES1_3   0x02
 
#define TWL6041_REV_ES2_0   0x10
 
#define TWL6040_IRQ_TH   0
 
#define TWL6040_IRQ_PLUG   1
 
#define TWL6040_IRQ_HOOK   2
 
#define TWL6040_IRQ_HF   3
 
#define TWL6040_IRQ_VIB   4
 
#define TWL6040_IRQ_READY   5
 
#define TWL6040_SYSCLK_SEL_LPPLL   0
 
#define TWL6040_SYSCLK_SEL_HPPLL   1
 
#define TWL6040_GPO_MAX   3
 

Functions

int twl6040_reg_read (struct twl6040 *twl6040, unsigned int reg)
 
int twl6040_reg_write (struct twl6040 *twl6040, unsigned int reg, u8 val)
 
int twl6040_set_bits (struct twl6040 *twl6040, unsigned int reg, u8 mask)
 
int twl6040_clear_bits (struct twl6040 *twl6040, unsigned int reg, u8 mask)
 
int twl6040_power (struct twl6040 *twl6040, int on)
 
int twl6040_set_pll (struct twl6040 *twl6040, int pll_id, unsigned int freq_in, unsigned int freq_out)
 
int twl6040_get_pll (struct twl6040 *twl6040)
 
unsigned int twl6040_get_sysclk (struct twl6040 *twl6040)
 
int twl6040_irq_init (struct twl6040 *twl6040)
 
void twl6040_irq_exit (struct twl6040 *twl6040)
 
int twl6040_get_vibralr_status (struct twl6040 *twl6040)
 

Macro Definition Documentation

#define TWL6040_ALLINT_MSK   0x7B

Definition at line 90 of file twl6040.h.

#define TWL6040_CELLS   3

Definition at line 161 of file twl6040.h.

#define TWL6040_GPO1   0x01

Definition at line 144 of file twl6040.h.

#define TWL6040_GPO2   0x02

Definition at line 145 of file twl6040.h.

#define TWL6040_GPO3   0x04

Definition at line 146 of file twl6040.h.

#define TWL6040_GPO_MAX   3

Definition at line 179 of file twl6040.h.

#define TWL6040_HFINT   0x10

Definition at line 78 of file twl6040.h.

#define TWL6040_HFMSK   0x10

Definition at line 87 of file twl6040.h.

#define TWL6040_HOOKINT   0x08

Definition at line 77 of file twl6040.h.

#define TWL6040_HOOKMSK   0x08

Definition at line 86 of file twl6040.h.

#define TWL6040_HPLLBP   0x04

Definition at line 108 of file twl6040.h.

#define TWL6040_HPLLENA   0x01

Definition at line 106 of file twl6040.h.

#define TWL6040_HPLLRST   0x02

Definition at line 107 of file twl6040.h.

#define TWL6040_HPLLSEL   0x10

Definition at line 122 of file twl6040.h.

#define TWL6040_HPLLSQRENA   0x08

Definition at line 109 of file twl6040.h.

#define TWL6040_HSDACENA   (1 << 0)

Definition at line 126 of file twl6040.h.

#define TWL6040_HSDACMODE   (1 << 1)

Definition at line 127 of file twl6040.h.

#define TWL6040_HSDRVMODE   (1 << 3)

Definition at line 128 of file twl6040.h.

#define TWL6040_HSLDOENA   0x04

Definition at line 100 of file twl6040.h.

#define TWL6040_I2CSEL   0x01

Definition at line 150 of file twl6040.h.

#define TWL6040_INTCLRMODE   0x08

Definition at line 152 of file twl6040.h.

#define TWL6040_IRQ_HF   3

Definition at line 171 of file twl6040.h.

#define TWL6040_IRQ_HOOK   2

Definition at line 170 of file twl6040.h.

#define TWL6040_IRQ_PLUG   1

Definition at line 169 of file twl6040.h.

#define TWL6040_IRQ_READY   5

Definition at line 173 of file twl6040.h.

#define TWL6040_IRQ_TH   0

Definition at line 168 of file twl6040.h.

#define TWL6040_IRQ_VIB   4

Definition at line 172 of file twl6040.h.

#define TWL6040_LPLLENA   0x01

Definition at line 118 of file twl6040.h.

#define TWL6040_LPLLFIN   0x08

Definition at line 121 of file twl6040.h.

#define TWL6040_LPLLRST   0x02

Definition at line 119 of file twl6040.h.

#define TWL6040_LPLLSEL   0x04

Definition at line 120 of file twl6040.h.

#define TWL6040_LSLDOENA   0x01

Definition at line 99 of file twl6040.h.

#define TWL6040_MCLK_12000KHZ   (0 << 5)

Definition at line 110 of file twl6040.h.

#define TWL6040_MCLK_19200KHZ   (1 << 5)

Definition at line 111 of file twl6040.h.

#define TWL6040_MCLK_26000KHZ   (2 << 5)

Definition at line 112 of file twl6040.h.

#define TWL6040_MCLK_38400KHZ   (3 << 5)

Definition at line 113 of file twl6040.h.

#define TWL6040_MCLK_MSK   0x60

Definition at line 114 of file twl6040.h.

#define TWL6040_NCPENA   0x01

Definition at line 94 of file twl6040.h.

#define TWL6040_NCPOPEN   0x40

Definition at line 95 of file twl6040.h.

#define TWL6040_OSCENA   0x80

Definition at line 102 of file twl6040.h.

#define TWL6040_PLUGCOMP   0x02

Definition at line 156 of file twl6040.h.

#define TWL6040_PLUGINT   0x02

Definition at line 75 of file twl6040.h.

#define TWL6040_PLUGMSK   0x02

Definition at line 85 of file twl6040.h.

#define TWL6040_READYINT   0x40

Definition at line 80 of file twl6040.h.

#define TWL6040_READYMSK   0x40

Definition at line 89 of file twl6040.h.

#define TWL6040_REFENA   0x40

Definition at line 101 of file twl6040.h.

#define TWL6040_REG_ACCCTL   0x2D

Definition at line 69 of file twl6040.h.

#define TWL6040_REG_ALB   0x1F

Definition at line 62 of file twl6040.h.

#define TWL6040_REG_AMICBCTL   0x0A

Definition at line 41 of file twl6040.h.

#define TWL6040_REG_ASICID   0x01

Definition at line 32 of file twl6040.h.

#define TWL6040_REG_ASICREV   0x02

Definition at line 33 of file twl6040.h.

#define TWL6040_REG_DLB   0x20

Definition at line 63 of file twl6040.h.

#define TWL6040_REG_DMICBCTL   0x0B

Definition at line 42 of file twl6040.h.

#define TWL6040_REG_EARCTL   0x13

Definition at line 50 of file twl6040.h.

#define TWL6040_REG_GPOCTL   0x1E

Definition at line 61 of file twl6040.h.

#define TWL6040_REG_HFLCTL   0x14

Definition at line 51 of file twl6040.h.

#define TWL6040_REG_HFLGAIN   0x15

Definition at line 52 of file twl6040.h.

#define TWL6040_REG_HFOTRIM   0x2C

Definition at line 68 of file twl6040.h.

#define TWL6040_REG_HFRCTL   0x16

Definition at line 53 of file twl6040.h.

#define TWL6040_REG_HFRGAIN   0x17

Definition at line 54 of file twl6040.h.

#define TWL6040_REG_HKCTL1   0x1C

Definition at line 59 of file twl6040.h.

#define TWL6040_REG_HKCTL2   0x1D

Definition at line 60 of file twl6040.h.

#define TWL6040_REG_HPPLLCTL   0x07

Definition at line 38 of file twl6040.h.

#define TWL6040_REG_HSGAIN   0x12

Definition at line 49 of file twl6040.h.

#define TWL6040_REG_HSLCTL   0x10

Definition at line 47 of file twl6040.h.

#define TWL6040_REG_HSOTRIM   0x2B

Definition at line 67 of file twl6040.h.

#define TWL6040_REG_HSRCTL   0x11

Definition at line 48 of file twl6040.h.

#define TWL6040_REG_INTID   0x03

Definition at line 34 of file twl6040.h.

#define TWL6040_REG_INTMR   0x04

Definition at line 35 of file twl6040.h.

#define TWL6040_REG_LDOCTL   0x06

Definition at line 37 of file twl6040.h.

#define TWL6040_REG_LINEGAIN   0x0F

Definition at line 46 of file twl6040.h.

#define TWL6040_REG_LPPLLCTL   0x08

Definition at line 39 of file twl6040.h.

#define TWL6040_REG_LPPLLDIV   0x09

Definition at line 40 of file twl6040.h.

#define TWL6040_REG_MICGAIN   0x0E

Definition at line 45 of file twl6040.h.

#define TWL6040_REG_MICLCTL   0x0C

Definition at line 43 of file twl6040.h.

#define TWL6040_REG_MICRCTL   0x0D

Definition at line 44 of file twl6040.h.

#define TWL6040_REG_NCPCTL   0x05

Definition at line 36 of file twl6040.h.

#define TWL6040_REG_STATUS   0x2E

Definition at line 70 of file twl6040.h.

#define TWL6040_REG_TRIM1   0x28

Definition at line 64 of file twl6040.h.

#define TWL6040_REG_TRIM2   0x29

Definition at line 65 of file twl6040.h.

#define TWL6040_REG_TRIM3   0x2A

Definition at line 66 of file twl6040.h.

#define TWL6040_REG_VIBCTLL   0x18

Definition at line 55 of file twl6040.h.

#define TWL6040_REG_VIBCTLR   0x1A

Definition at line 57 of file twl6040.h.

#define TWL6040_REG_VIBDATL   0x19

Definition at line 56 of file twl6040.h.

#define TWL6040_REG_VIBDATR   0x1B

Definition at line 58 of file twl6040.h.

#define TWL6040_RESETSPLIT   0x04

Definition at line 151 of file twl6040.h.

#define TWL6040_REV_ES1_0   0x00

Definition at line 163 of file twl6040.h.

#define TWL6040_REV_ES1_1   0x01 /* Rev ES1.1 and ES1.2 */

Definition at line 164 of file twl6040.h.

#define TWL6040_REV_ES1_3   0x02

Definition at line 165 of file twl6040.h.

#define TWL6040_SYSCLK_SEL_HPPLL   1

Definition at line 177 of file twl6040.h.

#define TWL6040_SYSCLK_SEL_LPPLL   0

Definition at line 176 of file twl6040.h.

#define TWL6040_THINT   0x01

Definition at line 74 of file twl6040.h.

#define TWL6040_THMSK   0x01

Definition at line 84 of file twl6040.h.

#define TWL6040_TSHUTDET   0x40

Definition at line 159 of file twl6040.h.

#define TWL6040_UNPLUGINT   0x04

Definition at line 76 of file twl6040.h.

#define TWL6040_VIBCTRL   (1 << 2)

Definition at line 134 of file twl6040.h.

#define TWL6040_VIBCTRL_N   (1 << 4)

Definition at line 136 of file twl6040.h.

#define TWL6040_VIBCTRL_P   (1 << 3)

Definition at line 135 of file twl6040.h.

#define TWL6040_VIBDAT_MAX   0x64

Definition at line 140 of file twl6040.h.

#define TWL6040_VIBENA   (1 << 0)

Definition at line 132 of file twl6040.h.

#define TWL6040_VIBINT   0x20

Definition at line 79 of file twl6040.h.

#define TWL6040_VIBLOCDET   0x10

Definition at line 157 of file twl6040.h.

#define TWL6040_VIBMSK   0x20

Definition at line 88 of file twl6040.h.

#define TWL6040_VIBROCDET   0x20

Definition at line 158 of file twl6040.h.

#define TWL6040_VIBSEL   (1 << 1)

Definition at line 133 of file twl6040.h.

#define TWL6041_REV_ES2_0   0x10

Definition at line 166 of file twl6040.h.

Function Documentation

int twl6040_clear_bits ( struct twl6040 twl6040,
unsigned int  reg,
u8  mask 
)

Definition at line 100 of file twl6040-core.c.

int twl6040_get_pll ( struct twl6040 twl6040)

Definition at line 451 of file twl6040-core.c.

unsigned int twl6040_get_sysclk ( struct twl6040 twl6040)

Definition at line 460 of file twl6040-core.c.

int twl6040_get_vibralr_status ( struct twl6040 twl6040)

Definition at line 467 of file twl6040-core.c.

void twl6040_irq_exit ( struct twl6040 twl6040)

Definition at line 201 of file twl6040-irq.c.

int twl6040_irq_init ( struct twl6040 twl6040)

Definition at line 142 of file twl6040-irq.c.

int twl6040_power ( struct twl6040 twl6040,
int  on 
)

Definition at line 241 of file twl6040-core.c.

int twl6040_reg_read ( struct twl6040 twl6040,
unsigned int  reg 
)

Definition at line 62 of file twl6040-core.c.

int twl6040_reg_write ( struct twl6040 twl6040,
unsigned int  reg,
u8  val 
)

Definition at line 81 of file twl6040-core.c.

int twl6040_set_bits ( struct twl6040 twl6040,
unsigned int  reg,
u8  mask 
)

Definition at line 94 of file twl6040-core.c.

int twl6040_set_pll ( struct twl6040 twl6040,
int  pll_id,
unsigned int  freq_in,
unsigned int  freq_out 
)

Definition at line 311 of file twl6040-core.c.