Blame view

include/power/tps65218.h 1.9 KB
86db550b3   Tom Rini   power: Add suppor...
1
2
3
4
5
6
7
8
9
  /*
   * (C) Copyright 2014
   * Texas Instruments, <www.ti.com>
   *
   * SPDX-License-Identifier:	GPL-2.0+
   */
  
  #ifndef __POWER_TPS65218_H__
  #define __POWER_TPS65218_H__
9bcfca123   Nikita Kiryanov   pmic: tps65218: a...
10
  #include <linux/bitops.h>
86db550b3   Tom Rini   power: Add suppor...
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  /* I2C chip address */
  #define TPS65218_CHIP_PM			0x24
  
  /* Registers */
  enum {
  	TPS65218_CHIPID				= 0x00,
  	TPS65218_INT1,
  	TPS65218_INT2,
  	TPS65218_INT_MASK1,
  	TPS65218_INT_MASK2,
  	TPS65218_STATUS,
  	TPS65218_CONTROL,
  	TPS65218_FLAG,
  	TPS65218_PASSWORD			= 0x10,
  	TPS65218_ENABLE1,
  	TPS65218_ENABLE2,
  	TPS65218_CONFIG1,
  	TPS65218_CONFIG2,
  	TPS65218_CONFIG3,
  	TPS65218_DCDC1,
  	TPS65218_DCDC2,
  	TPS65218_DCDC3,
  	TPS65218_DCDC4,
  	TPS65218_SLEW,
  	TPS65218_LDO1,
  	TPS65218_SEQ1				= 0x20,
  	TPS65218_SEQ2,
  	TPS65218_SEQ3,
  	TPS65218_SEQ4,
  	TPS65218_SEQ5,
  	TPS65218_SEQ6,
  	TPS65218_SEQ7,
  	TPS65218_PMIC_NUM_OF_REGS,
  };
  
  #define TPS65218_PROT_LEVEL_NONE		0x00
  #define TPS65218_PROT_LEVEL_1			0x01
  #define TPS65218_PROT_LEVEL_2			0x02
  
  #define TPS65218_PASSWORD_LOCK_FOR_WRITE	0x00
  #define TPS65218_PASSWORD_UNLOCK		0x7D
  
  #define TPS65218_DCDC_GO			0x80
  
  #define TPS65218_MASK_ALL_BITS			0xFF
6183b2955   Keerthy   power: pmic: tps6...
56
  #define TPS65218_DCDC_VSEL_MASK			0x3F
8465d6a71   Felipe Balbi   power: tps65218: ...
57
  #define TPS65218_DCDC_VOLT_SEL_0950MV		0x0a
86db550b3   Tom Rini   power: Add suppor...
58
  #define TPS65218_DCDC_VOLT_SEL_1100MV		0x19
8465d6a71   Felipe Balbi   power: tps65218: ...
59
60
  #define TPS65218_DCDC_VOLT_SEL_1200MV		0x23
  #define TPS65218_DCDC_VOLT_SEL_1260MV		0x29
86db550b3   Tom Rini   power: Add suppor...
61
  #define TPS65218_DCDC_VOLT_SEL_1330MV		0x30
fc69d4726   Keerthy   board: ti: AM43XX...
62
  #define TPS65218_DCDC3_VOLT_SEL_1350MV		0x12
86db550b3   Tom Rini   power: Add suppor...
63

9bcfca123   Nikita Kiryanov   pmic: tps65218: a...
64
65
66
67
68
69
70
71
  #define TPS65218_CC_STAT	(BIT(0) | BIT(1))
  #define TPS65218_STATE		(BIT(2) | BIT(3))
  #define TPS65218_PB_STATE	BIT(4)
  #define TPS65218_AC_STATE	BIT(5)
  #define TPS65218_EE		BIT(6)
  #define TPS65218_FSEAL		BIT(7)
  
  int tps65218_reg_read(uchar dest_reg, uchar *dest_val);
86db550b3   Tom Rini   power: Add suppor...
72
73
74
  int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
  		       uchar mask);
  int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
9bcfca123   Nikita Kiryanov   pmic: tps65218: a...
75
76
  int tps65218_toggle_fseal(void);
  int tps65218_lock_fseal(void);
7aa5598aa   Tom Rini   tps65218/am43xx_e...
77
  int power_tps65218_init(unsigned char bus);
86db550b3   Tom Rini   power: Add suppor...
78
  #endif	/* __POWER_TPS65218_H__ */