blob: 3c23b6220c049bce8fa275b29d251a6290dcac34 [file] [log] [blame]
Thomas Gleixnerd925da52019-06-01 10:09:04 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Beomho Seo0b271252014-12-09 21:03:51 +09002/*
3 * MFD core driver for the RT5033
4 *
5 * Copyright (C) 2014 Samsung Electronics
6 * Author: Beomho Seo <beomho.seo@samsung.com>
Beomho Seo0b271252014-12-09 21:03:51 +09007 */
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 */
18enum rt5033_regulators {
19 RT5033_BUCK = 0,
20 RT5033_LDO,
21 RT5033_SAFE_LDO,
22
23 RT5033_REGULATOR_NUM,
24};
25
26struct 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
35struct rt5033_battery {
36 struct i2c_client *client;
37 struct rt5033_dev *rt5033;
38 struct regmap *regmap;
Krzysztof Kozlowski297d7162015-03-12 08:44:11 +010039 struct power_supply *psy;
Beomho Seo0b271252014-12-09 21:03:51 +090040};
41
42/* RT5033 charger platform data */
43struct 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
51struct 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__ */