blob: ee1d93d7a0c30cebc8355db5df75167dde310338 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef __PMIC8058_REGULATOR_H__
15#define __PMIC8058_REGULATOR_H__
16
17#include <linux/regulator/machine.h>
18
19/* Low dropout regulator ids */
20#define PM8058_VREG_ID_L0 0
21#define PM8058_VREG_ID_L1 1
22#define PM8058_VREG_ID_L2 2
23#define PM8058_VREG_ID_L3 3
24#define PM8058_VREG_ID_L4 4
25#define PM8058_VREG_ID_L5 5
26#define PM8058_VREG_ID_L6 6
27#define PM8058_VREG_ID_L7 7
28#define PM8058_VREG_ID_L8 8
29#define PM8058_VREG_ID_L9 9
30#define PM8058_VREG_ID_L10 10
31#define PM8058_VREG_ID_L11 11
32#define PM8058_VREG_ID_L12 12
33#define PM8058_VREG_ID_L13 13
34#define PM8058_VREG_ID_L14 14
35#define PM8058_VREG_ID_L15 15
36#define PM8058_VREG_ID_L16 16
37#define PM8058_VREG_ID_L17 17
38#define PM8058_VREG_ID_L18 18
39#define PM8058_VREG_ID_L19 19
40#define PM8058_VREG_ID_L20 20
41#define PM8058_VREG_ID_L21 21
42#define PM8058_VREG_ID_L22 22
43#define PM8058_VREG_ID_L23 23
44#define PM8058_VREG_ID_L24 24
45#define PM8058_VREG_ID_L25 25
46
47/* Switched-mode power supply regulator ids */
48#define PM8058_VREG_ID_S0 26
49#define PM8058_VREG_ID_S1 27
50#define PM8058_VREG_ID_S2 28
51#define PM8058_VREG_ID_S3 29
52#define PM8058_VREG_ID_S4 30
53
54/* Low voltage switch regulator ids */
55#define PM8058_VREG_ID_LVS0 31
56#define PM8058_VREG_ID_LVS1 32
57
58/* Negative charge pump regulator id */
59#define PM8058_VREG_ID_NCP 33
60
61#define PM8058_VREG_MAX (PM8058_VREG_ID_NCP + 1)
62
63#define PM8058_VREG_PIN_CTRL_NONE 0x00
64#define PM8058_VREG_PIN_CTRL_A0 0x01
65#define PM8058_VREG_PIN_CTRL_A1 0x02
66#define PM8058_VREG_PIN_CTRL_D0 0x04
67#define PM8058_VREG_PIN_CTRL_D1 0x08
68
69/* Minimum high power mode loads in uA. */
70#define PM8058_VREG_LDO_50_HPM_MIN_LOAD 5000
71#define PM8058_VREG_LDO_150_HPM_MIN_LOAD 10000
72#define PM8058_VREG_LDO_300_HPM_MIN_LOAD 10000
73#define PM8058_VREG_SMPS_HPM_MIN_LOAD 50000
74
75/* Pin ctrl enables/disables or toggles high/low power modes */
76enum pm8058_vreg_pin_fn {
77 PM8058_VREG_PIN_FN_ENABLE = 0,
78 PM8058_VREG_PIN_FN_MODE,
79};
80
81struct pm8058_vreg_pdata {
82 struct regulator_init_data init_data;
Anirudh Ghayalc2019332011-11-12 06:29:10 +053083 int id;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070084 unsigned pull_down_enable;
85 unsigned pin_ctrl;
86 enum pm8058_vreg_pin_fn pin_fn;
87};
88
89#endif