summaryrefslogtreecommitdiff
path: root/include/linux/mfd/axp20x.h
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2016-09-15 10:32:03 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 15:53:10 +0200
commit345b19bca4b1c336f61f17b9aa6a180d934b299f (patch)
treec1e66932a65d6f7f786a207bdf2d3034de7025c3 /include/linux/mfd/axp20x.h
parentba3f252e886e35989d18686ee589e9f57c3392df (diff)
mfd: axp20x: Provide interface for add-on drivers
Add-on drivers (e.g. hwmon) utilising a AXP20x, AXP22x or AXP80x need access to the regmap provided by the device, but no interface for retrieving the device/interface exists. This adds a new function axp20x_node_to_regmap(), modelled after the similar syscon_node_to_regmap(), to gain access to the regmap for a AXP-node with a fully loaded driver. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'include/linux/mfd/axp20x.h')
-rw-r--r--include/linux/mfd/axp20x.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index fec597fb34cb..2ecf8c0b13d1 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -11,6 +11,7 @@
#ifndef __LINUX_MFD_AXP20X_H
#define __LINUX_MFD_AXP20X_H
+#include <linux/list.h>
#include <linux/regmap.h>
enum {
@@ -524,6 +525,7 @@ struct axp20x_dev {
struct mfd_cell *cells;
const struct regmap_config *regmap_cfg;
const struct regmap_irq_chip *regmap_irq_chip;
+ struct list_head list;
};
#define BATTID_LEN 64
@@ -594,6 +596,17 @@ static inline int axp20x_read_variable_width(struct regmap *regmap,
int axp20x_match_device(struct axp20x_dev *axp20x);
/**
+ * axp20x_node_to_regmap(): Find the regmap for a axp20x device
+ *
+ * @np: node-pointer to the axp20x device
+ *
+ * This function lets add-on drivers (e.g. axp809-thermal) retrieve
+ * a registered axp20x device's regmap. The device must be fully
+ * configured or NULL will be returned.
+ */
+struct regmap *axp20x_node_to_regmap(struct device_node *np);
+
+/**
* axp20x_device_probe(): Probe a configured axp20x device
*
* @axp20x: axp20x device to probe (must be configured)