Blame view

include/palmas.h 3.51 KB
211442989   SRICHARAN R   power: twl6035: a...
1
  /*
cb199102b   Nishanth Menon   twl6035: rename t...
2
   * (C) Copyright 2012-2013
211442989   SRICHARAN R   power: twl6035: a...
3
4
   * Texas Instruments, <www.ti.com>
   *
1a4596601   Wolfgang Denk   Add GPL-2.0+ SPDX...
5
   * SPDX-License-Identifier:	GPL-2.0+
211442989   SRICHARAN R   power: twl6035: a...
6
   */
da2cc4545   Nishanth Menon   palmas: add heade...
7
8
  #ifndef PALMAS_H
  #define PALMAS_H
211442989   SRICHARAN R   power: twl6035: a...
9
10
11
  
  #include <common.h>
  #include <i2c.h>
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
12
13
14
15
  /* I2C chip addresses, TW6035/37 */
  #define TWL603X_CHIP_P1		0x48	/* Page 1 */
  #define TWL603X_CHIP_P2		0x49	/* Page 2 */
  #define TWL603X_CHIP_P3		0x4a	/* Page 3 */
211442989   SRICHARAN R   power: twl6035: a...
16

e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
17
18
19
20
21
22
23
24
  /* TPS659038/39 */
  #define TPS65903X_CHIP_P1	0x58	/* Page 1 */
  
  /* Page 1 registers (0x1XY translates to page 1, reg addr 0xXY): */
  
  /* LDO1 control/voltage */
  #define LDO1_CTRL		0x50
  #define LDO1_VOLTAGE		0x51
b4b060066   Lokesh Vutla   ARM: OMAP4+: Add ...
25
26
27
28
29
30
31
32
33
  /* LDO1 control/voltage for LP873x */
  #define LP873X_LDO1_ADDR	0x60
  #define LP873X_LDO1_CTRL	0x9
  #define LP873X_LDO1_VOLTAGE	0xa
  #define LP873X_LDO_VOLT_3V0	0x19
  #define LP873X_LDO_VOLT_1V8	0xa
  #define LP873X_LDO_CTRL_EN	(0x1 << 0)
  #define LP873X_LDO_CTRL_EN_PINCTRL	(0x1 << 1)
  #define LP873X_LDO_CTRL_RDIS_EN	(0x1 << 2)
35fe1cb0c   Dmitry Lifshitz   ARM: OMAP5: Power...
34
35
36
  /* LDO2 control/voltage */
  #define LDO2_CTRL		0x52
  #define LDO2_VOLTAGE		0x53
cd43b5160   Lokesh Vutla   board: ti: dra76-...
37
38
39
  /* LDO2 control/voltage */
  #define LDO4_CTRL		0x5e
  #define LDO4_VOLTAGE		0x5f
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
40
  /* LDO9 control/voltage */
211442989   SRICHARAN R   power: twl6035: a...
41
42
  #define LDO9_CTRL		0x60
  #define LDO9_VOLTAGE		0x61
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
43
44
45
  /* LDOUSB control/voltage */
  #define LDOUSB_CTRL		0x64
  #define LDOUSB_VOLTAGE		0x65
1bd435bc7   Dan Murphy   ARM: OMAP5: Power...
46
  #define LDO_CTRL		0x6a
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  
  /* Control of 32 kHz audio clock */
  #define CLK32KGAUDIO_CTRL	0xd5
  
  /* SYSEN2_CTRL for VCC_3v3_AUX supply on the sEVM */
  #define SYSEN2_CTRL		0xd9
  
  /*
   * Bit field definitions for LDOx_CTRL, SYSENx_CTRL
   * and some other xxx_CTRL resources:
   */
  #define LDO9_BYP_EN		(1 << 6)	/* LDO9 only! */
  #define RSC_STAT_ON		(1 << 4)	/* RO status bit! */
  #define RSC_MODE_SLEEP		(1 << 2)
  #define RSC_MODE_ACTIVE		(1 << 0)
  
  /* Some LDO voltage values */
  #define LDO_VOLT_OFF		0
  #define LDO_VOLT_1V8		0x13
  #define LDO_VOLT_3V0		0x2b
  #define LDO_VOLT_3V3		0x31
  /* Request bypass, LDO9 only */
  #define LDO9_BYPASS		0x3f
  
  /* SMPS7_CTRL */
  #define SMPS7_CTRL		0x30
  
  /* SMPS9_CTRL */
  #define SMPS9_CTRL		0x38
  #define SMPS9_VOLTAGE		0x3b
