blob: 2fcb9980262a100deecd257975e51b3dc4d9e0e4 [file] [log] [blame]
Laxman Dewangan5928f532012-11-19 06:58:29 +05301/*
2 * max8973-regulator.h -- MAXIM 8973 regulator
3 *
4 * Interface for regulator driver for MAXIM 8973 DC-DC step-down
5 * switching regulator.
6 *
7 * Copyright (C) 2012 NVIDIA Corporation
8
9 * Author: Laxman Dewangan <ldewangan@nvidia.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *
25 */
26
27#ifndef __LINUX_REGULATOR_MAX8973_H
28#define __LINUX_REGULATOR_MAX8973_H
29
30/*
31 * Control flags for configuration of the device.
32 * Client need to pass this information with ORed
33 */
34#define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001
35#define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002
36#define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004
37#define MAX8973_CONTROL_BIAS_ENABLE 0x00000008
38#define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010
39#define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020
40
41#define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000
42#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000
43#define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000
44#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000
45
46#define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000
47#define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000
48#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000
49#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000
50
51/*
52 * struct max8973_regulator_platform_data - max8973 regulator platform data.
53 *
54 * @reg_init_data: The regulator init data.
55 * @control_flags: Control flags which are ORed value of above flags to
56 * configure device.
Laxman Dewangand2d5437b2016-04-13 15:29:45 +053057 * @junction_temp_warning: Junction temp in millicelcius on which warning need
58 * to be set. Thermal functionality is only supported on
59 * MAX77621. The threshold warning supported by MAX77621
60 * are 120C and 140C.
Laxman Dewangan5928f532012-11-19 06:58:29 +053061 * @enable_ext_control: Enable the voltage enable/disable through external
62 * control signal from EN input pin. If it is false then
63 * voltage output will be enabled/disabled through EN bit of
64 * device register.
Laxman Dewangan69eb0982015-04-23 16:10:24 +053065 * @enable_gpio: Enable GPIO. If EN pin is controlled through GPIO from host
66 * then GPIO number can be provided. If no GPIO controlled then
67 * it should be -1.
Laxman Dewangan5928f532012-11-19 06:58:29 +053068 * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic.
69 * @dvs_def_state: Default state of dvs. 1 if it is high else 0.
70 */
71struct max8973_regulator_platform_data {
72 struct regulator_init_data *reg_init_data;
73 unsigned long control_flags;
Laxman Dewangand2d5437b2016-04-13 15:29:45 +053074 unsigned long junction_temp_warning;
Laxman Dewangan5928f532012-11-19 06:58:29 +053075 bool enable_ext_control;
Laxman Dewangan69eb0982015-04-23 16:10:24 +053076 int enable_gpio;
Laxman Dewangan5928f532012-11-19 06:58:29 +053077 int dvs_gpio;
78 unsigned dvs_def_state:1;
79};
80
81#endif /* __LINUX_REGULATOR_MAX8973_H */