From patchwork Tue Mar 3 09:32:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 5920831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7806F9F373 for ; Tue, 3 Mar 2015 09:36:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86C242026C for ; Tue, 3 Mar 2015 09:36:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D3202028D for ; Tue, 3 Mar 2015 09:35:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSjCf-0003ZR-U6; Tue, 03 Mar 2015 09:33:25 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSjCO-0002kK-8g for linux-arm-kernel@lists.infradead.org; Tue, 03 Mar 2015 09:33:10 +0000 Received: by labgd6 with SMTP id gd6so36150907lab.8 for ; Tue, 03 Mar 2015 01:32:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cDCPl35emzo7g+SO7UgSvrkwh75NTHtpcDNUJMVQzZA=; b=WmvLcveNMOnXeJC+fOdbYXd6zN5LSDZMgzkk/qUEulRmuDisRw3NHbSLcpeFbi0fsF dl0dCJ32+h5/F4iUHKqXO1vSgbjOBq/nXYT4bJa6pmipBKt80Ra5wztfroew88PTABMm 3nvbEU7zjPIuJbIuOJOf33cYGzm9pv2kCoLI1srXEkS1fDrtxcD5j2Haac4zF7R++kTu NuzgEc0n3UPqxhkBCEPPiwc3uEjgs+YzLNISu6cI8yY7rLdk9rh561gnVNce6uxUaqlt T5OtFNqfaJeTihcMoiH67KL08Gb6dw7oVMZgmW3ILpiElPj65VWjIH7VESMtwD+VwRFs 9DqQ== X-Gm-Message-State: ALoCoQnni9VphwUnFny7UAacr6aQF0jty4d5t6Qum9WEp7/219IT56xgkwdTXD8Ubm7GiWYNktFY X-Received: by 10.112.173.133 with SMTP id bk5mr27888809lbc.94.1425375166005; Tue, 03 Mar 2015 01:32:46 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id n12sm54546lbg.31.2015.03.03.01.32.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 01:32:44 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Lee Jones , Bryan Wu Subject: [PATCH 1/5] MFD/OF: document MFD devices and handle simple-mfd Date: Tue, 3 Mar 2015 10:32:24 +0100 Message-Id: <1425375148-4369-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1425375148-4369-1-git-send-email-linus.walleij@linaro.org> References: <1425375148-4369-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150303_013308_557440_796D8257 X-CRM114-Status: GOOD ( 19.37 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Devicetree , Pawel Moll , Ian Campbell , Catalin Marinas , Linus Walleij , Kumar Gala , Will Deacon , Rob Herring , Richard Purdie , Benjamin Herrenschmidt , Grant Likely X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This defines a new compatible option for MFD devices "simple-mfd" that will make the OF core spawn child devices for all subnodes of that MFD device. It is optional but handy for things like syscon and possibly other simpler MFD devices. Since there was no file to put the documentation in, I took this opportunity to make a small writeup on MFD devices and add the compatible definition there. Suggested-by: Lee Jones Cc: Arnd Bergmann Cc: Devicetree Cc: Rob Herring Cc: Benjamin Herrenschmidt Cc: Grant Likely Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala Signed-off-by: Linus Walleij Acked-by: Alexandre Belloni Acked-by: Antoine Tenart Acked-by: Grant Likely --- I make the patch to the OF core in this one, it makes much more sense since it's a oneliner Lee: this is a (tested!) implementation of your suggestion for simple-mfd. If you can eventually ACK this from the MFD side, I think it should be funneled through the ARM SoC tree. Grant/Rob: if either of you can ACK the change to the OF core likewise it can be taken through ARM SoC. DT binings maintainers: there is some background discussion on this here: http://marc.info/?l=linux-arm-kernel&m=142486676603889&w=2 http://marc.info/?l=devicetree&m=142166313621469&w=2 --- Documentation/devicetree/bindings/mfd/mfd.txt | 40 +++++++++++++++++++++++++++ drivers/of/platform.c | 1 + 2 files changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/mfd.txt diff --git a/Documentation/devicetree/bindings/mfd/mfd.txt b/Documentation/devicetree/bindings/mfd/mfd.txt new file mode 100644 index 000000000000..cc057438abe8 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mfd.txt @@ -0,0 +1,40 @@ +Multi-Function Devices (MFD) + +These devices comprise a nexus for heterogeneous hardware blocks spawning +multiple child devices. + +A typical MFD can be: + +- A mixed signal ASIC on an external bus, sometimes a PMIC (power management + integrated circuit) that is manufactured in a lower technology node (rough + silicon) that handles analog drivers for things like audio amplifiers, LED + drivers, level shifters, PHY (physical interfaces to things like USB or + ethernet), regulators etc. + +- A range of memory registers containing "miscellaneous system registers" also + known as a system controller "syscon" or any other memory range containing a + mix of unrelated registers. + +Optional properties: + +- compatible : "simple-mfd" - this signifies that the operating system should + spawn child devices for all the subnodes of the MFD device akin to how + "simple-bus" inidicates when to spawn children for a simple memory-mapped + bus. For more complex devices, when the nexus driver has to probe registers + to figure out what children exist etc, this should not be used. In the latter + case the child devices will be instantiated by the operating system. + +Example: + +foo@1000 { + compatible = "syscon", "simple-mfd"; + reg = <0x010000 0x1000>; + + led@08.0 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x01>; + label = "myled"; + default-state = "on"; + }; +}; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b189733a1539..969ba4e1460c 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -26,6 +26,7 @@ const struct of_device_id of_default_bus_match_table[] = { { .compatible = "simple-bus", }, + { .compatible = "simple-mfd", }, #ifdef CONFIG_ARM_AMBA { .compatible = "arm,amba-bus", }, #endif /* CONFIG_ARM_AMBA */