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: 45338 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E84792149C for ; Tue, 3 Mar 2015 09:32:58 +0000 (UTC) Received: by wesw55 with SMTP id w55sf27910022wes.0 for ; Tue, 03 Mar 2015 01:32:58 -0800 (PST) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=jCnkREIVGfiJtFUNQJa9/VetDVpSFn6WrpsTOhVYJtw=; b=i+YtZevv0aUfEnaYkACPUHOjjheufBbOzfbZ28kW09nuHJBmL1biCW6X8+qCxKucLR TQ+9X0NwscJWJ1XM2MJVHE29JKU1CXMK2OyWtwEngsY8t5IJDatI0PReyan7O58omSL9 4Fk6kipXm5Sz+ajvogk71nRvryOq4uEzOOezGLKBFkAwhRWBN5na780RXUxzegGpS8Fq Q6kYQqWoQYqzcvsatDPT+mWF4yb/prNnDwRpXbQEdl+hUJpKof1/ii6A4aSbeX4Vp7Iz s5em3aQqWNaOPspUYog4RkRN5Va0sigy9H1IJxA20QlcgLicROsJIB7B5wA8uObv9c8m EgxA== X-Gm-Message-State: ALoCoQnJo5M3iV5ryj5RJA9XSK2XDVFBiahiiL2n6iUrwp3MD7QCawr6O866lrfbFuwJT1RUvZqu X-Received: by 10.112.130.70 with SMTP id oc6mr4491101lbb.13.1425375177850; Tue, 03 Mar 2015 01:32:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.6 with SMTP id v6ls15019laa.13.gmail; Tue, 03 Mar 2015 01:32:57 -0800 (PST) X-Received: by 10.152.2.227 with SMTP id 3mr27442382lax.85.1425375177698; Tue, 03 Mar 2015 01:32:57 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id p5si169241lap.49.2015.03.03.01.32.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 01:32:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labgf13 with SMTP id gf13so11548422lab.5 for ; Tue, 03 Mar 2015 01:32:57 -0800 (PST) X-Received: by 10.152.43.51 with SMTP id t19mr27774005lal.73.1425375177580; Tue, 03 Mar 2015 01:32:57 -0800 (PST) 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 h5csp445285lbj; Tue, 3 Mar 2015 01:32:56 -0800 (PST) X-Received: by 10.68.110.132 with SMTP id ia4mr54127301pbb.95.1425375175740; Tue, 03 Mar 2015 01:32:55 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id en9si322554pac.90.2015.03.03.01.32.54; Tue, 03 Mar 2015 01:32:55 -0800 (PST) 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 S1754800AbbCCJcv (ORCPT + 5 others); Tue, 3 Mar 2015 04:32:51 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:35786 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754491AbbCCJcr (ORCPT ); Tue, 3 Mar 2015 04:32:47 -0500 Received: by lbjf15 with SMTP id f15so7866708lbj.2 for ; Tue, 03 Mar 2015 01:32:46 -0800 (PST) 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 Cc: Catalin Marinas , Will Deacon , Richard Purdie , Linus Walleij , Devicetree , Rob Herring , Benjamin Herrenschmidt , Grant Likely , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala 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> 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.44 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: 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 */