1bd435bc7   Dan Murphy   ARM: OMAP5: Power...
77
78
79
  /* SMPS10_CTRL */
  #define SMPS10_CTRL		0x3c
  #define SMPS10_MODE_ACTIVE_D	0x0d
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
  /* Bit field definitions for SMPSx_CTRL */
  #define SMPS_MODE_ACT_AUTO	1
  #define SMPS_MODE_ACT_ECO	2
  #define SMPS_MODE_ACT_FPWM	3
  #define SMPS_MODE_SLP_AUTO	(1 << 2)
  #define SMPS_MODE_SLP_ECO	(2 << 2)
  #define SMPS_MODE_SLP_FPWM	(3 << 2)
  
  /*
   * Some popular SMPS voltages, all with RANGE=1; note
   * that RANGE cannot be changed on the fly
   */
  #define SMPS_VOLT_OFF		0
  #define SMPS_VOLT_1V2		0x90
  #define SMPS_VOLT_1V8		0xae
  #define SMPS_VOLT_2V1		0xbd
  #define SMPS_VOLT_3V0		0xea
  #define SMPS_VOLT_3V3		0xf9
  
  /* Backup Battery & VRTC Control */
  #define BB_VRTC_CTRL		0xa8
  /* Bit definitions for BB_VRTC_CTRL */
  #define VRTC_EN_SLP		(1 << 6)
  #define VRTC_EN_OFF		(1 << 5)
  #define VRTC_PWEN		(1 << 4)
  #define BB_LOW_ICHRG		(1 << 3)
  #define BB_HIGH_ICHRG		(0 << 3)
  #define BB_VSEL_3V0		(0 << 1)
  #define BB_VSEL_2V5		(1 << 1)
  #define BB_VSEL_3V15		(2 << 1)
  #define BB_VSEL_VBAT		(3 << 1)
  #define BB_CHRG_EN		(1 << 0)
211442989   SRICHARAN R   power: twl6035: a...
112

ff2d57ea5   Nishanth Menon   palmas: use palma...
113
114
115
116
117
118
119
120
121
122
123
124
125
  /*
   * Functions to read and write from TPS659038/TWL6035/TWL6037
   * or other Palmas family of TI PMICs
   */
  static inline int palmas_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
  {
  	return i2c_write(chip_no, reg, 1, &val, 1);
  }
  
  static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
  {
  	return i2c_read(chip_no, reg, 1, val, 1);
  }
12733881e   Nishanth Menon   palmas: rename in...
126
  void palmas_init_settings(void);
db4fce8fc   Lokesh Vutla   palmas: Add suppo...
127
  int palmas_mmc1_poweron_ldo(uint ldo_volt, uint ldo_ctrl, uint voltage);
b4b060066   Lokesh Vutla   ARM: OMAP4+: Add ...
128
  int lp873x_mmc1_poweron_ldo(uint voltage);
e9090fa45   Lubomir Popov   ARM: OMAP5: Power...
129
130
131
  int twl603x_mmc1_set_ldo9(u8 vsel);
  int twl603x_audio_power(u8 on);
  int twl603x_enable_bb_charge(u8 bb_fields);
1bd435bc7   Dan Murphy   ARM: OMAP5: Power...
132
  int palmas_enable_ss_ldo(void);
da2cc4545   Nishanth Menon   palmas: add heade...
133
134
  
  #endif /* PALMAS_H */