1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef __MAX14577_H__
20#define __MAX14577_H__
21
22#include <linux/regulator/consumer.h>
23
24
25enum max14577_regulators {
26 MAX14577_SAFEOUT = 0,
27 MAX14577_CHARGER,
28
29 MAX14577_REGULATOR_NUM,
30};
31
32
33enum max77836_regulators {
34 MAX77836_SAFEOUT = 0,
35 MAX77836_CHARGER,
36 MAX77836_LDO1,
37 MAX77836_LDO2,
38
39 MAX77836_REGULATOR_NUM,
40};
41
42struct max14577_regulator_platform_data {
43 int id;
44 struct regulator_init_data *initdata;
45 struct device_node *of_node;
46};
47
48struct max14577_charger_platform_data {
49 u32 constant_uvolt;
50 u32 fast_charge_uamp;
51 u32 eoc_uamp;
52 u32 ovp_uvolt;
53};
54
55
56
57
58struct max14577_platform_data {
59
60 int irq_base;
61
62
63 int gpio_pogo_vbatt_en;
64 int gpio_pogo_vbus_en;
65
66
67 int (*set_gpio_pogo_vbatt_en) (int gpio_val);
68 int (*set_gpio_pogo_vbus_en) (int gpio_val);
69
70 int (*set_gpio_pogo_cb) (int new_dev);
71
72 struct max14577_regulator_platform_data *regulators;
73};
74
75
76
77
78
79
80struct maxim_charger_current {
81
82 unsigned int min;
83
84
85
86
87 unsigned int high_start;
88
89 unsigned int high_step;
90
91 unsigned int max;
92};
93
94extern const struct maxim_charger_current maxim_charger_currents[];
95extern int maxim_charger_calc_reg_current(const struct maxim_charger_current *limits,
96 unsigned int min_ua, unsigned int max_ua, u8 *dst);
97
98#endif
99