diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-06-27 05:37:19 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-07 08:22:06 -0400 |
commit | aa613de676986f136fa6f48a4d709b5d264f4f38 (patch) | |
tree | 814591b0c068e5942b70d4fc8c85aff89169db4d /include/linux | |
parent | 53b14ea336ca45f34821ad78a1b45c2315283621 (diff) |
[ARM] 5127/1: Core MFD support
This patch provides a common subdevice registration system for MFD type
chips, using platfrom device.
Signed-off-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mfd/core.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h new file mode 100644 index 000000000000..bb3dd0545928 --- /dev/null +++ b/include/linux/mfd/core.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef MFD_CORE_H | ||
2 | #define MFD_CORE_H | ||
3 | /* | ||
4 | * drivers/mfd/mfd-core.h | ||
5 | * | ||
6 | * core MFD support | ||
7 | * Copyright (c) 2006 Ian Molton | ||
8 | * Copyright (c) 2007 Dmitry Baryshkov | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | /* | ||
19 | * This struct describes the MFD part ("cell"). | ||
20 | * After registration the copy of this structure will become the platform data | ||
21 | * of the resulting platform_device | ||
22 | */ | ||
23 | struct mfd_cell { | ||
24 | const char *name; | ||
25 | |||
26 | int (*enable)(struct platform_device *dev); | ||
27 | int (*disable)(struct platform_device *dev); | ||
28 | int (*suspend)(struct platform_device *dev); | ||
29 | int (*resume)(struct platform_device *dev); | ||
30 | |||
31 | void *driver_data; /* driver-specific data */ | ||
32 | |||
33 | /* | ||
34 | * This resources can be specified relatievly to the parent device. | ||
35 | * For accessing device you should use resources from device | ||
36 | */ | ||
37 | int num_resources; | ||
38 | const struct resource *resources; | ||
39 | }; | ||
40 | |||
41 | static inline struct mfd_cell * | ||
42 | 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( | ||
48 | struct platform_device *parent, | ||
49 | const struct mfd_cell *cells, int n_devs, | ||
50 | struct resource *mem_base, | ||
51 | int irq_base); | ||
52 | |||
53 | extern void mfd_remove_devices(struct platform_device *parent); | ||
54 | |||
55 | #endif | ||