1
2
3
4
5
6
7
8 #ifndef MFD_TPS6105X_H
9 #define MFD_TPS6105X_H
10
11 #include <linux/i2c.h>
12 #include <linux/regmap.h>
13 #include <linux/regulator/machine.h>
14
15
16
17
18 #define TPS6105X_REG_0 0x00
19 #define TPS6105X_REG0_MODE_SHIFT 6
20 #define TPS6105X_REG0_MODE_MASK (0x03<<6)
21
22 #define TPS6105X_REG0_MODE_SHUTDOWN 0x00
23 #define TPS6105X_REG0_MODE_TORCH 0x01
24 #define TPS6105X_REG0_MODE_TORCH_FLASH 0x02
25 #define TPS6105X_REG0_MODE_VOLTAGE 0x03
26 #define TPS6105X_REG0_VOLTAGE_SHIFT 4
27 #define TPS6105X_REG0_VOLTAGE_MASK (3<<4)
28 #define TPS6105X_REG0_VOLTAGE_450 0
29 #define TPS6105X_REG0_VOLTAGE_500 1
30 #define TPS6105X_REG0_VOLTAGE_525 2
31 #define TPS6105X_REG0_VOLTAGE_500_2 3
32 #define TPS6105X_REG0_DIMMING_SHIFT 3
33 #define TPS6105X_REG0_TORCHC_SHIFT 0
34 #define TPS6105X_REG0_TORCHC_MASK (7<<0)
35 #define TPS6105X_REG0_TORCHC_0 0x00
36 #define TPS6105X_REG0_TORCHC_50 0x01
37 #define TPS6105X_REG0_TORCHC_75 0x02
38 #define TPS6105X_REG0_TORCHC_100 0x03
39 #define TPS6105X_REG0_TORCHC_150 0x04
40 #define TPS6105X_REG0_TORCHC_200 0x05
41 #define TPS6105X_REG0_TORCHC_250_400 0x06
42 #define TPS6105X_REG0_TORCHC_250_500 0x07
43 #define TPS6105X_REG_1 0x01
44 #define TPS6105X_REG1_MODE_SHIFT 6
45 #define TPS6105X_REG1_MODE_MASK (0x03<<6)
46 #define TPS6105X_REG1_MODE_SHUTDOWN 0x00
47 #define TPS6105X_REG1_MODE_TORCH 0x01
48 #define TPS6105X_REG1_MODE_TORCH_FLASH 0x02
49 #define TPS6105X_REG1_MODE_VOLTAGE 0x03
50 #define TPS6105X_REG_2 0x02
51 #define TPS6105X_REG_3 0x03
52
53
54
55
56
57
58
59
60
61
62
63
64 enum tps6105x_mode {
65 TPS6105X_MODE_SHUTDOWN,
66 TPS6105X_MODE_TORCH,
67 TPS6105X_MODE_TORCH_FLASH,
68 TPS6105X_MODE_VOLTAGE,
69 };
70
71
72
73
74
75
76
77
78 struct tps6105x_platform_data {
79 enum tps6105x_mode mode;
80 struct regulator_init_data *regulator_data;
81 };
82
83
84
85
86
87
88
89 struct tps6105x {
90 struct tps6105x_platform_data *pdata;
91 struct i2c_client *client;
92 struct regulator_dev *regulator;
93 struct regmap *regmap;
94 };
95
96 #endif