From patchwork Tue Mar 17 10:35:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 45878 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 52B3D21547 for ; Tue, 17 Mar 2015 10:35:42 +0000 (UTC) Received: by wesu56 with SMTP id u56sf1016621wes.2 for ; Tue, 17 Mar 2015 03:35:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bvuXih/8TYgAqI3sAEKKxKG+DM1jkJmSEv4iFmAMzC4=; b=U6eqlHsP3tNilP87f2kiPBx0XqoixYQPwzRSq0aWE2T91Gbknfn7bVIgpvmJMt767W IThT4FV8tPVNhU8HHA3v99WHToIngjCtWxVvzAurJZOdudk7pBlA2a+jN4y9l7I3GHy3 4NsLTibru7I6BTrzGkLNvE2M6FlXob438DASDU9ksPWG73PkjzuZOs46MHAFuyoHvK8r v9y4IMgaGjPZhFysoDwt7wS4mU3NLIlGZhVfud85LZD3QbuCdAgi+EyHI/R68TFPrvNx /R+/EA67F7h5VfPPptMWo6D2YQixbz3ix8DhUFatvQUsR8E6GhJQXR/dvtL3aNdjc4Jp DAnA== X-Gm-Message-State: ALoCoQmy35Yf61Aoa6UYtn2XSiYBxoGQZhEjb4r6P26+BxSOtBL5L+rwSUVZYFGCLYElXfPl9a9T X-Received: by 10.152.21.9 with SMTP id r9mr9938657lae.0.1426588541608; Tue, 17 Mar 2015 03:35:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.226 with SMTP id t2ls20762laj.42.gmail; Tue, 17 Mar 2015 03:35:41 -0700 (PDT) X-Received: by 10.152.27.39 with SMTP id q7mr57720685lag.49.1426588541373; Tue, 17 Mar 2015 03:35:41 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id l6si10205122lab.70.2015.03.17.03.35.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 03:35:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by labjg1 with SMTP id jg1so4581483lab.2 for ; Tue, 17 Mar 2015 03:35:41 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr58430674lal.73.1426588540935; Tue, 17 Mar 2015 03:35:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp413463lbj; Tue, 17 Mar 2015 03:35:40 -0700 (PDT) X-Received: by 10.70.118.134 with SMTP id km6mr144156270pdb.162.1426588539125; Tue, 17 Mar 2015 03:35:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si28509058pds.66.2015.03.17.03.35.38; Tue, 17 Mar 2015 03:35:39 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238AbbCQKff (ORCPT + 5 others); Tue, 17 Mar 2015 06:35:35 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:35631 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbbCQKfa (ORCPT ); Tue, 17 Mar 2015 06:35:30 -0400 Received: by labjg1 with SMTP id jg1so4577332lab.2 for ; Tue, 17 Mar 2015 03:35:28 -0700 (PDT) X-Received: by 10.152.120.8 with SMTP id ky8mr57088269lab.118.1426588527978; Tue, 17 Mar 2015 03:35:27 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id la5sm2725156lac.0.2015.03.17.03.35.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 03:35:25 -0700 (PDT) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Cc: Linus Walleij , Arnd Bergmann , Devicetree , Rob Herring , Benjamin Herrenschmidt , Grant Likely , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala Subject: [PATCH 1/5 v2] MFD/OF: document MFD devices and handle simple-mfd Date: Tue, 17 Mar 2015 11:35:10 +0100 Message-Id: <1426588510-9940-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: Lee Jones --- ChangeLog v1->v2: - Fix spelling, terminology. 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 | 41 +++++++++++++++++++++++++++ drivers/of/platform.c | 1 + 2 files changed, 42 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..af9d6931a1a2 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mfd.txt @@ -0,0 +1,41 @@ +Multi-Function Devices (MFD) + +These devices comprise a nexus for heterogeneous hardware blocks containing +more than one non-unique yet varying hardware functionality. + +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 hardware devices. + +Optional properties: + +- compatible : "simple-mfd" - this signifies that the operating system should + consider all subnodes of the MFD device as separate devices akin to how + "simple-bus" inidicates when to see subnodes as children for a simple + memory-mapped bus. For more complex devices, when the nexus driver has to + probe registers to figure out what child devices exist etc, this should not + be used. In the latter case the child devices will be determined by the + operating system. + +Example: + +foo@1000 { + compatible = "syscon", "simple-mfd"; + reg = <0x01000 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 */