From patchwork Thu Sep 9 21:31:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 508363 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp701631jai; Thu, 9 Sep 2021 14:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHInM9nM/X08Z7i6ST7yzbbgph7S6as8Y4ec3QgVTtSDvDHm4FuNwWnFKz5uN0U1Bgjf/1 X-Received: by 2002:a17:906:6717:: with SMTP id a23mr5451498ejp.358.1631223090150; Thu, 09 Sep 2021 14:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631223090; cv=none; d=google.com; s=arc-20160816; b=JPSX5vzio/1ltDwbjVIfQxsoixgmlX3ilTnRZ51A/cVjHypYNP5WiT82v3vsnyB7go sH5wF70c8dj/ef9Xga12OIU2s3nO00CnYVof78znQ0rETtlTwZpnc28xyrTOhAC9HXwa TXyFFTr+18Te0udWU7x6Btv7oYzFEaxF8QYG0EIHklhdOmG7XhtJcontvqc+E18he26D ocXdO6Y1Rze4f3DoINR0u5AhNpuVwd6H2Xl0I115LXgiw3Xc0e4hCJsNl0seIw4wuOpc XwojVtH3obmQ8+KolZRDxHTi+Jdju6v3pmKPR1Xeq/7KxUzDUm/ig/7AONfxsFancLBA 3Diw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/YrpsPCLlUobR5Vg4TFvLJZn3V31ghZUaEW+qKvudbE=; b=OfDUqwKj+waJ7UPxBD+835HdaV13BagY7T+eN9M++Bg6ST7DzPfFTwKd1j2OBbr0rv 5Rm6SzvUshZmfgdfOSfzNs7g//mr/rF9OXPpZp+BERhgZkYDmxoPS+VVTQK18AA8dAFs FZbvJ7Quliu8KKKmsrjuMOHAbGxj9R3rEv1jsufhxzBijfjiyrBhtUgcofCqPwMCvyRK 3/PiDpZpkV03tztwJLEf4CFktOH+mrV4klS81De9a6LsNnaGYOXRtmrGuiJHDwYiiP7u wZKQQkGJWllIQJl8Uzhf1GTR6PpkfbsrRUTuHLp5FluDJfgxy1A8b3gOCTkR/7aqQsET zvcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si3214255ejo.225.2021.09.09.14.31.30 for ; Thu, 09 Sep 2021 14:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347476AbhIIVch (ORCPT ); Thu, 9 Sep 2021 17:32:37 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:45019 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347151AbhIIVcd (ORCPT ); Thu, 9 Sep 2021 17:32:33 -0400 Received: by mail-oi1-f174.google.com with SMTP id c79so4429229oib.11; Thu, 09 Sep 2021 14:31:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/YrpsPCLlUobR5Vg4TFvLJZn3V31ghZUaEW+qKvudbE=; b=gKHefDGBECq0oxTBlr+7a+pMvrvh7Bcnv/t36e0tZEE547LLNDZc8hQuK+GPqs/Kj9 LrIxzt50DhjiowgIxBz2lvIvxvL7I8q1S1hGf3bZJIps4vTUPa5FMFGX+j6LMbBXxrIr kP85I61ypl0i9vsvU+9uKkaIbnS5x7uAY8eYmYoWFnB3VyC0wdVi7kdpFhnI+x5vRU7c GBeFDZG6JBdAjffDfIlG8je4XeA04p0BTNKFTMzIDO6L11aw3Nd/rmpoZFLfArS5JJF5 1rLhy2WEbjF6YxbustfUA+kSrglVHGw0SUiw7o9N9pYzVhjVEIU6YHTCc1ucZfX1kwej liKQ== X-Gm-Message-State: AOAM531K9LmeFCMpMAmcgw0LIOEBHC6zrGBzeoIWvJcF7UMFXFBO5GRe C/2taI284Gkh5rSKoQiW7w== X-Received: by 2002:aca:d68c:: with SMTP id n134mr1621875oig.34.1631223083178; Thu, 09 Sep 2021 14:31:23 -0700 (PDT) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id m24sm694929oie.50.2021.09.09.14.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 14:31:22 -0700 (PDT) From: Rob Herring To: Linus Walleij , Stephen Boyd , Pavel Machek Cc: Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH 2/8] dt-bindings: leds: register-bit-led: Use 'reg' instead of 'offset' Date: Thu, 9 Sep 2021 16:31:12 -0500 Message-Id: <20210909213118.1087083-3-robh@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909213118.1087083-1-robh@kernel.org> References: <20210909213118.1087083-1-robh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org 'reg' is the standard property for defining register banks/addresses. Add it to use for the register address and deprecate 'offset'. This also allows for using standard node names with unit-addresses. However, since it is quite possible to have multiple nodes at the same register address, allow for the unit-address to optionally have the bit offset. The unit-address format is '@[,]'. This matches the format recently added for nvmem binding which has the same issue. Cc: Pavel Machek Cc: Linus Walleij Cc: linux-leds@vger.kernel.org Signed-off-by: Rob Herring --- .../bindings/leds/register-bit-led.yaml | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) -- 2.30.2 diff --git a/Documentation/devicetree/bindings/leds/register-bit-led.yaml b/Documentation/devicetree/bindings/leds/register-bit-led.yaml index 4a5bb0aa5f27..404ac75e1dc4 100644 --- a/Documentation/devicetree/bindings/leds/register-bit-led.yaml +++ b/Documentation/devicetree/bindings/leds/register-bit-led.yaml @@ -20,9 +20,19 @@ allOf: - $ref: /schemas/leds/common.yaml# properties: + $nodename: + description: + The unit-address is in the form of @, + pattern: '^led@[0-9a-f]+,[0-9a-f]{1,2}$' + compatible: const: register-bit-led + reg: + description: + The register address and size + maxItems: 1 + mask: description: bit mask for the bit controlling this LED in the register @@ -37,11 +47,12 @@ properties: description: register offset to the register controlling this LED $ref: /schemas/types.yaml#/definitions/uint32 + deprecated: true required: - compatible - mask - - offset + - reg unevaluatedProperties: false @@ -51,25 +62,31 @@ examples: syscon@10000000 { compatible = "arm,realview-pb1176-syscon", "syscon"; reg = <0x10000000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x10000000 0x1000>; - led@8.0 { + led@8,0 { compatible = "register-bit-led"; + reg = <0x08 0x04>; offset = <0x08>; mask = <0x01>; label = "versatile:0"; linux,default-trigger = "heartbeat"; default-state = "on"; }; - led@8.1 { + led@8,1 { compatible = "register-bit-led"; + reg = <0x08 0x04>; offset = <0x08>; mask = <0x02>; label = "versatile:1"; linux,default-trigger = "mmc0"; default-state = "off"; }; - led@8.2 { + led@8,2 { compatible = "register-bit-led"; + reg = <0x08 0x04>; offset = <0x08>; mask = <0x04>; label = "versatile:2";