]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.1.13/mfd-of-document-mfd-devices-and-handle-simple-mfd.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.1.13 / mfd-of-document-mfd-devices-and-handle-simple-mfd.patch
CommitLineData
7773b1b7
GKH
1From 22869a9eca4ea5b534538d160b68c7aef44e378a Mon Sep 17 00:00:00 2001
2From: Linus Walleij <linus.walleij@linaro.org>
3Date: Tue, 3 Mar 2015 09:52:20 +0100
4Subject: MFD/OF: document MFD devices and handle simple-mfd
5
6From: Linus Walleij <linus.walleij@linaro.org>
7
8commit 22869a9eca4ea5b534538d160b68c7aef44e378a upstream.
9
10This defines a new compatible option for MFD devices "simple-mfd" that will
11make the OF core spawn child devices for all subnodes of that MFD device.
12It is optional but handy for things like syscon and possibly other
13simpler MFD devices.
14
15Since there was no file to put the documentation in, I took this opportunity
16to make a small writeup on MFD devices and add the compatible definition
17there.
18
19Suggested-by: Lee Jones <lee.jones@linaro.org>
20Acked-by: Lee Jones <lee.jones@linaro.org>
21Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
22Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
23Cc: Arnd Bergmann <arnd@arndb.de>
24Cc: Devicetree <devicetree@vger.kernel.org>
25Cc: Rob Herring <robh+dt@kernel.org>
26Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
27Cc: Grant Likely <grant.likely@linaro.org>
28Cc: Pawel Moll <pawel.moll@arm.com>
29Cc: Mark Rutland <mark.rutland@arm.com>
30Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
31Cc: Kumar Gala <galak@codeaurora.org>
32Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
33Cc: Henrik Juul Pedersen <hjp@liab.dk>
34Signed-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 */