Thomas Gleixner | d925da5 | 2019-06-01 10:09:04 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Beomho Seo | 0b27125 | 2014-12-09 21:03:51 +0900 | [diff] [blame] | 2 | /* |
| 3 | * MFD core driver for the RT5033 |
| 4 | * |
| 5 | * Copyright (C) 2014 Samsung Electronics |
| 6 | * Author: Beomho Seo <beomho.seo@samsung.com> |
Beomho Seo | 0b27125 | 2014-12-09 21:03:51 +0900 | [diff] [blame] | 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; |
Krzysztof Kozlowski | 297d716 | 2015-03-12 08:44:11 +0100 | [diff] [blame] | 39 | struct power_supply *psy; |
Beomho Seo | 0b27125 | 2014-12-09 21:03:51 +0900 | [diff] [blame] | 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__ */ |