Justin Paupore | a6cd209 | 2011-06-22 16:19:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 3 | * |
| 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 | */ |
| 45 | struct proccomm_regulator_info { |
| 46 | struct regulator_init_data init_data; |
| 47 | int id; |
| 48 | int rise_time; |
| 49 | int pulldown; |
| 50 | int negative; |
| 51 | }; |
| 52 | |
| 53 | /** |
| 54 | * struct proccomm_regulator_platform_data - proccomm driver platform data. |
| 55 | * |
| 56 | * Contains a description of a set of proccomm-controlled regulators. |
| 57 | * Pass this in the platform_data field when instantiating the driver. |
| 58 | * |
| 59 | * @regs: An array of struct proccomm_regulator_info describing |
| 60 | * the regulators to register. |
| 61 | * @nregs: The number of regulators to register. |
| 62 | */ |
| 63 | struct proccomm_regulator_platform_data { |
| 64 | struct proccomm_regulator_info *regs; |
| 65 | size_t nregs; |
| 66 | }; |
| 67 | |
| 68 | #if defined(CONFIG_MSM_VREG_SWITCH_INVERTED) |
| 69 | #define VREG_SWITCH_ENABLE 0 |
| 70 | #define VREG_SWITCH_DISABLE 1 |
| 71 | #else |
| 72 | #define VREG_SWITCH_ENABLE 1 |
| 73 | #define VREG_SWITCH_DISABLE 0 |
| 74 | #endif |
| 75 | |
| 76 | #endif |