aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-03-24 11:29:58 +0000
committerArnd Bergmann <arnd@arndb.de>2012-03-24 11:29:58 +0000
commit511f1cb6d426938fabf9c6d69ce4861b66ffd919 (patch)
tree88fd9b5c15ccb42d5d582f83e87ce5d3f16127cb /include/linux/regulator
parentMerge branch 'next/fixes-non-critical' into next/drivers (diff)
parentMerge tag 'topic/twl' into regulator-next (diff)
downloadlinux-dev-511f1cb6d426938fabf9c6d69ce4861b66ffd919.tar.xz
linux-dev-511f1cb6d426938fabf9c6d69ce4861b66ffd919.zip
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into next/drivers
The pxa regulator branch removes the bq24022 driver, while a lot of other regulator drivers got added in the regulator tree. This resolves the trivial conflicts by merging in the regulator patches that are already merged into v3.4. Conflicts: drivers/regulator/Kconfig drivers/regulator/Makefile Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/consumer.h22
-rw-r--r--include/linux/regulator/driver.h6
-rw-r--r--include/linux/regulator/fixed.h13
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/regulator/tps62360.h57
5 files changed, 94 insertions, 6 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f2698a0edfc4..b6c8d717c7ec 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -132,9 +132,12 @@ struct regulator_bulk_data {
/* regulator get and put */
struct regulator *__must_check regulator_get(struct device *dev,
const char *id);
+struct regulator *__must_check devm_regulator_get(struct device *dev,
+ const char *id);
struct regulator *__must_check regulator_get_exclusive(struct device *dev,
const char *id);
void regulator_put(struct regulator *regulator);
+void devm_regulator_put(struct regulator *regulator);
/* regulator output control and status */
int regulator_enable(struct regulator *regulator);
@@ -145,6 +148,8 @@ int regulator_disable_deferred(struct regulator *regulator, int ms);
int regulator_bulk_get(struct device *dev, int num_consumers,
struct regulator_bulk_data *consumers);
+int devm_regulator_bulk_get(struct device *dev, int num_consumers,
+ struct regulator_bulk_data *consumers);
int regulator_bulk_enable(int num_consumers,
struct regulator_bulk_data *consumers);
int regulator_bulk_disable(int num_consumers,
@@ -200,10 +205,21 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
*/
return NULL;
}
+
+static inline struct regulator *__must_check
+devm_regulator_get(struct device *dev, const char *id)
+{
+ return NULL;
+}
+
static inline void regulator_put(struct regulator *regulator)
{
}
+static inline void devm_regulator_put(struct regulator *regulator)
+{
+}
+
static inline int regulator_enable(struct regulator *regulator)
{
return 0;
@@ -237,6 +253,12 @@ static inline int regulator_bulk_get(struct device *dev,
return 0;
}
+static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers,
+ struct regulator_bulk_data *consumers)
+{
+ return 0;
+}
+
static inline int regulator_bulk_enable(int num_consumers,
struct regulator_bulk_data *consumers)
{
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 4214b9a9d1c9..fa8b55b8191c 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -104,7 +104,7 @@ struct regulator_ops {
int (*disable) (struct regulator_dev *);
int (*is_enabled) (struct regulator_dev *);
- /* get/set regulator operating mode (defined in regulator.h) */
+ /* get/set regulator operating mode (defined in consumer.h) */
int (*set_mode) (struct regulator_dev *, unsigned int mode);
unsigned int (*get_mode) (struct regulator_dev *);
@@ -135,7 +135,7 @@ struct regulator_ops {
int (*set_suspend_enable) (struct regulator_dev *);
int (*set_suspend_disable) (struct regulator_dev *);
- /* set regulator suspend operating mode (defined in regulator.h) */
+ /* set regulator suspend operating mode (defined in consumer.h) */
int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
};
@@ -207,9 +207,7 @@ struct regulator_dev {
void *reg_data; /* regulator_dev data */
-#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
-#endif
};
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index ffd7d508e726..936a7d8c11a9 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -48,4 +48,17 @@ struct fixed_voltage_config {
struct regulator_init_data *init_data;
};
+struct regulator_consumer_supply;
+
+#if IS_ENABLED(CONFIG_REGULATOR)
+struct platform_device *regulator_register_fixed(int id,
+ struct regulator_consumer_supply *supplies, int num_supplies);
+#else
+static inline struct platform_device *regulator_register_fixed(int id,
+ struct regulator_consumer_supply *supplies, int num_supplies)
+{
+ return NULL;
+}
+#endif
+
#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index f3f13fd5868f..7abb16093312 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -139,12 +139,10 @@ struct regulation_constraints {
* make struct device available late such as I2C and is the preferred
* form.
*
- * @dev: Device structure for the consumer.
* @dev_name: Result of dev_name() for the consumer.
* @supply: Name for the supply.
*/
struct regulator_consumer_supply {
- struct device *dev; /* consumer */
const char *dev_name; /* dev_name() for consumer */
const char *supply; /* consumer supply - e.g. "vcc" */
};
diff --git a/include/linux/regulator/tps62360.h b/include/linux/regulator/tps62360.h
new file mode 100644
index 000000000000..6a5c1b2c751e
--- /dev/null
+++ b/include/linux/regulator/tps62360.h
@@ -0,0 +1,57 @@
+/*
+ * tps62360.h -- TI tps62360
+ *
+ * Interface for regulator driver for TI TPS62360 Processor core supply
+ *
+ * Copyright (C) 2012 NVIDIA Corporation
+
+ * Author: Laxman Dewangan <ldewangan@nvidia.com>
+ *
+ * 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 __LINUX_REGULATOR_TPS62360_H
+#define __LINUX_REGULATOR_TPS62360_H
+
+#include <linux/regulator/machine.h>
+
+/*
+ * struct tps62360_regulator_platform_data - tps62360 regulator platform data.
+ *
+ * @reg_init_data: The regulator init data.
+ * @en_force_pwm: Enable force pwm or not.
+ * @en_discharge: Enable discharge the output capacitor via internal
+ * register.
+ * @en_internal_pulldn: internal pull down enable or not.
+ * @vsel0_gpio: Gpio number for vsel0. It should be -1 if this is tied with
+ * fixed logic.
+ * @vsel1_gpio: Gpio number for vsel1. It should be -1 if this is tied with
+ * fixed logic.
+ * @vsel0_def_state: Default state of vsel0. 1 if it is high else 0.
+ * @vsel1_def_state: Default state of vsel1. 1 if it is high else 0.
+ */
+struct tps62360_regulator_platform_data {
+ struct regulator_init_data reg_init_data;
+ bool en_force_pwm;
+ bool en_discharge;
+ bool en_internal_pulldn;
+ int vsel0_gpio;
+ int vsel1_gpio;
+ int vsel0_def_state;
+ int vsel1_def_state;
+};
+
+#endif /* __LINUX_REGULATOR_TPS62360_H */