xref: /openbmc/linux/include/linux/mfd/rt5033.h (revision 74be2d3b)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * MFD core driver for the RT5033
4  *
5  * Copyright (C) 2014 Samsung Electronics
6  * Author: Beomho Seo <beomho.seo@samsung.com>
7  */
8 
9 #ifndef __RT5033_H__
10 #define __RT5033_H__
11 
12 #include <linux/regulator/consumer.h>
13 #include <linux/i2c.h>
14 #include <linux/regmap.h>
15 #include <linux/power_supply.h>
16 
17 /* RT5033 regulator IDs */
18 enum rt5033_regulators {
19 	RT5033_BUCK = 0,
20 	RT5033_LDO,
21 	RT5033_SAFE_LDO,
22 
23 	RT5033_REGULATOR_NUM,
24 };
25 
26 struct rt5033_dev {
27 	struct device *dev;
28 
29 	struct regmap *regmap;
30 	struct regmap_irq_chip_data *irq_data;
31 	int irq;
32 	bool wakeup;
33 };
34 
35 struct rt5033_battery {
36 	struct i2c_client	*client;
37 	struct rt5033_dev	*rt5033;
38 	struct regmap		*regmap;
39 	struct power_supply	*psy;
40 };
41 
42 /* RT5033 charger platform data */
43 struct rt5033_charger_data {
44 	unsigned int pre_uamp;
45 	unsigned int pre_uvolt;
46 	unsigned int const_uvolt;
47 	unsigned int eoc_uamp;
48 	unsigned int fast_uamp;
49 };
50 
51 struct rt5033_charger {
52 	struct device		*dev;
53 	struct rt5033_dev	*rt5033;
54 	struct power_supply	psy;
55 
56 	struct rt5033_charger_data	*chg;
57 };
58 
59 #endif /* __RT5033_H__ */
60