blob: 8a08e3e35c569368dd05f75b067da18c6d2af22e [file] [log] [blame]
Justin Pauporea6cd2092011-06-22 16:19:45 -07001/*
Duy Truong790f06d2013-02-13 16:38:12 -08002 * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Justin Pauporea6cd2092011-06-22 16:19:45 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __ARCH_ARM_MACH_MSM_PROCCOMM_REGULATOR_H__
15#define __ARCH_ARM_MACH_MSM_PROCCOMM_REGULATOR_H__
16
17#include <linux/regulator/machine.h>
18
19#define PROCCOMM_REGULATOR_DEV_NAME "proccomm-regulator"
20
21/**
22 * struct proccomm_regulator_info - A description of one proccomm regulator
23 * @init_data: Initialization data for the regulator.
24 * Must contain:
25 * - A list of struct regulator_consumer_supply indicating
26 * supply names for the regulator
27 * - A filled out struct regulation_constraints containing:
28 * - The name of the regulator
29 * - The minimum and maximum voltages supported
30 * - The supported modes (REGULATOR_MODE_NORMAL)
31 * - The supported operations, currently limited to:
32 * REGULATOR_CHANGE_STATUS
33 * REGULATOR_CHANGE_VOLTAGE
34 * - The input voltage, if the regulator is powered by another
35 * - Properly set always_on, boot_on, and apply_uV flags
36 * - The name of the supply regulator, if applicable
37 * @id: The proccomm ID of this regulator.
38 * @rise_time: The time that the regulator takes to initialize,
39 * in microseconds. Set to 0 to disable rise-time checking.
40 * @pulldown: Whether the regulator should be pulled down when off.
41 * 1 to pull down the regulator.
42 * 0 to leave the regulator floating.
43 * -1 to indicate no preference.
44 */
45struct proccomm_regulator_info {
46 struct regulator_init_data init_data;
47 int id;
48 int rise_time;
49 int pulldown;
50 int negative;
Pankaj Kumare8db4252012-01-04 13:06:21 +053051 int n_voltages;
Justin Pauporea6cd2092011-06-22 16:19:45 -070052};
53
54/**
55 * struct proccomm_regulator_platform_data - proccomm driver platform data.
56 *
57 * Contains a description of a set of proccomm-controlled regulators.
58 * Pass this in the platform_data field when instantiating the driver.
59 *
60 * @regs: An array of struct proccomm_regulator_info describing
61 * the regulators to register.
62 * @nregs: The number of regulators to register.
63 */
64struct proccomm_regulator_platform_data {
65 struct proccomm_regulator_info *regs;
66 size_t nregs;
67};
68
69#if defined(CONFIG_MSM_VREG_SWITCH_INVERTED)
70#define VREG_SWITCH_ENABLE 0
71#define VREG_SWITCH_DISABLE 1
72#else
73#define VREG_SWITCH_ENABLE 1
74#define VREG_SWITCH_DISABLE 0
75#endif
76
77#endif