diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mfd/core.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 71cd1f983cce..22a2f5ebd9db 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
| @@ -25,8 +25,11 @@ struct mfd_cell { | |||
| 25 | const char *name; | 25 | const char *name; |
| 26 | int id; | 26 | int id; |
| 27 | 27 | ||
| 28 | /* refcounting for multiple drivers to use a single cell */ | ||
| 29 | atomic_t *usage_count; | ||
| 28 | int (*enable)(struct platform_device *dev); | 30 | int (*enable)(struct platform_device *dev); |
| 29 | int (*disable)(struct platform_device *dev); | 31 | int (*disable)(struct platform_device *dev); |
| 32 | |||
| 30 | int (*suspend)(struct platform_device *dev); | 33 | int (*suspend)(struct platform_device *dev); |
| 31 | int (*resume)(struct platform_device *dev); | 34 | int (*resume)(struct platform_device *dev); |
| 32 | 35 | ||
| @@ -51,6 +54,15 @@ struct mfd_cell { | |||
| 51 | }; | 54 | }; |
| 52 | 55 | ||
| 53 | /* | 56 | /* |
| 57 | * Convenience functions for clients using shared cells. Refcounting | ||
| 58 | * happens automatically, with the cell's enable/disable callbacks | ||
| 59 | * being called only when a device is first being enabled or no other | ||
| 60 | * clients are making use of it. | ||
| 61 | */ | ||
| 62 | extern int mfd_shared_cell_enable(struct platform_device *pdev); | ||
| 63 | extern int mfd_shared_cell_disable(struct platform_device *pdev); | ||
| 64 | |||
| 65 | /* | ||
| 54 | * Given a platform device that's been created by mfd_add_devices(), fetch | 66 | * Given a platform device that's been created by mfd_add_devices(), fetch |
| 55 | * the mfd_cell that created it. | 67 | * the mfd_cell that created it. |
| 56 | */ | 68 | */ |
| @@ -69,7 +81,7 @@ static inline void *mfd_get_data(struct platform_device *pdev) | |||
| 69 | } | 81 | } |
| 70 | 82 | ||
| 71 | extern int mfd_add_devices(struct device *parent, int id, | 83 | extern int mfd_add_devices(struct device *parent, int id, |
| 72 | const struct mfd_cell *cells, int n_devs, | 84 | struct mfd_cell *cells, int n_devs, |
| 73 | struct resource *mem_base, | 85 | struct resource *mem_base, |
| 74 | int irq_base); | 86 | int irq_base); |
| 75 | 87 | ||
