summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-01-24 17:25:10 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:49:55 -0700
commit502037dd93613334863a4a0356489a4ab63b6bf7 (patch)
tree75772bcf51180f198fc0a13dd006e980a8e13b90 /include/linux
parent4e80899d99187c37c4941c6873627ca94d824df7 (diff)
regulator: Adding gpio switch based regulator
Supporting gpio switch based regulator so that client can use the power rail through the regulator framework even if the power rail partially controlled by gpio. Original-Change-Id: I8cd0141a337d4a38a1b10efb0b5dbb8e3ff98a12 Reviewed-on: http://git-master/r/16727 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Change-Id: I15dedf9ab874037922186b97c5f9daa33dde0b5f
Diffstat (limited to 'include/linux')
-rwxr-xr-xinclude/linux/gpio-switch-regulator.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/gpio-switch-regulator.h b/include/linux/gpio-switch-regulator.h
new file mode 100755
index 000000000000..ae2608110ef7
--- /dev/null
+++ b/include/linux/gpio-switch-regulator.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2011, NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GPIO_SWITCH_REGULATOR_H
+#define _GPIO_SWITCH_REGULATOR_H
+
+#include <linux/regulator/machine.h>
+
+/*
+ * struct gpio_regulator_switch_platform_data - Gpio based regulato switch
+ * platform data.
+ *
+ * Platform data to register a gpio regulator switch device driver.
+ *
+ * @regulator_name: The name of regulator.
+ * @input_supply: Input supply name.
+ * @id: The id of the switch.
+ * @gpio_nr: Gpio nr which controls this switch.
+ * @active_low: true if making gpio low makes voltage output enable.
+ * @voltages: Possible voltages to set at output.
+ * @n_voltages: Number of voltages.
+ * @num_consumer_supplies: Number of cosumer supplies.
+ * @consumer_supplies: List of consumer spllies.
+ */
+struct gpio_switch_regulator_platform_data {
+ const char *regulator_name;
+ const char *input_supply;
+ int id;
+ int gpio_nr;
+ int active_low;
+ int *voltages;
+ unsigned n_voltages;
+ struct regulator_consumer_supply *consumer_supplies;
+ int num_consumer_supplies;
+ struct regulation_constraints constraints;
+};
+#endif