summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEduardo Valentin <eduardo.valentin@ti.com>2012-07-30 12:36:36 +0800
committerAndy Green <andy.green@linaro.org>2012-07-30 12:36:36 +0800
commitea6395da63fd747e3c3c12e55d0497d66a0c971a (patch)
tree936309f1dfa6fc0202cbab2bd99be084a7d148ab /include
parent363438f13dc039e971bfa53c3331e9d750ab9d00 (diff)
mfd: omap: control: core system control driver
This patch introduces a MFD core device driver for OMAP system control module. The control module allows software control of various static modes supported by the device. It is composed of two control submodules: general control module and device (padconfiguration) control module. In this patch, the children defined are for: . USB-phy pin control . Bangap temperature sensor Device driver is probed with postcore_initcall. However, as some of the APIs exposed by this driver may be needed in very early init phase, an early init class is also available: "early_omap_control". Change-Id: I0e5a62508dbdfe0a677c9d833cf52474cd8b625e Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/omap_control.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/linux/mfd/omap_control.h b/include/linux/mfd/omap_control.h
new file mode 100644
index 000000000000..b9198828fee0
--- /dev/null
+++ b/include/linux/mfd/omap_control.h
@@ -0,0 +1,67 @@
+/*
+ * OMAP system control module header file
+ *
+ * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact:
+ * J Keerthy <j-keerthy@ti.com>
+ * Moiz Sonasath <m-sonasath@ti.com>
+ * Abraham, Kishon Vijay <kishon@ti.com>
+ * Eduardo Valentin <eduardo.valentin@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __DRIVERS_OMAP_CONTROL_H
+#define __DRIVERS_OMAP_CONTROL_H
+
+/**
+ * struct system control module - scm device structure
+ * @dev: device pointer
+ * @base: Base of the temp I/O
+ * @reglock: protect omap_control structure
+ * @use_count: track API users
+ */
+struct omap_control {
+ struct device *dev;
+ void __iomem *base;
+ /* protect this data structure and register access */
+ spinlock_t reglock;
+ int use_count;
+};
+
+#ifdef CONFIG_MFD_OMAP_CONTROL
+extern int omap_control_readl(struct device *dev, u32 reg, u32 *val);
+extern int omap_control_writel(struct device *dev, u32 val, u32 reg);
+extern struct device *omap_control_get(void);
+extern void omap_control_put(struct device *dev);
+#else
+static inline int omap_control_readl(struct device *dev, u32 reg, u32 *val)
+{
+ return 0;
+}
+
+static inline int omap_control_writel(struct device *dev, u32 val, u32 reg)
+{
+ return 0;
+}
+
+static inline struct device *omap_control_get(void)
+{
+ return ERR_PTR(-EINVAL);
+}
+
+static inline void omap_control_put(struct device *dev)
+{
+
+}
+#endif
+
+#endif /* __DRIVERS_OMAP_CONTROL_H */