From patchwork Mon Nov 14 01:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13041801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C2B6C4332F for ; Mon, 14 Nov 2022 01:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xK2XpHl9mYrbMsqmGMuGSKfvxsEAjMca0EmgUbcJ+VY=; b=qcudRUGZyE7SP1 G4wiEIi9KGz/oVrOmVkuE7asPVgEKAWgaL/WazmDgg29ixsOwRdVLXV700c8MxSrgUMABT1MeFUDw AkOcciDO0h/4HCWGnOD1ND+zTDta3ZhpqqqnQ+3yi8MwE4OyCeAieaUAPCO3Ki1D8ixJoUcap5ZTG sxBKoOgztv9V2Zsaxk8UhRYz0AjVHrTvg5GQUlOrpMiScle/1rycBlro/Ee2to2Bf/MeO/Z3mCtVI hyi/pZvkhFtHLlLF39IZ61UL7+ImqUEdPpYZPxocTYmljG36bja4Zg+PTfou/mjVojwx5IIMChOAq N3mIvokSIcipf0/jivfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouNwB-00F9i3-P9; Mon, 14 Nov 2022 01:06:59 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouNvz-00F9Z5-B6 for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 01:06:48 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 876D0320090E; Sun, 13 Nov 2022 20:06:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 20:06:39 -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 :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1668387998; x=1668474398; bh=uEBG0noFadV6gn6AN44lg+OVZ GcqsyZ2FQ0rSLtDMQA=; b=JCMAXkW2gbLYQvtMdC2mcNuS+FizriDr+vMzCsWAQ H2SIFySqy0UI6h3Lho3kOmc8n+9YPGqfdDa1N14W8AJYIUdWsz3IpSszWdipPzHV /tf/V/yYmCyRqFCJyOWhKnMQntdnddmuLWvJ8BagYcULeeeuaOYwBIFHyQO6KeVo 9Eaq9mJjJj3Q2PKMtTNK23/qJYFsrZt/BMIQZUeXOgLEOIHcEwTlMwD2WD4sEvCp q2ckBhwaF/PGRt58QtwdJkrAro90ho03h84/oJzMTCfT2CTFswBoqo2euXXAG1uI r5L+vzGavWtJOMI2e/BS77NjEIOG1vwqxzGWT+/xp5Q6Q== 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: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=fm1; t= 1668387998; x=1668474398; bh=uEBG0noFadV6gn6AN44lg+OVZGcqsyZ2FQ0 rSLtDMQA=; b=TGcn+eT7StW/coexTw6OBKS0kCHiH2sWry37jNpljYPN+Btaq3J SqJ+ItX1HnvK2bCpyrOVnPGLSGSGh83DM/D8YxC44Dz/Nzg6muHjMN6Kv2Ztvf3Q I6cBGKg0aZICkKy+BZLo0jlOBhtDxt7fGx2ss+6f9xqh0i0MkgjVCWGCFQyoeuUa RvCZ95klg7eb9fD1FHKMj2vOyKoUqx+kM7HD620JkN6BdbM5f+zBJfsGYmBCWehu nV0+yTUbfn118XoTnQq+42C8gdMzmpHpWm9xQuukmhJtMbjtXEnxRxseWtb/wT7O zGWO4ZJBOGv0QBZIq1Ek331PxIdGNSiciXg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeekheffteehtdetfffgfeetteejvdefleeuvedufffguedtjedvheelvddv fffhveenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdr ohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 20:06:37 -0500 (EST) From: Samuel Holland To: Pavel Machek , linux-leds@vger.kernel.org, Chen-Yu Tsai , Jernej Skrabec Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Samuel Holland Subject: [PATCH v7 0/5] leds: Allwinner A100 LED controller support Date: Sun, 13 Nov 2022 19:06:31 -0600 Message-Id: <20221114010636.33052-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_170647_435095_E0815BA5 X-CRM114-Status: GOOD ( 14.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Patches 4-5 depend on the D1 devicetree series[1], but the rest of this series can be merged without them. This driver was tested on the D1 Nezha board. [1]: https://lore.kernel.org/linux-riscv/20220815050815.22340-1-samuel@sholland.org/ 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 | 139 +++++ .../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 | 21 + drivers/leds/Kconfig | 9 + drivers/leds/Makefile | 1 + drivers/leds/leds-sun50i-a100.c | 555 ++++++++++++++++++ 8 files changed, 764 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml create mode 100644 drivers/leds/leds-sun50i-a100.c