Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | /* Low voltage switch regulator ids */ |
Anirudh Ghayal | 9f77e96 | 2011-12-06 12:38:21 +0530 | [diff] [blame] | 36 | #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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | |
| 41 | /* Medium voltage switch regulator ids */ |
Anirudh Ghayal | 9f77e96 | 2011-12-06 12:38:21 +0530 | [diff] [blame] | 42 | #define PM8901_VREG_ID_MVS0 16 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 43 | |
| 44 | /* USB OTG voltage switch regulator ids */ |
Anirudh Ghayal | 9f77e96 | 2011-12-06 12:38:21 +0530 | [diff] [blame] | 45 | #define PM8901_VREG_ID_USB_OTG 17 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 46 | |
| 47 | /* HDMI medium voltage switch regulator ids */ |
Anirudh Ghayal | 9f77e96 | 2011-12-06 12:38:21 +0530 | [diff] [blame] | 48 | #define PM8901_VREG_ID_HDMI_MVS 18 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 49 | |
| 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 */ |
| 63 | enum pm8901_vreg_pin_fn { |
| 64 | PM8901_VREG_PIN_FN_ENABLE = 0, |
| 65 | PM8901_VREG_PIN_FN_MODE, |
| 66 | }; |
| 67 | |
| 68 | struct pm8901_vreg_pdata { |
| 69 | struct regulator_init_data init_data; |
Anirudh Ghayal | 9f77e96 | 2011-12-06 12:38:21 +0530 | [diff] [blame] | 70 | int id; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 71 | unsigned pull_down_enable; |
| 72 | unsigned pin_ctrl; |
| 73 | enum pm8901_vreg_pin_fn pin_fn; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | #endif |