From patchwork Tue Sep 2 12:02:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 36457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 608942032B for ; Tue, 2 Sep 2014 12:02:57 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf39609062pde.2 for ; Tue, 02 Sep 2014 05:02:56 -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: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=+czYVXItdFprtR2sCkl5QDG3dyOqy8ECtML+LxP26P0=; b=l60JysDYEi0J+spVLhY0fijUqqu+yHoVJvJz+80BtWv/Ol7F4jzgrLKBSVzD2EpfIY qpon+BM2hx58PaduIIm3bjGWTt6cJrhzeY/dhqKxVlmW1bBT4RwRw3hllVfjH0OMqi6z VbEJVEoausSLIPmLR3A+cni8ad7Ke92rNkbdrmlFHdyHhCvIgO2i8RjDhn1BGtbtiEHy QNeQFJeWQ/gC144vWKoUg9HcbCWj5zQ+4gA34MXzF3+2tIBsgsrZhfg6TOa6FnjZZdXl qKwbMWQgkG2CFbdK01vYvmJpo/x/MqSQNSryHjwWoNLld96Q+kzYEEZ8X8Erh/Vv+O24 2Fkw== X-Gm-Message-State: ALoCoQmN/OiQbbJXEZs84y6oWaM5m4eyfVFU0Qfvas3hrEGOFHiRfxNYGgVBy/Wyc3RRVKC0UIU4 X-Received: by 10.69.29.234 with SMTP id jz10mr18838886pbd.1.1409659376655; Tue, 02 Sep 2014 05:02:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.148 with SMTP id 20ls2246994qgt.86.gmail; Tue, 02 Sep 2014 05:02:56 -0700 (PDT) X-Received: by 10.52.27.16 with SMTP id p16mr25360737vdg.14.1409659376544; Tue, 02 Sep 2014 05:02:56 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id w7si2158288vcs.17.2014.09.02.05.02.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 05:02:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so6754128vcb.41 for ; Tue, 02 Sep 2014 05:02:56 -0700 (PDT) X-Received: by 10.52.246.198 with SMTP id xy6mr25120402vdc.7.1409659376426; Tue, 02 Sep 2014 05:02:56 -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.221.45.67 with SMTP id uj3csp515830vcb; Tue, 2 Sep 2014 05:02:55 -0700 (PDT) X-Received: by 10.66.161.169 with SMTP id xt9mr47237092pab.102.1409659375448; Tue, 02 Sep 2014 05:02:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uf6si5844300pac.6.2014.09.02.05.02.55 for ; Tue, 02 Sep 2014 05:02:55 -0700 (PDT) Received-SPF: none (google.com: linux-leds-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 S1753225AbaIBMCy (ORCPT ); Tue, 2 Sep 2014 08:02:54 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:55225 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbaIBMCx (ORCPT ); Tue, 2 Sep 2014 08:02:53 -0400 Received: by mail-we0-f178.google.com with SMTP id u57so6766193wes.23 for ; Tue, 02 Sep 2014 05:02:52 -0700 (PDT) X-Received: by 10.194.202.231 with SMTP id kl7mr2001581wjc.134.1409659372754; Tue, 02 Sep 2014 05:02:52 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id hm5sm9125196wjb.2.2014.09.02.05.02.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 05:02:52 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org Cc: Arnd Bergmann , Pawel Moll , Mark Rutland , Marc Zyngier , Will Deacon , Rob Herring , Linus Walleij , Bryan Wu , Richard Purdie Subject: [PATCH 2/8 v2] leds: add device tree bindings for register bit LEDs Date: Tue, 2 Sep 2014 14:02:28 +0200 Message-Id: <1409659354-23553-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409659354-23553-1-git-send-email-linus.walleij@linaro.org> References: <1409659354-23553-1-git-send-email-linus.walleij@linaro.org> Sender: linux-leds-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-leds@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.220.182 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 adds the device tree bindings used by register bit LEDs. Cc: devicetree@vger.kernel.org Cc: Bryan Wu Cc: Richard Purdie Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rename binding "register-bit-led" - Define that such nodes appear only as children of syscon - Group required and optional parameters - Number nodes as foo@. - Update example --- .../devicetree/bindings/leds/register-bit-led.txt | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/register-bit-led.txt diff --git a/Documentation/devicetree/bindings/leds/register-bit-led.txt b/Documentation/devicetree/bindings/leds/register-bit-led.txt new file mode 100644 index 000000000000..379cefdc0bda --- /dev/null +++ b/Documentation/devicetree/bindings/leds/register-bit-led.txt @@ -0,0 +1,99 @@ +Device Tree Bindings for Register Bit LEDs + +Register bit leds are used with syscon multifunctional devices +where single bits in a certain register can turn on/off a +single LED. The register bit LEDs appear as children to the +syscon device, with the proper compatible string. For the +syscon bindings see: +Documentation/devicetree/bindings/mfd/syscon.txt + +Each LED is represented as a sub-node of the syscon device. Each +node's name represents the name of the corresponding LED. + +LED sub-node properties: + +Required properties: +- compatible : must be "register-bit-led" +- offset : register offset to the register controlling this LED +- mask : bit mask for the bit controlling this LED in the register + typically 0x01, 0x02, 0x04 ... + +Optional properties: +- label : (optional) + see Documentation/devicetree/bindings/leds/common.txt +- linux,default-trigger : (optional) + see Documentation/devicetree/bindings/leds/common.txt +- default-state: (optional) The initial state of the LED. Valid + values are "on", "off", and "keep". If the LED is already on or off + and the default-state property is set the to same value, then no + glitch should be produced where the LED momentarily turns off (or + on). The "keep" setting will keep the LED at whatever its current + state is, without producing a glitch. The default is off if this + property is not present. + +Example: + +syscon: syscon@10000000 { + compatible = "arm,realview-pb1176-syscon", "syscon"; + reg = <0x10000000 0x1000>; + + led@08.0 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x01>; + label = "versatile:0"; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + led@08.1 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x02>; + label = "versatile:1"; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + led@08.2 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x04>; + label = "versatile:2"; + linux,default-trigger = "cpu0"; + default-state = "off"; + }; + led@08.3 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x08>; + label = "versatile:3"; + default-state = "off"; + }; + led@08.4 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x10>; + label = "versatile:4"; + default-state = "off"; + }; + led@08.5 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x20>; + label = "versatile:5"; + default-state = "off"; + }; + led@08.6 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x40>; + label = "versatile:6"; + default-state = "off"; + }; + led@08.7 { + compatible = "register-bit-led"; + offset = <0x08>; + mask = <0x80>; + label = "versatile:7"; + default-state = "off"; + }; +};