]> git.ipfire.org Git - people/arne_f/kernel.git/blame - include/linux/mfd/tps6586x.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[people/arne_f/kernel.git] / include / linux / mfd / tps6586x.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
c6c19332
MR
2#ifndef __LINUX_MFD_TPS6586X_H
3#define __LINUX_MFD_TPS6586X_H
4
500c524a
XX
5#define TPS6586X_SLEW_RATE_INSTANTLY 0x00
6#define TPS6586X_SLEW_RATE_110UV 0x01
7#define TPS6586X_SLEW_RATE_220UV 0x02
8#define TPS6586X_SLEW_RATE_440UV 0x03
9#define TPS6586X_SLEW_RATE_880UV 0x04
10#define TPS6586X_SLEW_RATE_1760UV 0x05
11#define TPS6586X_SLEW_RATE_3520UV 0x06
12#define TPS6586X_SLEW_RATE_7040UV 0x07
13
14#define TPS6586X_SLEW_RATE_SET 0x08
15#define TPS6586X_SLEW_RATE_MASK 0x07
16
e0a3da80
SA
17/* VERSION CRC */
18#define TPS658621A 0x15
19#define TPS658621CD 0x2c
20#define TPS658623 0x1b
6c46ccc8
AB
21#define TPS658640 0x01
22#define TPS658640v2 0x02
e0a3da80
SA
23#define TPS658643 0x03
24
c6c19332 25enum {
9394b80c 26 TPS6586X_ID_SYS,
c6c19332
MR
27 TPS6586X_ID_SM_0,
28 TPS6586X_ID_SM_1,
29 TPS6586X_ID_SM_2,
30 TPS6586X_ID_LDO_0,
31 TPS6586X_ID_LDO_1,
32 TPS6586X_ID_LDO_2,
33 TPS6586X_ID_LDO_3,
34 TPS6586X_ID_LDO_4,
35 TPS6586X_ID_LDO_5,
36 TPS6586X_ID_LDO_6,
37 TPS6586X_ID_LDO_7,
38 TPS6586X_ID_LDO_8,
39 TPS6586X_ID_LDO_9,
40 TPS6586X_ID_LDO_RTC,
64e48160 41 TPS6586X_ID_MAX_REGULATOR,
c6c19332
MR
42};
43
c26448c4
GK
44enum {
45 TPS6586X_INT_PLDO_0,
46 TPS6586X_INT_PLDO_1,
47 TPS6586X_INT_PLDO_2,
48 TPS6586X_INT_PLDO_3,
49 TPS6586X_INT_PLDO_4,
50 TPS6586X_INT_PLDO_5,
51 TPS6586X_INT_PLDO_6,
52 TPS6586X_INT_PLDO_7,
53 TPS6586X_INT_COMP_DET,
54 TPS6586X_INT_ADC,
55 TPS6586X_INT_PLDO_8,
56 TPS6586X_INT_PLDO_9,
57 TPS6586X_INT_PSM_0,
58 TPS6586X_INT_PSM_1,
59 TPS6586X_INT_PSM_2,
60 TPS6586X_INT_PSM_3,
61 TPS6586X_INT_RTC_ALM1,
62 TPS6586X_INT_ACUSB_OVP,
63 TPS6586X_INT_USB_DET,
64 TPS6586X_INT_AC_DET,
65 TPS6586X_INT_BAT_DET,
66 TPS6586X_INT_CHG_STAT,
67 TPS6586X_INT_CHG_TEMP,
68 TPS6586X_INT_PP,
69 TPS6586X_INT_RESUME,
70 TPS6586X_INT_LOW_SYS,
71 TPS6586X_INT_RTC_ALM2,
72};
73
500c524a
XX
74struct tps6586x_settings {
75 int slew_rate;
76};
77
c6c19332
MR
78struct tps6586x_subdev_info {
79 int id;
80 const char *name;
81 void *platform_data;
62f6b087 82 struct device_node *of_node;
c6c19332
MR
83};
84
85struct tps6586x_platform_data {
86 int num_subdevs;
87 struct tps6586x_subdev_info *subdevs;
88
89 int gpio_base;
c26448c4 90 int irq_base;
004c15a6 91 bool pm_off;
64e48160
LD
92
93 struct regulator_init_data *reg_init_data[TPS6586X_ID_MAX_REGULATOR];
c6c19332
MR
94};
95
96/*
97 * NOTE: the functions below are not intended for use outside
98 * of the TPS6586X sub-device drivers
99 */
100extern int tps6586x_write(struct device *dev, int reg, uint8_t val);
101extern int tps6586x_writes(struct device *dev, int reg, int len, uint8_t *val);
102extern int tps6586x_read(struct device *dev, int reg, uint8_t *val);
103extern int tps6586x_reads(struct device *dev, int reg, int len, uint8_t *val);
104extern int tps6586x_set_bits(struct device *dev, int reg, uint8_t bit_mask);
105extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
106extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
107 uint8_t mask);
605511a8 108extern int tps6586x_irq_get_virq(struct device *dev, int irq);
e0a3da80 109extern int tps6586x_get_version(struct device *dev);
c6c19332
MR
110
111#endif /*__LINUX_MFD_TPS6586X_H */