aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mfd/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/core.h')
-rw-r--r--include/linux/mfd/core.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 71cd1f983cc..22a2f5ebd9d 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -25,8 +25,11 @@ struct mfd_cell {
const char *name;
int id;
+ /* refcounting for multiple drivers to use a single cell */
+ atomic_t *usage_count;
int (*enable)(struct platform_device *dev);
int (*disable)(struct platform_device *dev);
+
int (*suspend)(struct platform_device *dev);
int (*resume)(struct platform_device *dev);
@@ -51,6 +54,15 @@ struct mfd_cell {
};
/*
+ * Convenience functions for clients using shared cells. Refcounting
+ * happens automatically, with the cell's enable/disable callbacks
+ * being called only when a device is first being enabled or no other
+ * clients are making use of it.
+ */
+extern int mfd_shared_cell_enable(struct platform_device *pdev);
+extern int mfd_shared_cell_disable(struct platform_device *pdev);
+
+/*
* Given a platform device that's been created by mfd_add_devices(), fetch
* the mfd_cell that created it.
*/
@@ -69,7 +81,7 @@ static inline void *mfd_get_data(struct platform_device *pdev)
}
extern int mfd_add_devices(struct device *parent, int id,
- const struct mfd_cell *cells, int n_devs,
+ struct mfd_cell *cells, int n_devs,
struct resource *mem_base,
int irq_base);