From patchwork Fri Jul 25 13:23:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 34276 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 76D6523932 for ; Fri, 25 Jul 2014 13:24:18 +0000 (UTC) Received: by mail-oi0-f71.google.com with SMTP id e131sf16890616oig.6 for ; Fri, 25 Jul 2014 06:24:18 -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=Ri270jIOjunE88LC9Tr13NKTs+XSid5l6GRpTqNFzyE=; b=RN0QKYLy4fiT9qPQLB8C/H5m20eM0kEBU8Fdm2VQyuUiE30EaX1WLYswI/5EV4nNJN NoAWC3YEFjDsXCTom10/W1gXQ5h04FYUcI6Rq6LG1K9AFcsG3NwAdnw75j0oSdkL9zON MXevBKNhNR7nZG+0rEagYbyDmR0PWKrsPXbMJ5e3lw9gC8jZ9rawESsotr/iJFIHy0HA 4a80rNIDALFtpflj9/guDmO+oE5I3dyWfhGbYceFVAU/Kc83aq3X8ZCGbPpS0uOrQ2Qv nxvka9LZ/5F36hqIC7uDVVs+dIKPFP+jHkrg3Kpjgaqvol2ZbIIVsfT0l9dLl14knKkH tr7A== X-Gm-Message-State: ALoCoQlIl+W0AfuGE7LJ4m5pmFxfeRNpLAfr+KwzkOGVSaG4x1sXAPabY+rqdETmrDOT/dNjv/Ex X-Received: by 10.182.186.4 with SMTP id fg4mr8245654obc.9.1406294657983; Fri, 25 Jul 2014 06:24:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.203 with SMTP id 69ls1186587qgl.13.gmail; Fri, 25 Jul 2014 06:24:17 -0700 (PDT) X-Received: by 10.220.73.137 with SMTP id q9mr1730002vcj.64.1406294657883; Fri, 25 Jul 2014 06:24:17 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id o6si7348871vcn.83.2014.07.25.06.24.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 06:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so7239547vcb.29 for ; Fri, 25 Jul 2014 06:24:17 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr2141409vcb.48.1406294657789; Fri, 25 Jul 2014 06:24:17 -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.37.5 with SMTP id tc5csp37923vcb; Fri, 25 Jul 2014 06:24:17 -0700 (PDT) X-Received: by 10.66.150.169 with SMTP id uj9mr2480061pab.148.1406294656740; Fri, 25 Jul 2014 06:24:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl10si9218056pab.132.2014.07.25.06.24.16 for ; Fri, 25 Jul 2014 06:24:16 -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 S1752233AbaGYNYP (ORCPT + 7 others); Fri, 25 Jul 2014 09:24:15 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:40475 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbaGYNYP (ORCPT ); Fri, 25 Jul 2014 09:24:15 -0400 Received: by mail-wi0-f176.google.com with SMTP id bs8so985895wib.15 for ; Fri, 25 Jul 2014 06:24:14 -0700 (PDT) X-Received: by 10.195.11.132 with SMTP id ei4mr21916892wjd.95.1406294654051; Fri, 25 Jul 2014 06:24:14 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id wu6sm25249997wjb.46.2014.07.25.06.24.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jul 2014 06:24:13 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, devicetree@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/6] leds: add device tree bindings for syscon LEDs Date: Fri, 25 Jul 2014 15:23:44 +0200 Message-Id: <1406294628-16079-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406294628-16079-1-git-send-email-linus.walleij@linaro.org> References: <1406294628-16079-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.220.170 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 syscon-based LEDs. Cc: devicetree@vger.kernel.org Cc: Bryan Wu Cc: Richard Purdie Signed-off-by: Linus Walleij --- .../devicetree/bindings/leds/leds-syscon.txt | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-syscon.txt diff --git a/Documentation/devicetree/bindings/leds/leds-syscon.txt b/Documentation/devicetree/bindings/leds/leds-syscon.txt new file mode 100644 index 000000000000..460b9c3d1bd3 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-syscon.txt @@ -0,0 +1,83 @@ +Device Tree Bindings for Syscon LEDs + +Required properties: +- compatible : must be "syscon-leds". +- regmap : a phandle to a syscon node containing a regmap + +Each LED is represented as a sub-node of the syscon-leds device. Each +node's name represents the name of the corresponding LED. + +LED sub-node properties: +- 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 ... +- 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: + +leds: leds@08 { + compatible = "syscon-leds"; + regmap = <&syscon>; + + led@bit0 { + offset = <0x08>; + mask = <0x01>; + label = "versatile:0"; + linux,default-trigger = "heartbeat"; + default-state = "on"; + }; + led@bit1 { + offset = <0x08>; + mask = <0x02>; + label = "versatile:1"; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + led@bit2 { + offset = <0x08>; + mask = <0x04>; + label = "versatile:2"; + linux,default-trigger = "cpu0"; + default-state = "off"; + }; + led@bit3 { + offset = <0x08>; + mask = <0x08>; + label = "versatile:3"; + default-state = "off"; + }; + led@bit4 { + offset = <0x08>; + mask = <0x10>; + label = "versatile:4"; + default-state = "off"; + }; + led@bit5 { + offset = <0x08>; + mask = <0x20>; + label = "versatile:5"; + default-state = "off"; + }; + led@bit6 { + offset = <0x08>; + mask = <0x40>; + label = "versatile:6"; + default-state = "off"; + }; + led@bit7 { + offset = <0x08>; + mask = <0x80>; + label = "versatile:7"; + default-state = "off"; + }; +};