Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1255389rwb; Sun, 6 Nov 2022 22:26:40 -0800 (PST) X-Google-Smtp-Source: AMsMyM5G1rFKinbJf9LXye2l95LbAHnqX4ixpIZf8qvu/GKWE3JczFu3vDgHGoEZalZ8+CrE6Gcl X-Received: by 2002:a17:907:6e90:b0:7ad:8ba7:6640 with SMTP id sh16-20020a1709076e9000b007ad8ba76640mr47811565ejc.142.1667802400221; Sun, 06 Nov 2022 22:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667802400; cv=none; d=google.com; s=arc-20160816; b=wJO+Y1JApIwJq2LxMW56QMbnnMQWOeS0T+3bG00gYJFIrBIx/VXN1je7EHXbSkA2Je lei0NqUFB1Pp3y3ByyN2nQzBuQNnZDJBGbKXauEMpgn2K9neh8fbaOri80J+99uLZIGr WkWTibsVrcf+2AJ0M6y41VH6ZHbAnVtrYXWHoetqusMi1wkf9QoWDDu08Gz/lEGfbnnP xSDcHejCpNUA5LgZc5oHpx6K4Vt5YSklPTiXCxL8kkBzw6Tq/dCm5yLccWybJLVRgqfg nCULeZvgQMpdxK1CDQvyAWFnVu8BiZByJZGPIzJWNpfrT6tNZgaY6LBmJTg9R0+BiZiS w3DA== 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=XCXLV1Fn2JMkCGp5d8/IdzhEV6t432NGJWbrn/bcneo=; b=hfI4yTFOw9lh115MYv6HPsEtYXDuRDJLQk1lQMaZjKQVaxt/UTp2E2w0d2DounJIhQ 4HnBp8auGdHhN4+J1/P9nws9ggQHR17Ypmf6wqXq4LEzW2PSycRjLa5rV+A6bP0IHD+4 K3GzghFS7jU0JNT2k3dtTskZrMQdvVxh2Ufx6N++UzdIR/zErdSk/027xVAdGE6x66Fv XVWwQoe9ZLxBdVDIf56FO32fkWk8GBV1xHaTO5saq2actVjGzr4nm9+mO3W8a2h/6Pst e6bFTLFZFAcJQK4nx40sfhhBQUl6aXy6bZOj6SRd/PGhFfUdLEa+Ojeh7OAl7GDPukXj u9Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=ZWOT2BWp; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dxDhSj3j; 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 h3-20020a1709060f4300b0077a19529760si4951835ejj.65.2022.11.06.22.26.17; Sun, 06 Nov 2022 22:26:40 -0800 (PST) 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=fm1 header.b=ZWOT2BWp; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dxDhSj3j; 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 S230350AbiKGFcx (ORCPT + 95 others); Mon, 7 Nov 2022 00:32:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230309AbiKGFcv (ORCPT ); Mon, 7 Nov 2022 00:32:51 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB3FFADD; Sun, 6 Nov 2022 21:32:50 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C5E6E5C00A0; Mon, 7 Nov 2022 00:32:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 07 Nov 2022 00:32:49 -0500 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=fm1; t=1667799169; x=1667885569; bh=XC XLV1Fn2JMkCGp5d8/IdzhEV6t432NGJWbrn/bcneo=; b=ZWOT2BWpAOKgtXDisF 8P+Da+UnWG7+rg6Ktziof8zNYah8+HxgL1e+R6Bs1WmfxR7XSs+BJAFgx3QsE1jn 065r2pbTCQZYvmd5B2t2sShojDA8fs2c3zoalWJdlUMkmyN06j2Y6mbwuhK5G/++ 8vOUboUNIDwXTF1ZlA+dQ8nuaQZPxZboU8w99NDf+pNmH0sDG6G4C1dIAmfuU2mF Nu8/PYllz8ZTu1HXaGb1BsPab1Unj90PVKJKKh3W485b6dgyCQemfQ5wZ2ss0hzF 9w4zwPhlEUE3+U07DsZsh6CqfAX3+3UyMMcDBAMfbYPQWQrhNnerLZutKWiKrHxY vxwA== 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=fm3; t=1667799169; x=1667885569; bh=XCXLV1Fn2JMkC Gp5d8/IdzhEV6t432NGJWbrn/bcneo=; b=dxDhSj3jTNQTQ2dirHiOqXjHOeoUa XZoQ8QtOLmtWw47eC3g1tVoaCTTsiryeaa41Y0qyNQhYNyKHQKRsvhH6Vda04yl8 6HhaO6gQYI1YLXh1NJy4a3FkdWc7SJNOTyBFhPqc4VACDCHj5K/PVdd6LWpigN2I ESQh6LCwcs9PCCoraK7mglZPjJpKCV/76W+Hlt4Pabka1x+m77dltrksS/aqHbFD C0qX0gWlLOCg2/FXJr+Uu4NcV3Oxiucfqlhv7VabLp8BD6OAVndlW9i8gOhV1ybg 0e+9zAndJ4DC0KsQcIiNIZYlct5nQDyQP/x+6SBIns7lr/jETR3E5LK+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdejgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpefghfevhffgheejhefgkeehueffgeehffejgeehueduueeffffhhfeu iefhueffhfenucffohhmrghinhepuggvvhhitggvthhrvggvrdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhho lhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 00:32:48 -0500 (EST) From: Samuel Holland To: Pavel Machek , linux-leds@vger.kernel.org, Chen-Yu Tsai , Jernej Skrabec Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Samuel Holland , Maxime Ripard , Rob Herring Subject: [PATCH v6 1/5] dt-bindings: leds: Add Allwinner A100 LED controller Date: Sun, 6 Nov 2022 23:32:42 -0600 Message-Id: <20221107053247.1180-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221107053247.1180-1-samuel@sholland.org> References: <20221107053247.1180-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,SPF_HELO_PASS, SPF_PASS 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 --- (no changes since v5) 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.37.3