1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * max8998.h - Voltage regulator driver for the Maxim 8998
5 * Copyright (C) 2009-2010 Samsung Electrnoics
10 #ifndef __LINUX_MFD_MAX8998_H
11 #define __LINUX_MFD_MAX8998_H
13 #include <linux/regulator/machine.h>
15 /* MAX 8998 regulator ids */
46 * max8998_regulator_data - regulator data
48 * @initdata: regulator init data (contraints, supplies, ...)
49 * @reg_node: DT node of regulator (unused on non-DT platforms)
51 struct max8998_regulator_data {
53 struct regulator_init_data *initdata;
54 struct device_node *reg_node;
58 * struct max8998_board - packages regulator init data
59 * @regulators: array of defined regulators
60 * @num_regulators: number of regulators used
61 * @irq_base: base IRQ number for max8998, required for IRQs
62 * @ono: power onoff IRQ number for max8998
63 * @buck_voltage_lock: Do NOT change the values of the following six
64 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
65 * be other than the preset values.
66 * @buck1_voltage: BUCK1 DVS mode 1 voltage registers
67 * @buck2_voltage: BUCK2 DVS mode 2 voltage registers
68 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
69 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
70 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2
71 * @buck2_set3: BUCK2 gpio pin to set output voltage
72 * @buck2_default_idx: Default for BUCK2 gpio pin.
73 * @wakeup: Allow to wake up from suspend
74 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register
75 * write before reading it.
76 * @eoc: End of Charge Level in percent: 10% ~ 45% by 5% step
77 * If it equals 0, leave it unchanged.
78 * Otherwise, it is a invalid value.
79 * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
80 * If it equals 0, leave it unchanged.
81 * Otherwise, it is a invalid value.
82 * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
83 * If it equals 0, leave it unchanged.
84 * Otherwise, leave it unchanged.
86 struct max8998_platform_data {
87 struct max8998_regulator_data *regulators;
89 unsigned int irq_base;
91 bool buck_voltage_lock;
96 int buck1_default_idx;
98 int buck2_default_idx;
106 #endif /* __LINUX_MFD_MAX8998_H */