diff options
Diffstat (limited to 'include/linux/regulator/gpio-switch-regulator.h')
| -rw-r--r-- | include/linux/regulator/gpio-switch-regulator.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/regulator/gpio-switch-regulator.h b/include/linux/regulator/gpio-switch-regulator.h new file mode 100644 index 00000000000..68776b93ef0 --- /dev/null +++ b/include/linux/regulator/gpio-switch-regulator.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2011, NVIDIA Corporation. | ||
| 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 as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _GPIO_SWITCH_REGULATOR_H | ||
| 20 | #define _GPIO_SWITCH_REGULATOR_H | ||
| 21 | |||
| 22 | #include <linux/regulator/machine.h> | ||
| 23 | |||
| 24 | /* | ||
| 25 | * struct gpio_switch_regulator_subdev_data - Gpio switch regulator subdevice | ||
| 26 | * data. | ||
| 27 | * | ||
| 28 | * Subdevice data to register a gpio regulator switch device driver. | ||
| 29 | * | ||
| 30 | * @regulator_name: The name of regulator. | ||
| 31 | * @input_supply: Input supply name. | ||
| 32 | * @id: The id of the switch. | ||
| 33 | * @gpio_nr: Gpio nr which controls this switch. | ||
| 34 | * @active_low: true if making gpio low makes voltage output enable. | ||
| 35 | * @init_state: 1 if init_state should be active. | ||
| 36 | * @voltages: Possible voltages to set at output. The values are in millivolt. | ||
| 37 | * @n_voltages: Number of voltages. | ||
| 38 | * @num_consumer_supplies: Number of cosumer supplies. | ||
| 39 | * @consumer_supplies: List of consumer spllies. | ||
| 40 | */ | ||
| 41 | struct gpio_switch_regulator_subdev_data { | ||
| 42 | const char *regulator_name; | ||
| 43 | const char *input_supply; | ||
| 44 | int id; | ||
| 45 | int gpio_nr; | ||
| 46 | int active_low; | ||
| 47 | int pin_group; | ||
| 48 | int init_state; | ||
| 49 | int *voltages; | ||
| 50 | unsigned n_voltages; | ||
| 51 | struct regulator_consumer_supply *consumer_supplies; | ||
| 52 | int num_consumer_supplies; | ||
| 53 | struct regulation_constraints constraints; | ||
| 54 | int (*enable_rail)(struct gpio_switch_regulator_subdev_data *pdata); | ||
| 55 | int (*disable_rail)(struct gpio_switch_regulator_subdev_data *pdata); | ||
| 56 | |||
| 57 | }; | ||
| 58 | |||
| 59 | /** | ||
| 60 | * gpio_switch_regulator_platform_data - platform data for gpio_switch_regulator | ||
| 61 | * @num_subdevs: number of regulators used | ||
| 62 | * @subdevs: pointer to regulators used | ||
| 63 | */ | ||
| 64 | struct gpio_switch_regulator_platform_data { | ||
| 65 | int num_subdevs; | ||
| 66 | struct gpio_switch_regulator_subdev_data **subdevs; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #endif | ||
