mfd: Coding style fixes
[safe/jmp/linux-2.6] / include / linux / mfd / core.h
1 /*
2  * drivers/mfd/mfd-core.h
3  *
4  * core MFD support
5  * Copyright (c) 2006 Ian Molton
6  * Copyright (c) 2007 Dmitry Baryshkov
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  */
13
14 #ifndef MFD_CORE_H
15 #define MFD_CORE_H
16
17 #include <linux/platform_device.h>
18
19 /*
20  * This struct describes the MFD part ("cell").
21  * After registration the copy of this structure will become the platform data
22  * of the resulting platform_device
23  */
24 struct mfd_cell {
25         const char              *name;
26
27         int                     (*enable)(struct platform_device *dev);
28         int                     (*disable)(struct platform_device *dev);
29         int                     (*suspend)(struct platform_device *dev);
30         int                     (*resume)(struct platform_device *dev);
31
32         void                    *driver_data; /* driver-specific data */
33
34         /*
35          * This resources can be specified relatievly to the parent device.
36          * For accessing device you should use resources from device
37          */
38         int                     num_resources;
39         const struct resource   *resources;
40 };
41
42 static inline struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
43 {
44         return (struct mfd_cell *)pdev->dev.platform_data;
45 }
46
47 extern int mfd_add_devices(struct platform_device *parent,
48                            const struct mfd_cell *cells, int n_devs,
49                            struct resource *mem_base,
50                            int irq_base);
51
52 extern void mfd_remove_devices(struct platform_device *parent);
53
54 #endif