1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_MFD_TPS6586X_H
3 #define __LINUX_MFD_TPS6586X_H
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
14 #define TPS6586X_SLEW_RATE_SET 0x08
15 #define TPS6586X_SLEW_RATE_MASK 0x07
18 #define TPS658621A 0x15
19 #define TPS658621CD 0x2c
20 #define TPS658623 0x1b
21 #define TPS658640 0x01
22 #define TPS658640v2 0x02
23 #define TPS658643 0x03
41 TPS6586X_ID_MAX_REGULATOR
,
53 TPS6586X_INT_COMP_DET
,
61 TPS6586X_INT_RTC_ALM1
,
62 TPS6586X_INT_ACUSB_OVP
,
66 TPS6586X_INT_CHG_STAT
,
67 TPS6586X_INT_CHG_TEMP
,
71 TPS6586X_INT_RTC_ALM2
,
74 struct tps6586x_settings
{
78 struct tps6586x_subdev_info
{
82 struct device_node
*of_node
;
85 struct tps6586x_platform_data
{
87 struct tps6586x_subdev_info
*subdevs
;
93 struct regulator_init_data
*reg_init_data
[TPS6586X_ID_MAX_REGULATOR
];
97 * NOTE: the functions below are not intended for use outside
98 * of the TPS6586X sub-device drivers
100 extern int tps6586x_write(struct device
*dev
, int reg
, uint8_t val
);
101 extern int tps6586x_writes(struct device
*dev
, int reg
, int len
, uint8_t *val
);
102 extern int tps6586x_read(struct device
*dev
, int reg
, uint8_t *val
);
103 extern int tps6586x_reads(struct device
*dev
, int reg
, int len
, uint8_t *val
);
104 extern int tps6586x_set_bits(struct device
*dev
, int reg
, uint8_t bit_mask
);
105 extern int tps6586x_clr_bits(struct device
*dev
, int reg
, uint8_t bit_mask
);
106 extern int tps6586x_update(struct device
*dev
, int reg
, uint8_t val
,
108 extern int tps6586x_irq_get_virq(struct device
*dev
, int irq
);
109 extern int tps6586x_get_version(struct device
*dev
);
111 #endif /*__LINUX_MFD_TPS6586X_H */