aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2013-08-16 16:28:51 +0800
committerAndrey Konovalov <andrey.konovalov@linaro.org>2014-04-16 23:52:21 +0400
commite11ce040a1fc556e00425a722de3b6c900e2450b (patch)
treeef09d8b40ac7f80a3b56db7115e6b502a9b66394 /include/linux
parent37e4edee5186248344363c4ec30c8538dfaa8e24 (diff)
regulator: hi6421: Add support to hi6421 regulators
Add support to hi6421 regulators. Hi6421 is a multi-functional PMIC manufactured by HiSilicon Inc. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/hi6421-pmic.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/mfd/hi6421-pmic.h b/include/linux/mfd/hi6421-pmic.h
index 2f875cf52ae..0b60a9b2a66 100644
--- a/include/linux/mfd/hi6421-pmic.h
+++ b/include/linux/mfd/hi6421-pmic.h
@@ -24,6 +24,8 @@
#define __HI6421_PMIC_H
#include <linux/irqdomain.h>
+#include <linux/mutex.h>
+#include <linux/time.h>
#define OCP_DEB_CTRL_REG (0x51)
#define OCP_DEB_SEL_MASK (0x0C)
@@ -66,6 +68,17 @@
#define HI6421_IRQ_BATTERY_ON 20 /* Battery inserted */
#define HI6421_IRQ_RESET 21 /* Reset */
+/**
+ * struct hi6421_pmic - Hi6421 PMIC chip-level data structure.
+ *
+ * This struct describes Hi6421 PMIC chip-level data.
+ *
+ * @enable_mutex: Used by regulators, to make sure that only one regulator is
+ * in the turning-on phase at any time. See also @last_enabled
+ * and hi6421_regulator_enable().
+ * @last_enabled: Used by regulators, to make sure enough distance in time
+ * between enabling of any of two regulators.
+ */
struct hi6421_pmic {
struct resource *res;
struct device *dev;
@@ -74,6 +87,8 @@ struct hi6421_pmic {
struct irq_domain *domain;
int irq;
int gpio;
+ struct mutex enable_mutex;
+ struct timeval last_enabled;
};
/* Register Access Helpers */