1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * max1586.h -- Voltage regulation for the Maxim 1586
5 * Copyright (C) 2008 Robert Jarzmik
8 #ifndef REGULATOR_MAX1586
9 #define REGULATOR_MAX1586
11 #include <linux/regulator/machine.h>
16 /* precalculated values for v3_gain */
17 #define MAX1586_GAIN_NO_R24 1000000 /* 700000 .. 1475000 mV */
18 #define MAX1586_GAIN_R24_3k32 1051098 /* 735768 .. 1550369 mV */
19 #define MAX1586_GAIN_R24_5k11 1078648 /* 755053 .. 1591005 mV */
20 #define MAX1586_GAIN_R24_7k5 1115432 /* 780802 .. 1645262 mV */
23 * max1586_subdev_data - regulator data
24 * @id: regulator Id (either MAX1586_V3 or MAX1586_V6)
25 * @name: regulator cute name (example for V3: "vcc_core")
26 * @platform_data: regulator init data (constraints, supplies, ...)
28 struct max1586_subdev_data {
31 struct regulator_init_data *platform_data;
35 * max1586_platform_data - platform data for max1586
36 * @num_subdevs: number of regulators used (may be 1 or 2)
37 * @subdevs: regulator used
38 * At most, there will be a regulator for V3 and one for V6 voltages.
39 * @v3_gain: gain on the V3 voltage output multiplied by 1e6.
40 * This can be calculated as ((1 + R24/R25 + R24/185.5kOhm) * 1e6)
41 * for an external resistor configuration as described in the
42 * data sheet (R25=100kOhm).
44 struct max1586_platform_data {
46 struct max1586_subdev_data *subdevs;