2 * max8998.h - Voltage regulator driver for the Maxim 8998
4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * Marek Szyprowski <m.szyprowski@samsung.com>
8 * This program is not provided / owned by Maxim Integrated Products.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef __LINUX_MFD_MAX8998_H
26 #define __LINUX_MFD_MAX8998_H
28 #include <linux/regulator/machine.h>
30 /* MAX 8998 regulator ids */
58 * CHARGER: Controls ON/OFF, current limit of the charger.
59 * However, note that even if CHARGER is ON, CHARGER_ONLINE
60 * can be in "disabled" state by MAX8998 internal control.
66 * max8998_regulator_data - regulator data
68 * @initdata: regulator init data (contraints, supplies, ...)
70 struct max8998_regulator_data {
72 struct regulator_init_data *initdata;
76 * struct max8998_board - packages regulator init data
77 * @regulators: array of defined regulators
78 * @num_regulators: number of regultors used
79 * @irq_base: base IRQ number for max8998, required for IRQs
80 * @ono: power onoff IRQ number for max8998
81 * @buck_voltage_lock: Do NOT change the values of the following six
82 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
83 * be other than the preset values.
84 * @buck1_voltage1: BUCK1 DVS mode 1 voltage register
85 * @buck1_voltage2: BUCK1 DVS mode 2 voltage register
86 * @buck1_voltage3: BUCK1 DVS mode 3 voltage register
87 * @buck1_voltage4: BUCK1 DVS mode 4 voltage register
88 * @buck2_voltage1: BUCK2 DVS mode 1 voltage register
89 * @buck2_voltage2: BUCK2 DVS mode 2 voltage register
90 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
91 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
92 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2
93 * @buck2_set3: BUCK2 gpio pin to set output voltage
94 * @buck2_default_idx: Default for BUCK2 gpio pin.
95 * @eoc: End of Charge Level: 10 ~ 45% or if it's over 45, in mA.
96 * If it's under 10, leave it unchanged.
97 * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
98 * Otherwise, leave it unchanged.
99 * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
100 * Otherwise, leave it unchanged.
102 struct max8998_platform_data {
103 struct max8998_regulator_data *regulators;
107 bool buck_voltage_lock;
116 int buck1_default_idx;
118 int buck2_default_idx;
125 #endif /* __LINUX_MFD_MAX8998_H */