blob: 953c4addf9c42e26778ef06fe5c6ef463d22690e [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
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 __PMIC8901_REGULATOR_H__
15#define __PMIC8901_REGULATOR_H__
16
17#include <linux/regulator/machine.h>
18
19/* Low dropout regulator ids */
20#define PM8901_VREG_ID_L0 0
21#define PM8901_VREG_ID_L1 1
22#define PM8901_VREG_ID_L2 2
23#define PM8901_VREG_ID_L3 3
24#define PM8901_VREG_ID_L4 4
25#define PM8901_VREG_ID_L5 5
26#define PM8901_VREG_ID_L6 6
27
28/* Switched-mode power supply regulator ids */
29#define PM8901_VREG_ID_S0 7
30#define PM8901_VREG_ID_S1 8
31#define PM8901_VREG_ID_S2 9
32#define PM8901_VREG_ID_S3 10
33#define PM8901_VREG_ID_S4 11
34
35/* External regulator controlled by MPP pin ids */
36#define PM8901_VREG_ID_MPP0 12
37
38/* Low voltage switch regulator ids */
39#define PM8901_VREG_ID_LVS0 13
40#define PM8901_VREG_ID_LVS1 14
41#define PM8901_VREG_ID_LVS2 15
42#define PM8901_VREG_ID_LVS3 16
43
44/* Medium voltage switch regulator ids */
45#define PM8901_VREG_ID_MVS0 17
46
47/* USB OTG voltage switch regulator ids */
48#define PM8901_VREG_ID_USB_OTG 18
49
50/* HDMI medium voltage switch regulator ids */
51#define PM8901_VREG_ID_HDMI_MVS 19
52
53#define PM8901_VREG_MAX (PM8901_VREG_ID_HDMI_MVS + 1)
54
55#define PM8901_VREG_PIN_CTRL_NONE 0x00
56#define PM8901_VREG_PIN_CTRL_A0 0x01
57#define PM8901_VREG_PIN_CTRL_A1 0x02
58#define PM8901_VREG_PIN_CTRL_D0 0x04
59#define PM8901_VREG_PIN_CTRL_D1 0x08
60
61/* Minimum high power mode loads in uA. */
62#define PM8901_VREG_LDO_300_HPM_MIN_LOAD 10000
63#define PM8901_VREG_FTSMPS_HPM_MIN_LOAD 100000
64
65/* Pin ctrl enables/disables or toggles high/low power modes */
66enum pm8901_vreg_pin_fn {
67 PM8901_VREG_PIN_FN_ENABLE = 0,
68 PM8901_VREG_PIN_FN_MODE,
69};
70
71struct pm8901_vreg_pdata {
72 struct regulator_init_data init_data;
73 unsigned pull_down_enable;
74 unsigned pin_ctrl;
75 enum pm8901_vreg_pin_fn pin_fn;
76 unsigned active_high; /* For use with MPP. */
77};
78
79#endif