Message ID | 20231029212738.7871-1-samuel@sholland.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1862220vqb; Sun, 29 Oct 2023 14:28:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFE7IR6QKI7DCQ+HGHCfhYdpjF0MK3UcRo2cCtJZmMVpMXf/zpdLStyKql11oV/9jb+2Vpn X-Received: by 2002:a17:902:d2cf:b0:1cc:45f1:adf5 with SMTP id n15-20020a170902d2cf00b001cc45f1adf5mr2116686plc.40.1698614917606; Sun, 29 Oct 2023 14:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698614917; cv=none; d=google.com; s=arc-20160816; b=coURLgOPcAFjdjzR9W1DrjQKUmFMx1+r9fW7BX5+2zvpXpyrTfRW7nCfpOnzHGZyaZ 2fV9kzeu7grTFNYKtNPe4cbY5DUVksbs+OHNRq1ShWSTpOvW8KFBbmkBBxjnwFsSea65 b+8zxK6X1tPJS0+UdI1yx04nmqeCm8L0x6Uz6f45ljcKrSFDVPqMczlx2tkzI1wDYZc/ 2o1cPvfqopxhixTcvXgfXI6+ycJfLMUH2w1GYsG8Yqwrz/9Gd604LAskSqKonmYkKp+M IoW5H2gn9hsabYb0+fkyscdZfjdDBQ5cTe0KIubrPa7tWXa0UVxA7r7YHJ5OmdnHXIRv myjA== 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 :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=MiMFrY0ycv/v9l0tkVb+XyEailSufLSk/OdS3dctGAk=; fh=4AREPpuive6M2Ev8F7U0tb7fj+UJesv3MBiZXhGYM1M=; b=xbRI0RcBBOj7BA/Rmoc4Mqnc74jvbRxeTG5OXaO17+W267UXqWSReHnPSR3Rh+bATB AGiz7X0AmPEYEbiW1TbjzuX6SIud9sD8RZltpmE+/Px4w+YfX4vXfKgvk7BoRnIuDgt9 9wlunwxCkVGrgP1per7C3IsWg0zZR5qzsafq+IXhObH/yYyXJl3yQcWrg3XckLEPZlIU YV6GxD1iZAD2LHQl/a/s2lTPx/6jeaQGm0Qo5kIRnpzFoZyHLng247Oi+B7mta/wSDMl eDGT7q4O0yZCx1ZWG0HV4Dpn+p1AS2eWKOOeZqgsh1i6vmX5AjpZ2QaEQLALJaXk09Ht a+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=c3iRw+Pm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=b0xoGx7L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z13-20020a1709027e8d00b001cc0c4c1c63si4183639pla.165.2023.10.29.14.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 14:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=c3iRw+Pm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=b0xoGx7L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C0B5D806128F; Sun, 29 Oct 2023 14:28:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbjJ2V1v (ORCPT <rfc822;zxc52fgh@gmail.com> + 31 others); Sun, 29 Oct 2023 17:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjJ2V1t (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 29 Oct 2023 17:27:49 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792BD97; Sun, 29 Oct 2023 14:27:44 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 167795C00E7; Sun, 29 Oct 2023 17:27:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 29 Oct 2023 17:27:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1698614862; x=1698701262; bh=MiMFrY0ycv /v9l0tkVb+XyEailSufLSk/OdS3dctGAk=; b=c3iRw+Pmsqwf7u+J/yJEiWwead cQlCIuPoU35W/2lyt8MOcnGbsZWW7144iApXMlWGzMy5JhC0DLcicR4nPl2QPfUo TPWY7W+zAoDNCTG2BZXJRpOzN0y4l6OJ4pwi2683ujmyQDX+0BJwbvWIIVT2gVPp jc/ZWUU84X1kDWbh48fYVP7Jz9R3WmF0gv1kBJvsLt+elUJUVm0ce3wSdvZlV8OA cmxQtIztCISHCRzu42ZBNzSv4dsEJGhKWR3w/lKrYToThcAShBnUJdpoZftdq93z blrAoyIHzeuzWfLVyltQqWjRRazLsR5bBBES9rtKeUYKysL4ZjbJTfAV/JYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version: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=1698614862; x=1698701262; bh=MiMFrY0ycv/v9 l0tkVb+XyEailSufLSk/OdS3dctGAk=; b=b0xoGx7LEl9exW66x82K8ONJK/XrK vATlpAvHRg+sG598kRHa1ThK792mWrchqg8I+csuI+DomRCSC21+5/7xZZXZ55Dh 34t6u19IiEzqzc6pktDmc4wSLlm3+g854hCDFEaZZT2facXH8ZHHK39bp4f0/ZNP 1u2n3y3mwgSRsYQFeih7Gy/eCyhb80NkLnB5NRrWb4jFQsKO1cL5X1YsFHcAfqya X/hu5lYw3moHBSAt5cDajVbfnDTi0CmQzhUfbRUKLf09sN6I4Txoeyr9vKttGXbg c1NwKNlAuZg7qx7wtqp99ZuhwbNOhpdNKRz/0jEhJThymEFbm7HSFaFgQ== X-ME-Sender: <xms:TM4-ZRS9kAzQTuQFDk0FfjngHteVb8qjxh8e792340ZVKgDcSjNkUw> <xme:TM4-ZayV5lHghBSOtyOpivZIAVEDu7poySdxhJ-qwoz5oYcIaSSBo9hn7oE0ArGS9 nF_LIKGNN1h1XGGRw> X-ME-Received: <xmr:TM4-ZW2aliP3tUGffKD84_idaH2OmyqUvazET3SXQyGbsQEEIiN-0jIhUA17BJHF8tq7oLfIx_Zlb15d7sQz0CIg75eKIcpC4XsbrwguqprzK0rKOfSY8Kc-6-ahUt_EG3RNuQ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleekgddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepkeevlefhjeeuleeltedvjedvfeefteegleehueejffehgffffeekhefh hfekkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: <xmx:TM4-ZZAaPZ2nXvvUk2R0WLf0JM7EfyP30BeIBF33qq7Lfa5_Wu8WzA> <xmx:TM4-Zahz5XGEfezpXiD70llcrva3fYXmN3Fd9gjhczAiOAqn-EBRxg> <xmx:TM4-ZdrKYXT-FayaYVLMOaytY-1LjLbK-DLzR5waqGTL__jZzGltdA> <xmx:Ts4-ZVTxLQM37ajUJ4r4AeLOoUHGC-VPVAun1yK3HbzI4GJJnT4SOw> Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Oct 2023 17:27:39 -0400 (EDT) From: Samuel Holland <samuel@sholland.org> To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@ucw.cz>, linux-leds@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com> Cc: Samuel Holland <samuel@sholland.org>, Andre Przywara <andre.przywara@arm.com>, Conor Dooley <conor+dt@kernel.org>, Cristian Ciocaltea <cristian.ciocaltea@collabora.com>, Guo Ren <guoren@kernel.org>, Jisheng Zhang <jszhang@kernel.org>, John Watts <contact@jookia.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Maksim Kiselev <bigunclemax@gmail.com>, Marc Kleine-Budde <mkl@pengutronix.de>, Palmer Dabbelt <palmer@dabbelt.com>, Philipp Zabel <p.zabel@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, Trevor Woerner <twoerner@gmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v8 0/5] leds: Allwinner A100 LED controller support Date: Sun, 29 Oct 2023 16:26:54 -0500 Message-ID: <20231029212738.7871-1-samuel@sholland.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 29 Oct 2023 14:28:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781126835776737119 X-GMAIL-MSGID: 1781126835776737119 |
Series |
leds: Allwinner A100 LED controller support
|
|
Message
Samuel Holland
Oct. 29, 2023, 9:26 p.m. UTC
This series adds bindings and a driver for the RGB LED controller found in some Allwinner SoCs, starting with A100. The hardware in the R329 and D1 SoCs appears to be identical. This series was tested on the Nezha board (one onboard LED) and the Dongshan Nezha STU board (with an external strip of 16/32/48 LEDs, also with gaps in the LED addresses). Changes in v8: - Remove redundant "Bindings" from the binding document title - Make the DMA channel optional; the driver now works without DMA - Fix spelling in the Kconfig description - Fix the file header comment style - Wrap to 100 columns instead of 80 - Use GENMASK for register bit fields - Use FIELD_PREP for setting all multiple-bit register fields - Add and use the LEDC_CHANNELS_PER_LED macro - Make length and offset variables unsigned to avoid mixed signedness - Add __counted_by for sun50i_a100_ledc::leds - Move the new/existing xfer logic out of sun50i_a100_ledc_pio_xfer() - Get the FIFO usage from INT_STS instead of assuming it is half full - Make the DMA channel optional; always use PIO if it is unavailable - Set up DMA before triggering the LEDC transfer to avoid underrun - Correctly enable/disable the DRQ for each transfer - Use more descriptive names for variables containing register values - Add blank lines and comments to improve readability - Add a comment explaining the write to the status register - Remove unnecessary debugging prints - Use the more-idiomatic post-increment operator in for loops - Allow gaps in child node 'reg' values (separate max_addr/num_leds) - Use device-managed allocation for the DMA buffer - Unregister LEDs before shutting down the controller to correctly respect LED_RETAIN_AT_SHUTDOWN (or lack thereof) - Use the .remove_new platform driver hook - Collected tags, except Tested-by for the driver due to large changes Changes in v7: - Use DEFINE_SIMPLE_DEV_PM_OPS Changes in v6: - Drop the A100 DMA controller DT node patch, which was merged via a different series 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 - Rename the driver R329 -> A100, since that is the actual original implementation Changes in v4: - Use "default" instead of "maxItems" for timing properties - Depend on LEDS_CLASS_MULTICOLOR 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 - 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 - Changed "writesl" to "iowrite32_rep" so the driver builds on hppa 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 - Renamed from sunxi-ledc to sun50i-r329-ledc - Added missing "static" to functions/globals as reported by 0day bot Samuel Holland (5): dt-bindings: leds: Add Allwinner A100 LED controller leds: sun50i-a100: New driver for the A100 LED controller arm64: dts: allwinner: a100: Add LED controller node riscv: dts: allwinner: d1: Add LED controller node riscv: dts: allwinner: d1: Add RGB LEDs to boards .../leds/allwinner,sun50i-a100-ledc.yaml | 137 +++++ .../arm64/boot/dts/allwinner/sun50i-a100.dtsi | 14 + .../allwinner/sun20i-d1-lichee-rv-dock.dts | 12 + .../boot/dts/allwinner/sun20i-d1-nezha.dts | 13 + arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi | 6 + .../boot/dts/allwinner/sunxi-d1s-t113.dtsi | 15 + drivers/leds/Kconfig | 9 + drivers/leds/Makefile | 1 + drivers/leds/leds-sun50i-a100.c | 580 ++++++++++++++++++ 9 files changed, 787 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml create mode 100644 drivers/leds/leds-sun50i-a100.c
Comments
On Sun, 29 Oct 2023 16:26:54 -0500, Samuel Holland wrote: > This series adds bindings and a driver for the RGB LED controller found > in some Allwinner SoCs, starting with A100. The hardware in the R329 and > D1 SoCs appears to be identical. > > This series was tested on the Nezha board (one onboard LED) and the > Dongshan Nezha STU board (with an external strip of 16/32/48 LEDs, also > with gaps in the LED addresses). > > [...] Applied, thanks! [1/5] dt-bindings: leds: Add Allwinner A100 LED controller commit: 57ef666e1586823adc1b7909ed3472dec117df1f [2/5] leds: sun50i-a100: New driver for the A100 LED controller commit: 090a25ad97983720f52b11d9c5a8d1a446217c1d -- Lee Jones [李琼斯]