Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3915rwe; Thu, 25 Aug 2022 22:34:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR60vD+YIwK1fwS0PCqU08cXA0y9f4JmFZlikgbE7T8VGxU9Vyupq4LhMRVkzktgLIdocjDM X-Received: by 2002:a05:6402:190d:b0:447:ed22:4d0d with SMTP id e13-20020a056402190d00b00447ed224d0dmr913773edz.309.1661492063665; Thu, 25 Aug 2022 22:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661492063; cv=none; d=google.com; s=arc-20160816; b=S8WmvzXYIuaUuQk5JTgS2sIQr9oDTJeZ4gawjO6DfS+OKY/vV5TeZn37TmUY8q3AzX hGlMRLccc419IUoq6K59nNUs9RyyOuzwIe5DcgXpLbJr1mCkzLSU7DcO1422cQiGURlR oNoauU7tssjPiB10QD0u1RKBMunu6JiYOh/TLtckFmhnisl7DHEJdwfY9b+mbi94p/cv Q0GE7PoZi/etST+b+GMPR0Bo+LVqErNem/HQVhUt/H3GfI8+cAthuaOTKVU5NkieJ+QS DaFQ85Mertb72fbZCe1ov2AtFLsYwYp1l6ekuhJoo2cHzgObfgnZtFN+/R93L3T46xtH qaDw== 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 :feedback-id:dkim-signature:dkim-signature; bh=oNsKIBnP4pH21MShmb+wvAzIKceTs6879kzHAIGHhUI=; b=JiWMA1GQO4BLOTDKjsdUFDH8v6qLBClfJ/BI2recMuRuok6XToIWarB/puHnYlOy4C S2IbQo2eWwQaCDAXygJNAbBCLehpSLDdY0QLIrRItG9SG4WW02eKNVO+/+rKtf1Trm9L rMPrLjr4sv2tc/8jJTOWDE/8vdkRkzNYZNrc2OZYkcn1u6oAOCc4a4OM4yqnrlaHzC/j jzJ0QmC4bWugoUFkhISM8ldekOTWLt7fQIqqpoCZRXPLAba7gE6t51ucCONzacEyGqTU jTWzSXfd2juKrHgO1dM3zDmiISgUSWAjW3CK7tDsb+X9OxLOHFNaLN+UsrarIDSVBFon cl5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b="LOWt1z/J"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=1TAERF+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020a50c407000000b0043cf66ca11fsi871624edf.76.2022.08.25.22.33.58; Thu, 25 Aug 2022 22:34:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b="LOWt1z/J"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=1TAERF+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236557AbiHZFJx (ORCPT + 99 others); Fri, 26 Aug 2022 01:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbiHZFJv (ORCPT ); Fri, 26 Aug 2022 01:09:51 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE9DB60FC; Thu, 25 Aug 2022 22:09:49 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 14E6E3200A9B; Fri, 26 Aug 2022 01:09:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 26 Aug 2022 01:09:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1661490587; x=1661576987; bh=oN sKIBnP4pH21MShmb+wvAzIKceTs6879kzHAIGHhUI=; b=LOWt1z/JU+J9CyAcx7 0J5uUPcsf8WLkIUaj576iRmgN/aof3h3YPQ3s7zjR3WQ8+PPO430J5Q27vE/dZuQ H2zlIeSL0ytQjFVp6HfIASyvIkORgdgakoF46+aR2qSJepiARh+pNEUSAj8cNq+R et37AoD5aiiiTlsP+bYWtjWJhOlWINEadBS+4HzcL9c3fgDxYJJH0bVd06ZKqgcJ spjIBBx4Vl3qpnHpFaAsQZBtRtVndYW1g03FuPy4nVtINVzJ4AMqG83wFxtjvry1 JIXElFfPl8ZGIzthNMBxqBafYgpIrP1aR/pWMeOJI9RyiOdatH6iAKniXe6hA/YM HWKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1661490587; x=1661576987; bh=oNsKIBnP4pH21 MShmb+wvAzIKceTs6879kzHAIGHhUI=; b=1TAERF+FtVPR8f478FEQLPYgyjscI wTm79ETOW3sCXSiM903JCNk9L358uAYfJplN3pA/M1JtBrsTtJwVbRJPsaR1DuJx 6f/c+Tfb27kayEnqBfSGiWm6FwPnkpk2qeGOHI64xm1ldVZb6fdtHO/o8tnQJv4i JeuyicF0ClFIw1Zvp7XveLL1pnh1v8mrOQ4lRc2qkNeK8gJoe1GClInyzvLqfIFJ JtB5Xc7e/UBPNxYnyyQGMbEmV+bTBY87kdZuoDKKvfF8uxnL7fcafv2sQbsyD5NF /RfFQdfUuMj6maZXm4LmHqIHMNDCG+8FbdwLRZ/xIGdELCSbPJeEoY1LA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejgedgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepgffhvefhgfehjeehgfekheeuffegheffjeegheeuudeufeffhffh ueeihfeufffhnecuffhomhgrihhnpeguvghvihgtvghtrhgvvgdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhh ohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 Aug 2022 01:09:46 -0400 (EDT) From: Samuel Holland To: Pavel Machek , Chen-Yu Tsai , Jernej Skrabec , linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Rob Herring , Samuel Holland , Maxime Ripard , Rob Herring Subject: [PATCH v5 1/6] dt-bindings: leds: Add Allwinner A100 LED controller Date: Fri, 26 Aug 2022 00:09:37 -0500 Message-Id: <20220826050942.20067-2-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220826050942.20067-1-samuel@sholland.org> References: <20220826050942.20067-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Allwinner A100, R329, and D1 SoCs contain an LED controller designed to drive a series of RGB LED pixels. It supports PIO and DMA transfers, and has configurable timing and pixel format. All three implementations appear to be identical, so use the oldest as the fallback compatible. Acked-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Samuel Holland --- Changes in v5: - A100 contains the original implementation, so use that as the base compatible string, and rename the binding to match - Add "unevaluatedProperties: false" to the child multi-led binding Changes in v4: - Use "default" instead of "maxItems" for timing properties Changes in v3: - Removed quotes from enumeration values - Added vendor prefix to timing/format properties - Renamed "format" property to "pixel-format" for clarity - Dropped "vled-supply" as it is unrelated to the controller hardware Changes in v2: - Fixed typo leading to duplicate t1h-ns property - Removed "items" layer in definition of dmas/dma-names - Replaced uint32 type reference with maxItems in timing properties .../leds/allwinner,sun50i-a100-ledc.yaml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml diff --git a/Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml b/Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml new file mode 100644 index 000000000000..fc8ecf6f91e6 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/allwinner,sun50i-a100-ledc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner A100 LED Controller Bindings + +maintainers: + - Samuel Holland + +description: + The LED controller found in Allwinner sunxi SoCs uses a one-wire serial + interface to drive up to 1024 RGB LEDs. + +properties: + compatible: + oneOf: + - const: allwinner,sun50i-a100-ledc + - items: + - enum: + - allwinner,sun20i-d1-ledc + - allwinner,sun50i-r329-ledc + - const: allwinner,sun50i-a100-ledc + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Bus clock + - description: Module clock + + clock-names: + items: + - const: bus + - const: mod + + resets: + maxItems: 1 + + dmas: + maxItems: 1 + description: TX DMA channel + + dma-names: + const: tx + + allwinner,pixel-format: + description: Pixel format (subpixel transmission order), default is "grb" + enum: + - bgr + - brg + - gbr + - grb + - rbg + - rgb + + allwinner,t0h-ns: + default: 336 + description: Length of high pulse when transmitting a "0" bit + + allwinner,t0l-ns: + default: 840 + description: Length of low pulse when transmitting a "0" bit + + allwinner,t1h-ns: + default: 882 + description: Length of high pulse when transmitting a "1" bit + + allwinner,t1l-ns: + default: 294 + description: Length of low pulse when transmitting a "1" bit + + allwinner,treset-ns: + default: 300000 + description: Minimum delay between transmission frames + +patternProperties: + "^multi-led@[0-9a-f]+$": + type: object + $ref: leds-class-multicolor.yaml# + unevaluatedProperties: false + properties: + reg: + minimum: 0 + maximum: 1023 + description: Index of the LED in the series (must be contiguous) + + required: + - reg + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + - dmas + - dma-names + +additionalProperties: false + +examples: + - | + #include + #include + + ledc: led-controller@2008000 { + compatible = "allwinner,sun20i-d1-ledc", + "allwinner,sun50i-a100-ledc"; + reg = <0x2008000 0x400>; + interrupts = <36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu 12>, <&ccu 34>; + clock-names = "bus", "mod"; + resets = <&ccu 12>; + dmas = <&dma 42>; + dma-names = "tx"; + #address-cells = <1>; + #size-cells = <0>; + + multi-led@0 { + reg = <0x0>; + color = ; + function = LED_FUNCTION_INDICATOR; + }; + }; + +... -- 2.35.1