blob: 60d935385e612d6e78573d3bdd9c837f51deefe2 [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 __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
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035/* Low voltage switch regulator ids */
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053036#define PM8901_VREG_ID_LVS0 12
37#define PM8901_VREG_ID_LVS1 13
38#define PM8901_VREG_ID_LVS2 14
39#define PM8901_VREG_ID_LVS3 15
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040
41/* Medium voltage switch regulator ids */
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053042#define PM8901_VREG_ID_MVS0 16
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043
44/* USB OTG voltage switch regulator ids */
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053045#define PM8901_VREG_ID_USB_OTG 17
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046
47/* HDMI medium voltage switch regulator ids */
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053048#define PM8901_VREG_ID_HDMI_MVS 18
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049
50#define PM8901_VREG_MAX (PM8901_VREG_ID_HDMI_MVS + 1)
51
52#define PM8901_VREG_PIN_CTRL_NONE 0x00
53#define PM8901_VREG_PIN_CTRL_A0 0x01
54#define PM8901_VREG_PIN_CTRL_A1 0x02
55#define PM8901_VREG_PIN_CTRL_D0 0x04
56#define PM8901_VREG_PIN_CTRL_D1 0x08
57
58/* Minimum high power mode loads in uA. */
59#define PM8901_VREG_LDO_300_HPM_MIN_LOAD 10000
60#define PM8901_VREG_FTSMPS_HPM_MIN_LOAD 100000
61
62/* Pin ctrl enables/disables or toggles high/low power modes */
63enum pm8901_vreg_pin_fn {
64 PM8901_VREG_PIN_FN_ENABLE = 0,
65 PM8901_VREG_PIN_FN_MODE,
66};
67
68struct pm8901_vreg_pdata {
69 struct regulator_init_data init_data;
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053070 int id;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070071 unsigned pull_down_enable;
72 unsigned pin_ctrl;
73 enum pm8901_vreg_pin_fn pin_fn;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070074};
75
76#endif