]>
Commit | Line | Data |
---|---|---|
7773b1b7 GKH |
1 | From 22869a9eca4ea5b534538d160b68c7aef44e378a Mon Sep 17 00:00:00 2001 |
2 | From: Linus Walleij <linus.walleij@linaro.org> | |
3 | Date: Tue, 3 Mar 2015 09:52:20 +0100 | |
4 | Subject: MFD/OF: document MFD devices and handle simple-mfd | |
5 | ||
6 | From: Linus Walleij <linus.walleij@linaro.org> | |
7 | ||
8 | commit 22869a9eca4ea5b534538d160b68c7aef44e378a upstream. | |
9 | ||
10 | This defines a new compatible option for MFD devices "simple-mfd" that will | |
11 | make the OF core spawn child devices for all subnodes of that MFD device. | |
12 | It is optional but handy for things like syscon and possibly other | |
13 | simpler MFD devices. | |
14 | ||
15 | Since there was no file to put the documentation in, I took this opportunity | |
16 | to make a small writeup on MFD devices and add the compatible definition | |
17 | there. | |
18 | ||
19 | Suggested-by: Lee Jones <lee.jones@linaro.org> | |
20 | Acked-by: Lee Jones <lee.jones@linaro.org> | |
21 | Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> | |
22 | Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> | |
23 | Cc: Arnd Bergmann <arnd@arndb.de> | |
24 | Cc: Devicetree <devicetree@vger.kernel.org> | |
25 | Cc: Rob Herring <robh+dt@kernel.org> | |
26 | Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> | |
27 | Cc: Grant Likely <grant.likely@linaro.org> | |
28 | Cc: Pawel Moll <pawel.moll@arm.com> | |
29 | Cc: Mark Rutland <mark.rutland@arm.com> | |
30 | Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> | |
31 | Cc: Kumar Gala <galak@codeaurora.org> | |
32 | Signed-off-by: Linus Walleij <linus.walleij@linaro.org> | |
33 | Cc: Henrik Juul Pedersen <hjp@liab.dk> | |
34 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
35 | ||
36 | --- | |
37 | Documentation/devicetree/bindings/mfd/mfd.txt | 41 ++++++++++++++++++++++++++ | |
38 | drivers/of/platform.c | 1 | |
39 | 2 files changed, 42 insertions(+) | |
40 | ||
41 | --- /dev/null | |
42 | +++ b/Documentation/devicetree/bindings/mfd/mfd.txt | |
43 | @@ -0,0 +1,41 @@ | |
44 | +Multi-Function Devices (MFD) | |
45 | + | |
46 | +These devices comprise a nexus for heterogeneous hardware blocks containing | |
47 | +more than one non-unique yet varying hardware functionality. | |
48 | + | |
49 | +A typical MFD can be: | |
50 | + | |
51 | +- A mixed signal ASIC on an external bus, sometimes a PMIC (Power Management | |
52 | + Integrated Circuit) that is manufactured in a lower technology node (rough | |
53 | + silicon) that handles analog drivers for things like audio amplifiers, LED | |
54 | + drivers, level shifters, PHY (physical interfaces to things like USB or | |
55 | + ethernet), regulators etc. | |
56 | + | |
57 | +- A range of memory registers containing "miscellaneous system registers" also | |
58 | + known as a system controller "syscon" or any other memory range containing a | |
59 | + mix of unrelated hardware devices. | |
60 | + | |
61 | +Optional properties: | |
62 | + | |
63 | +- compatible : "simple-mfd" - this signifies that the operating system should | |
64 | + consider all subnodes of the MFD device as separate devices akin to how | |
65 | + "simple-bus" inidicates when to see subnodes as children for a simple | |
66 | + memory-mapped bus. For more complex devices, when the nexus driver has to | |
67 | + probe registers to figure out what child devices exist etc, this should not | |
68 | + be used. In the latter case the child devices will be determined by the | |
69 | + operating system. | |
70 | + | |
71 | +Example: | |
72 | + | |
73 | +foo@1000 { | |
74 | + compatible = "syscon", "simple-mfd"; | |
75 | + reg = <0x01000 0x1000>; | |
76 | + | |
77 | + led@08.0 { | |
78 | + compatible = "register-bit-led"; | |
79 | + offset = <0x08>; | |
80 | + mask = <0x01>; | |
81 | + label = "myled"; | |
82 | + default-state = "on"; | |
83 | + }; | |
84 | +}; | |
85 | --- a/drivers/of/platform.c | |
86 | +++ b/drivers/of/platform.c | |
87 | @@ -25,6 +25,7 @@ | |
88 | ||
89 | const struct of_device_id of_default_bus_match_table[] = { | |
90 | { .compatible = "simple-bus", }, | |
91 | + { .compatible = "simple-mfd", }, | |
92 | #ifdef CONFIG_ARM_AMBA | |
93 | { .compatible = "arm,amba-bus", }, | |
94 | #endif /* CONFIG_ARM_AMBA */ |