From patchwork Thu Dec 12 03:39:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66964138D for ; Thu, 12 Dec 2019 03:40:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 26FCA21655 for ; Thu, 12 Dec 2019 03:40:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z/Tu1z51" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26FCA21655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IXEE6sFVH8sbzsEYpICt/q3x3jlkEs+9pJRHqQJGvow=; b=Z/Tu1z51XgTacy ItmaDN8leueNrAgMwy8ou0aaj4qsXl0x3vUYfRMw5UVuFD3kNXq3KJHCq4lx4SaVbC871pZZholKd 8i0+jWhBJr+DKCR5FIt4Jfjuvx2kNzLP5NS04QZgIQUtKnh7SIZ9vedkpWmM7V7pdckLeyScBuxbg sFPXKJSEo/ZEt+EF+7Le4bNqHipYMfYsHbO9tAgq5ddsLefZIYEap85ovFucO51jvNwxxnbGHQ7Sb xbJMgrhr0dgx87JKTFIuyu3/HoaE5lWwGlcYvNTI06HSMSJG0f4Kf7StKqDf+nzFlbd1gvBA1B3lh FLah2cDIn7AjLc5Ke3eQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKb-0000Os-74; Thu, 12 Dec 2019 03:40:01 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKY-0000NT-BB; Thu, 12 Dec 2019 03:39:59 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7A1F1ADBB; Thu, 12 Dec 2019 03:39:56 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 01/25] dt-bindings: vendor-prefixes: Add Xnano Date: Thu, 12 Dec 2019 04:39:28 +0100 Message-Id: <20191212033952.5967-2-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_193958_530145_448EA8C0 X-CRM114-Status: UNSURE ( 7.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Xnano is a Chinese TV box brand, but not much more is publicly known. Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 6046f4555852..84a76efad2a8 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1058,6 +1058,8 @@ patternProperties: description: Xillybus Ltd. "^xlnx,.*": description: Xilinx + "^xnano,.*": + description: Xnano "^xunlong,.*": description: Shenzhen Xunlong Software CO.,Limited "^yones-toptech,.*": From patchwork Thu Dec 12 03:39:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FC27138D for ; Thu, 12 Dec 2019 03:40:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A5C1221655 for ; Thu, 12 Dec 2019 03:40:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lXqeQ3tv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5C1221655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rbN0CA2n3jb0eckVDhznky8Siq8t8Meu3ZAJQ44pT1U=; b=lXqeQ3tvr3OFz0 rV2Weh1DctRKOhUUgGjSy4Lrb6wXs2RkLUoRHHhL6imzTMO2w+o8W61nzqAOBe/GRFEAxH7WMxLt0 v/4CqeU7fF4X5oB7FRQp429VWR7H8XyxUtDewrnElNiwpIutbLK74WYvQq1e9Rh8OFvBr+fNr6LFP n0IOmP2VimmAhACNVs+zrIQrglLSrsVUxWNfyYa1qA3v7eMx4qb2utyWh+jY5TE7eUgi6NSlWjYq6 Jc+BpxWo+7ea2TjqFNv8cT2aHT02Nt1SGqYgFmj3FMnhelPdhEMilWAw/OMJ4JcU7BnLSZ025D4Qr qL/IfUQ1KoLbaeYE4ZcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFL2-0001vc-Fw; Thu, 12 Dec 2019 03:40:28 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKY-0000NU-BB; Thu, 12 Dec 2019 03:39:59 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id AC443ADE1; Thu, 12 Dec 2019 03:39:56 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 02/25] dt-bindings: arm: realtek: Add Xnano X5 Date: Thu, 12 Dec 2019 04:39:29 +0100 Message-Id: <20191212033952.5967-3-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_193958_530131_C252F417 X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Define a compatible string for Xnano X5 OTT TV Box. Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/arm/realtek.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/realtek.yaml b/Documentation/devicetree/bindings/arm/realtek.yaml index db43dc3ab7ac..e11616883736 100644 --- a/Documentation/devicetree/bindings/arm/realtek.yaml +++ b/Documentation/devicetree/bindings/arm/realtek.yaml @@ -32,6 +32,7 @@ properties: - enum: - mele,v9 # MeLE V9 - probox2,ava # ProBox2 AVA + - xnano,x5 # Xnano X5 - zidoo,x9s # Zidoo X9S - const: realtek,rtd1295 From patchwork Thu Dec 12 03:39:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A65ED930 for ; Thu, 12 Dec 2019 03:41:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 843EC214D8 for ; Thu, 12 Dec 2019 03:41:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SickfIhQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 843EC214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Xxe3vMZ3vue9Ngka8TypYoUYHQvOctRb9HXELvizgg=; b=SickfIhQY23WxY +xPHwdvfyhAk6+G75m0C9tWOrWh/cFVHk5BRH1li8sPAjIrMCOJ8w9+000k8qxH5HUVHMS8x7QLBJ c0EwR+drMPiXeSCNf3hTegUnWKj+zE2M56TIkZeU1Kk3TbtGlK2QeQyOTKSWSFNz+ldQlaYabiVnO wcvmRwTvuLChsZBWpJ9jytIYG3qahHOA2L5nraHxROPCw6wdmyJVs9dVWyDX7OsXpgcLoejrrr4JQ k4yfS5GRpKQCg5oyM65VxkGG0KR3YQrJQTRWDr+e4Oy1YAgdNMijo+W8ldlSI/smpRS5uhwSKmoy0 jVioU16gHKsS6sl5VN8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFLa-0002N3-S1; Thu, 12 Dec 2019 03:41:02 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKY-0000NV-LS; Thu, 12 Dec 2019 03:40:01 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 665FAAD7B; Thu, 12 Dec 2019 03:39:57 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 03/25] arm64: dts: realtek: rtd1295: Add Xnano X5 Date: Thu, 12 Dec 2019 04:39:30 +0100 Message-Id: <20191212033952.5967-4-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_193958_850065_6C037173 X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Xnano X5 is an OTT TV Box. Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/Makefile | 1 + arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts | 30 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts diff --git a/arch/arm64/boot/dts/realtek/Makefile b/arch/arm64/boot/dts/realtek/Makefile index 54bd02d11c02..ef8d8fcbaa05 100644 --- a/arch/arm64/boot/dts/realtek/Makefile +++ b/arch/arm64/boot/dts/realtek/Makefile @@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_REALTEK) += rtd1293-ds418j.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-mele-v9.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-probox2-ava.dtb +dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-xnano-x5.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-zidoo-x9s.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1296-ds418.dtb diff --git a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts new file mode 100644 index 000000000000..d7878ff942e6 --- /dev/null +++ b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) +/* + * Copyright (c) 2017-2019 Andreas Färber + */ + +/dts-v1/; + +#include "rtd1295.dtsi" + +/ { + compatible = "xnano,x5", "realtek,rtd1295"; + model = "Xnano X5"; + + memory@1f000 { + device_type = "memory"; + reg = <0x1f000 0x3ffe1000>; /* boot ROM to 1 GiB or 2 GiB */ + }; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&uart0 { + status = "okay"; +}; From patchwork Thu Dec 12 03:39:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 952FD930 for ; Thu, 12 Dec 2019 03:41:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 704F8214D8 for ; Thu, 12 Dec 2019 03:41:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sNRbhEOg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 704F8214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2zYqMkR76Ak8mJrViHp+TfxUXypdQLZoSxzwUJ5yDY4=; b=sNRbhEOgNqkJCd kAP2a22sQsDVF1qGkJ8/vUGF5br+YRO34lauMIPNE03ymoMxqrRlOmTMzU3To9GDXxIRms+WhC71Y Web54AbmNqaPuEBNmyUfvvJG9DdsPhLqrnemXGRL5i+Bzg7N9WEW57bOcJt8B+esJky7jIKFFMRO5 uDGUjkvurtW1oRNnVtUW/VKS3QweQpsnZiN1oVoLXlfvkodo04klChFToGBfBsyBYPoFPh2gJx/Tv FhJgWnz+R300tGH7qvqX9xQOWBVMRk+Vr+drO/Hw56R1TYgIqPVfEE7+Vxj88oXOYxZhgeSt2FxFW bYxi7gfCxQknC6+EKYkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFLw-0002fd-Fu; Thu, 12 Dec 2019 03:41:24 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKZ-0000NW-6u; Thu, 12 Dec 2019 03:40:01 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id ECAB9AE40; Thu, 12 Dec 2019 03:39:57 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 04/25] spi: gpio: Implement LSB First bitbang support Date: Thu, 12 Dec 2019 04:39:31 +0100 Message-Id: <20191212033952.5967-5-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_193959_535474_18184438 X-CRM114-Status: GOOD ( 13.14 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support for slave DT property spi-lsb-first, i.e., SPI_LSB_FIRST mode. Duplicate the inline helpers bitbang_txrx_be_cpha{0,1} as LE versions. Make checkpatch.pl happy by changing "unsigned" to "unsigned int". Conditionally call them from all the spi-gpio txrx_word callbacks. Signed-off-by: Andreas Färber --- drivers/spi/spi-bitbang-txrx.h | 68 ++++++++++++++++++++++++++++++++++++++++-- drivers/spi/spi-gpio.c | 42 ++++++++++++++++++++------ 2 files changed, 99 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-bitbang-txrx.h b/drivers/spi/spi-bitbang-txrx.h index ae61d72c7d28..999a89325325 100644 --- a/drivers/spi/spi-bitbang-txrx.h +++ b/drivers/spi/spi-bitbang-txrx.h @@ -45,7 +45,7 @@ static inline u32 bitbang_txrx_be_cpha0(struct spi_device *spi, - unsigned nsecs, unsigned cpol, unsigned flags, + unsigned int nsecs, unsigned int cpol, unsigned int flags, u32 word, u8 bits) { /* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */ @@ -77,7 +77,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi, static inline u32 bitbang_txrx_be_cpha1(struct spi_device *spi, - unsigned nsecs, unsigned cpol, unsigned flags, + unsigned int nsecs, unsigned int cpol, unsigned int flags, u32 word, u8 bits) { /* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */ @@ -106,3 +106,67 @@ bitbang_txrx_be_cpha1(struct spi_device *spi, } return word; } + +static inline u32 +bitbang_txrx_le_cpha0(struct spi_device *spi, + unsigned int nsecs, unsigned int cpol, unsigned int flags, + u32 word, u8 bits) +{ + /* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */ + + u32 oldbit = !(word & 1); + /* clock starts at inactive polarity */ + for (; likely(bits); bits--) { + + /* setup LSB (to slave) on trailing edge */ + if ((flags & SPI_MASTER_NO_TX) == 0) { + if ((word & 1) != oldbit) { + setmosi(spi, word & 1); + oldbit = word & 1; + } + } + spidelay(nsecs); /* T(setup) */ + + setsck(spi, !cpol); + spidelay(nsecs); + + /* sample LSB (from slave) on leading edge */ + word >>= 1; + if ((flags & SPI_MASTER_NO_RX) == 0) + word |= getmiso(spi) << (bits - 1); + setsck(spi, cpol); + } + return word; +} + +static inline u32 +bitbang_txrx_le_cpha1(struct spi_device *spi, + unsigned int nsecs, unsigned int cpol, unsigned int flags, + u32 word, u8 bits) +{ + /* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */ + + u32 oldbit = !(word & 1); + /* clock starts at inactive polarity */ + for (; likely(bits); bits--) { + + /* setup LSB (to slave) on leading edge */ + setsck(spi, !cpol); + if ((flags & SPI_MASTER_NO_TX) == 0) { + if ((word & 1) != oldbit) { + setmosi(spi, word & 1); + oldbit = word & 1; + } + } + spidelay(nsecs); /* T(setup) */ + + setsck(spi, cpol); + spidelay(nsecs); + + /* sample LSB (from slave) on trailing edge */ + word >>= 1; + if ((flags & SPI_MASTER_NO_RX) == 0) + word |= getmiso(spi) << (bits - 1); + } + return word; +} diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 7ceb0ba27b75..493723eda844 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -135,25 +135,37 @@ static inline int getmiso(const struct spi_device *spi) static u32 spi_gpio_txrx_word_mode0(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { - return bitbang_txrx_be_cpha0(spi, nsecs, 0, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha0(spi, nsecs, 0, flags, word, bits); + else + return bitbang_txrx_be_cpha0(spi, nsecs, 0, flags, word, bits); } static u32 spi_gpio_txrx_word_mode1(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { - return bitbang_txrx_be_cpha1(spi, nsecs, 0, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha1(spi, nsecs, 0, flags, word, bits); + else + return bitbang_txrx_be_cpha1(spi, nsecs, 0, flags, word, bits); } static u32 spi_gpio_txrx_word_mode2(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { - return bitbang_txrx_be_cpha0(spi, nsecs, 1, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha0(spi, nsecs, 1, flags, word, bits); + else + return bitbang_txrx_be_cpha0(spi, nsecs, 1, flags, word, bits); } static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { - return bitbang_txrx_be_cpha1(spi, nsecs, 1, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha1(spi, nsecs, 1, flags, word, bits); + else + return bitbang_txrx_be_cpha1(spi, nsecs, 1, flags, word, bits); } /* @@ -170,28 +182,40 @@ static u32 spi_gpio_spec_txrx_word_mode0(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { flags = spi->master->flags; - return bitbang_txrx_be_cpha0(spi, nsecs, 0, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha0(spi, nsecs, 0, flags, word, bits); + else + return bitbang_txrx_be_cpha0(spi, nsecs, 0, flags, word, bits); } static u32 spi_gpio_spec_txrx_word_mode1(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { flags = spi->master->flags; - return bitbang_txrx_be_cpha1(spi, nsecs, 0, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha1(spi, nsecs, 0, flags, word, bits); + else + return bitbang_txrx_be_cpha1(spi, nsecs, 0, flags, word, bits); } static u32 spi_gpio_spec_txrx_word_mode2(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { flags = spi->master->flags; - return bitbang_txrx_be_cpha0(spi, nsecs, 1, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha0(spi, nsecs, 1, flags, word, bits); + else + return bitbang_txrx_be_cpha0(spi, nsecs, 1, flags, word, bits); } static u32 spi_gpio_spec_txrx_word_mode3(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits, unsigned flags) { flags = spi->master->flags; - return bitbang_txrx_be_cpha1(spi, nsecs, 1, flags, word, bits); + if (unlikely(spi->mode & SPI_LSB_FIRST)) + return bitbang_txrx_le_cpha1(spi, nsecs, 1, flags, word, bits); + else + return bitbang_txrx_be_cpha1(spi, nsecs, 1, flags, word, bits); } /*----------------------------------------------------------------------*/ @@ -389,7 +413,7 @@ static int spi_gpio_probe(struct platform_device *pdev) master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); master->mode_bits = SPI_3WIRE | SPI_3WIRE_HIZ | SPI_CPHA | SPI_CPOL | - SPI_CS_HIGH; + SPI_CS_HIGH | SPI_LSB_FIRST; if (!spi_gpio->mosi) { /* HW configuration without MOSI pin * From patchwork Thu Dec 12 03:39:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C53E4138D for ; Thu, 12 Dec 2019 03:41:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A33C7214D8 for ; Thu, 12 Dec 2019 03:41:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GGoznxaK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A33C7214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tqRTUpJzplxDgkPWd+eaRksruh5e7Ixr7rBwwt4h+Fs=; b=GGoznxaKsBCfMd 3gojKYH9KvDQ+LMKHTb8M3FQ/vy5lWZrotzVUddXTJMC7Um+/A6j5wPlx86wPdPM/LhiY4iq/SXAh 9oWfwnFTHTrg48qivhTUzlkwbMOdtC0oTUvMXm1kL9Hw1Spc0ZntflViEStrxlsGZpg20aA+SzE5f PCMS+yIdRqypJXrcG5J/KD2NoYHgdpmt5gaE3bxA7qUtUIfqYxobL70CAi3oY3dh9TLOdTxjjpuOX qjYrPaVjBzDakfsUL+v0lVoieSZhgNFQEY7voHbmvKReGfGCMxmwPdrP7lBM7oY4lkVWs6on92uNw bFvmSH+pq/iIajAHV29Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFM8-0002rG-7Q; Thu, 12 Dec 2019 03:41:36 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKZ-0000O6-Tg; Thu, 12 Dec 2019 03:40:02 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9C4C9AE47; Thu, 12 Dec 2019 03:39:58 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 05/25] dt-bindings: vendor-prefixes: Add Titan Micro Electronics Date: Thu, 12 Dec 2019 04:39:32 +0100 Message-Id: <20191212033952.5967-6-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194000_118099_31F3E05A X-CRM114-Status: UNSURE ( 7.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , zypeng@titanmec.com, =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Assign vendor prefix "titanmec", matching their domain name. Cc: zypeng@titanmec.com Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 84a76efad2a8..31d0c4772b96 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -951,6 +951,8 @@ patternProperties: description: Texas Instruments "^tianma,.*": description: Tianma Micro-electronics Co., Ltd. + "^titanmec,.*": + description: Shenzhen Titan Micro Electronics Co., Ltd. "^tlm,.*": description: Trusted Logic Mobility "^tmt,.*": From patchwork Thu Dec 12 03:39:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80F84930 for ; Thu, 12 Dec 2019 03:41:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2FFAC214D8 for ; Thu, 12 Dec 2019 03:41:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fDJxqFLR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FFAC214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UTs6IZ1BF+Vy9Vy2vCflshsSCLiPsKGGhsm8wS7MuAE=; b=fDJxqFLRb8Obfq LiegUE8N5iRB5hU/iw1/Kr0rI4QI8F5DrKuZUik5ckarXBj343Fq26hH0/4uXb8ituCq4t7gr1Ixr 4Q27nZgayKQTr5wVlPhuk0dDLLRgbdxnASYipAFiOWs3nYq9c/LzIhkJUQGPiFy6Dv3S3yKpW/21O MvXTPcd7JwxB1PwSlvlQ38h8oob7XmunnnjTvugC3XlaHI1m20JS7WYVgl6+r+oYBUj9B5Dwb5yz8 kJ1iOL/eDZcSMAK2IOHe1xlqK9u75mDPIURwgD9hovPDi69EYu98ohhguug5UbP28wySylQ+fVxXZ BLzxRIv1O7iH+NDiwOpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFMN-00037a-KX; Thu, 12 Dec 2019 03:41:51 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKb-0000Oa-0Y; Thu, 12 Dec 2019 03:40:03 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0861BAE57; Thu, 12 Dec 2019 03:39:59 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 06/25] dt-bindings: leds: Add Titan Micro Electronics TM1628 Date: Thu, 12 Dec 2019 04:39:33 +0100 Message-Id: <20191212033952.5967-7-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194001_204227_954A1D3E X-CRM114-Status: GOOD ( 10.34 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , zypeng@titanmec.com, =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a YAML schema binding for TM1628 LED controller. Cc: zypeng@titanmec.com Signed-off-by: Andreas Färber --- @Rob: How could we express constraints on two-cell reg value ranges here? Should we also model constraints on reg range by #grids property? .../devicetree/bindings/leds/titanmec,tm1628.yaml | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml diff --git a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml new file mode 100644 index 000000000000..024875656e79 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/titanmec,tm1628.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Titan Micro Electronics TM1628 LED controller + +maintainers: + - Andreas Färber + +properties: + compatible: + enum: + - titanmec,tm1628 + + reg: + maxItems: 1 + + "#grids": + description: | + Number of GRID output lines to use. + This limits the number of available SEG output lines. + minimum: 4 + maximum: 7 + + "#address-cells": + const: 2 + + "#size-cells": + const: 0 + +required: + - compatible + - reg + +patternProperties: + "^.*@[1-7],([1-9]|1[02-4])$": + type: object + description: | + Properties for a single LED. + + properties: + reg: + description: | + 1-based grid number, followed by 1-based segment number. + maxItems: 1 + + linux,default-trigger: true + + required: + - reg + +examples: + - | + #include + + spi { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@0 { + compatible = "titanmec,tm1628"; + reg = <0>; + spi-3-wire; + spi-lsb-first; + spi-max-frequency = <500000>; + #grids = <7>; + #address-cells = <2>; + #size-cells = <0>; + + colon@5,4 { + reg = <5 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + linux,default-trigger = "heartbeat"; + }; + }; + }; +... From patchwork Thu Dec 12 03:39:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B80D9930 for ; Thu, 12 Dec 2019 03:42:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 92AB0214D8 for ; Thu, 12 Dec 2019 03:42:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m69cgXUu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92AB0214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NcAAThldBk+hna/XFBTUdJWqcjfuhF5qBWA+W0KlRhE=; b=m69cgXUuq8p4Df WrrvGgLKigivrFNOIvTNytbD1EGVXiu5WxKzD4pnCoX+td9zh6p+kKy8hn7bVOcWoc0tnVaR4Tf3Q o5d4dygtwp0BnhROvHO3Y3VyZkB362w18/zmE2vj+vn/suF+pCADkvjZ9NFKUuKV1TKKPSmQdgacc 0F4+G0y0wfBL0UJHsfui4H+sXNIowIEzRUFHWKH8bg1FPfExdlAcahkqQvENJG8oiJTuDLFixw1D+ VXePWF4ZkmHPU+5YINkNvUE3Vu7YL0iyXyAcv6z9qrtQ02bzHlCU/cAMtB1MRf+eI0neVoWLuCymz r7r/s82qtib+FtEUYbMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFNP-0004HG-VY; Thu, 12 Dec 2019 03:42:56 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKb-0000Op-47; Thu, 12 Dec 2019 03:40:09 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D1D8BAF21; Thu, 12 Dec 2019 03:39:59 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 07/25] leds: Add Titan Micro Electronics TM1628 Date: Thu, 12 Dec 2019 04:39:34 +0100 Message-Id: <20191212033952.5967-8-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194001_472620_35C44DB1 X-CRM114-Status: GOOD ( 17.66 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , zypeng@titanmec.com, =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a driver for TM1628 LED controller. Cc: zypeng@titanmec.com Signed-off-by: Andreas Färber --- drivers/leds/Kconfig | 11 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-tm1628.c | 420 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 432 insertions(+) create mode 100644 drivers/leds/leds-tm1628.c diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 4b68520ac251..f3afb419a9a1 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -836,6 +836,17 @@ config LEDS_LM36274 Say Y to enable the LM36274 LED driver for TI LMU devices. This supports the LED device LM36274. +config LEDS_TM1628 + tristate "LED driver for TM1628" + depends on LEDS_CLASS + depends on SPI + depends on OF || COMPILE_TEST + help + Say Y to enable support for Titan Micro Electronics TM1628 + LED controllers. + They are 3-wire SPI devices controlling a two-dimensional grid of + LEDs. Dimming is applied to all outputs through an internal PWM. + comment "LED Triggers" source "drivers/leds/trigger/Kconfig" diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 2da39e896ce8..4c931002ef44 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -90,6 +90,7 @@ obj-$(CONFIG_LEDS_LM36274) += leds-lm36274.o obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o obj-$(CONFIG_LEDS_EL15203000) += leds-el15203000.o +obj-$(CONFIG_LEDS_TM1628) += leds-tm1628.o # LED Userspace Drivers obj-$(CONFIG_LEDS_USER) += uleds.o diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c new file mode 100644 index 000000000000..319bf34ce835 --- /dev/null +++ b/drivers/leds/leds-tm1628.c @@ -0,0 +1,420 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Titan Micro Electronics TM1628 LED controller + * + * Copyright (c) 2019 Andreas Färber + */ + +#include +#include +#include +#include +#include +#include + +#define TM1628_CMD_MASK GENMASK(7, 6) +#define TM1628_CMD_DISPLAY_MODE (0x0 << 6) +#define TM1628_CMD_DATA_SETTING (0x1 << 6) +#define TM1628_CMD_DISPLAY_CTRL (0x2 << 6) +#define TM1628_CMD_ADDRESS_SETTING (0x3 << 6) + +#define TM1628_DISPLAY_MODE_MODE_MASK GENMASK(1, 0) + +#define TM1628_DATA_SETTING_MODE_MASK GENMASK(1, 0) +#define TM1628_DATA_SETTING_WRITE_DATA 0x0 +#define TM1628_DATA_SETTING_READ_DATA 0x2 +#define TM1628_DATA_SETTING_FIXED_ADDR BIT(2) +#define TM1628_DATA_SETTING_TEST_MODE BIT(3) + +#define TM1628_DISPLAY_CTRL_PW_MASK GENMASK(2, 0) + +#define TM1628_DISPLAY_CTRL_DISPLAY_ON BIT(3) + +struct tm1628_mode { + u8 grid_mask; + u16 seg_mask; +}; + +struct tm1628_info { + u8 grid_mask; + u16 seg_mask; + const struct tm1628_mode *modes; + int default_mode; + const struct pwm_capture *pwm_map; + int default_pwm; +}; + +struct tm1628_led { + struct led_classdev leddev; + struct tm1628 *ctrl; + u32 grid; + u32 seg; +}; + +struct tm1628 { + struct spi_device *spi; + const struct tm1628_info *info; + u32 grids; + unsigned int segments; + int mode_index; + int pwm_index; + u8 data[14]; + unsigned int num_leds; + struct tm1628_led leds[]; +}; + +/* Command 1: Display Mode Setting */ +static int tm1628_set_display_mode(struct spi_device *spi, u8 grid_mode) +{ + u8 cmd = TM1628_CMD_DISPLAY_MODE; + + if (unlikely(grid_mode & ~TM1628_DISPLAY_MODE_MODE_MASK)) + return -EINVAL; + + cmd |= grid_mode; + + return spi_write(spi, &cmd, 1); +} + +/* Command 2: Data Setting */ +static int tm1628_write_data(struct spi_device *spi, const u8 *data, unsigned int len) +{ + u8 cmd = TM1628_CMD_DATA_SETTING | TM1628_DATA_SETTING_WRITE_DATA; + struct spi_transfer xfers[] = { + { + .tx_buf = &cmd, + .len = 1, + }, + { + .tx_buf = data, + .len = len, + }, + }; + + if (len > 14) + return -EINVAL; + + return spi_sync_transfer(spi, xfers, ARRAY_SIZE(xfers)); +} + +/* Command 3: Address Setting */ +static int tm1628_set_address(struct spi_device *spi, u8 addr) +{ + u8 cmd = TM1628_CMD_ADDRESS_SETTING; + + cmd |= (addr & GENMASK(3, 0)); + + return spi_write(spi, &cmd, 1); +} + +/* Command 4: Display Control */ +static int tm1628_set_display_ctrl(struct spi_device *spi, bool on, u8 pwm_index) +{ + u8 cmd = TM1628_CMD_DISPLAY_CTRL; + + if (on) + cmd |= TM1628_DISPLAY_CTRL_DISPLAY_ON; + + if (pwm_index & ~TM1628_DISPLAY_CTRL_PW_MASK) + return -EINVAL; + + cmd |= pwm_index; + + return spi_write(spi, &cmd, 1); +} + +static inline bool tm1628_is_valid_grid(struct tm1628 *s, unsigned int grid) +{ + return s->info->modes[s->mode_index].grid_mask & BIT(grid); +} + +static inline bool tm1628_is_valid_seg(struct tm1628 *s, unsigned int seg) +{ + return s->info->modes[s->mode_index].seg_mask & BIT(seg); +} + +static int tm1628_get_led_offset(struct tm1628 *s, + unsigned int grid, unsigned int seg, int *poffset, int *pbit) +{ + int offset, bit; + + if (grid == 0 || grid > 7 || seg == 0 || seg > 16) + return -EINVAL; + + offset = (grid - 1) * 2; + bit = seg - 1; + if (bit >= 8) { + bit -= 8; + offset++; + } + + *poffset = offset; + if (pbit) + *pbit = bit; + + return 0; +} + +static int tm1628_get_led(struct tm1628 *s, + unsigned int grid, unsigned int seg, bool *on) +{ + int offset, bit; + int ret; + + ret = tm1628_get_led_offset(s, grid, seg, &offset, &bit); + if (ret) + return ret; + + *on = !!(s->data[offset] & BIT(bit)); + + return 0; +} + +static int tm1628_set_led(struct tm1628 *s, + unsigned int grid, unsigned int seg, bool on) +{ + int offset, bit; + int ret; + + ret = tm1628_get_led_offset(s, grid, seg, &offset, &bit); + if (ret) + return ret; + + if (on) + s->data[offset] |= BIT(bit); + else + s->data[offset] &= ~BIT(bit); + + return 0; +} + +static int tm1628_led_set_brightness(struct led_classdev *led_cdev, + enum led_brightness brightness) +{ + struct tm1628_led *led = container_of(led_cdev, struct tm1628_led, leddev); + struct tm1628 *s = led->ctrl; + int ret, offset; + + ret = tm1628_set_led(s, led->grid, led->seg, brightness != LED_OFF); + if (ret) + return ret; + + ret = tm1628_get_led_offset(s, led->grid, led->seg, &offset, NULL); + if (unlikely(ret)) + return ret; + + ret = tm1628_set_address(s->spi, offset); + if (ret) + return ret; + + return tm1628_write_data(s->spi, s->data + offset, 1); +} + +static enum led_brightness tm1628_led_get_brightness(struct led_classdev *led_cdev) +{ + struct tm1628_led *led = container_of(led_cdev, struct tm1628_led, leddev); + struct tm1628 *s = led->ctrl; + bool on; + int ret; + + ret = tm1628_get_led(s, led->grid, led->seg, &on); + if (ret) + return ret; + + return on ? LED_ON : LED_OFF; +} + +static int tm1628_register_led(struct tm1628 *s, + struct fwnode_handle *node, u32 grid, u32 seg, struct tm1628_led *led) +{ + struct device *dev = &s->spi->dev; + struct led_init_data init_data = {0}; + + if (!tm1628_is_valid_grid(s, grid) || !tm1628_is_valid_seg(s, seg)) { + dev_warn(dev, "%s reg out of range\n", fwnode_get_name(node)); + return -EINVAL; + } + + led->ctrl = s; + led->grid = grid; + led->seg = seg; + led->leddev.max_brightness = LED_ON; + led->leddev.brightness_set_blocking = tm1628_led_set_brightness; + led->leddev.brightness_get = tm1628_led_get_brightness; + + fwnode_property_read_string(node, "linux,default-trigger", &led->leddev.default_trigger); + + init_data.fwnode = node; + init_data.devicename = "tm1628"; + + return devm_led_classdev_register_ext(dev, &led->leddev, &init_data); +} + +/* Work around __builtin_popcount() */ +static u32 tm1628_grid_popcount(u8 grid_mask) +{ + int i, n = 0; + + while (grid_mask) { + i = __ffs(grid_mask); + grid_mask &= ~BIT(i); + n++; + } + + return n; +} + +static int tm1628_spi_probe(struct spi_device *spi) +{ + struct tm1628 *s; + struct fwnode_handle *child; + u32 grids; + u32 reg[2]; + size_t leds; + int ret, i; + + leds = device_get_child_node_count(&spi->dev); + + s = devm_kzalloc(&spi->dev, struct_size(s, leds, leds), GFP_KERNEL); + if (!s) + return -ENOMEM; + + s->spi = spi; + + s->info = device_get_match_data(&spi->dev); + if (!s->info) + return -EINVAL; + + s->pwm_index = s->info->default_pwm; + + ret = tm1628_set_display_ctrl(spi, false, s->pwm_index); + if (ret) { + dev_err(&spi->dev, "Turning display off failed (%d)\n", ret); + return ret; + } + + ret = device_property_read_u32(&spi->dev, "#grids", &grids); + if (ret && ret != -EINVAL) { + dev_err(&spi->dev, "Error reading #grids property (%d)\n", ret); + return ret; + } + + s->mode_index = -1; + for (i = 0; i < 4; i++) { + if (tm1628_grid_popcount(s->info->modes[i].grid_mask) != grids) + continue; + s->mode_index = i; + break; + } + if (s->mode_index == -1) { + dev_err(&spi->dev, "#grids out of range (%u)\n", grids); + return -EINVAL; + } + + spi_set_drvdata(spi, s); + + device_for_each_child_node(&spi->dev, child) { + ret = fwnode_property_read_u32_array(child, "reg", reg, 2); + if (ret) { + dev_err(&spi->dev, "Reading %s reg property failed (%d)\n", + fwnode_get_name(child), ret); + fwnode_handle_put(child); + return ret; + } + + if (fwnode_property_count_u32(child, "reg") == 2) { + ret = tm1628_register_led(s, child, reg[0], reg[1], &s->leds[i++]); + if (ret && ret != -EINVAL) { + dev_err(&spi->dev, "Failed to register LED %s (%d)\n", + fwnode_get_name(child), ret); + fwnode_handle_put(child); + return ret; + } + s->num_leds++; + } + } + + ret = tm1628_set_address(spi, 0x0); + if (ret) { + dev_err(&spi->dev, "Setting address failed (%d)\n", ret); + return ret; + } + + ret = tm1628_write_data(spi, s->data, sizeof(s->data)); + if (ret) { + dev_err(&spi->dev, "Writing data failed (%d)\n", ret); + return ret; + } + + ret = tm1628_set_display_mode(spi, s->mode_index); + if (ret) { + dev_err(&spi->dev, "Setting display mode failed (%d)\n", ret); + return ret; + } + + ret = tm1628_set_display_ctrl(spi, true, s->pwm_index); + if (ret) { + dev_err(&spi->dev, "Turning display on failed (%d)\n", ret); + return ret; + } + + return 0; +} + +static const struct pwm_capture tm1628_pwm_map[8] = { + { .duty_cycle = 1, .period = 16 }, + { .duty_cycle = 2, .period = 16 }, + { .duty_cycle = 4, .period = 16 }, + { .duty_cycle = 10, .period = 16 }, + { .duty_cycle = 11, .period = 16 }, + { .duty_cycle = 12, .period = 16 }, + { .duty_cycle = 13, .period = 16 }, + { .duty_cycle = 14, .period = 16 }, +}; + +static const struct tm1628_mode tm1628_modes[4] = { + { + .grid_mask = GENMASK(4, 1), + .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), + }, + { + .grid_mask = GENMASK(5, 1), + .seg_mask = GENMASK(13, 12) | GENMASK(10, 1), + }, + { + .grid_mask = GENMASK(6, 1), + .seg_mask = BIT(12) | GENMASK(10, 1), + }, + { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(10, 1), + }, +}; + +static const struct tm1628_info tm1628_info = { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), + .modes = tm1628_modes, + .default_mode = 3, + .pwm_map = tm1628_pwm_map, + .default_pwm = 0, +}; + +static const struct of_device_id tm1628_spi_of_matches[] = { + { .compatible = "titanmec,tm1628", .data = &tm1628_info }, + {} +}; +MODULE_DEVICE_TABLE(of, tm1628_spi_of_matches); + +static struct spi_driver tm1628_spi_driver = { + .probe = tm1628_spi_probe, + .driver = { + .name = "tm1628", + .of_match_table = tm1628_spi_of_matches, + }, +}; +module_spi_driver(tm1628_spi_driver); + +MODULE_DESCRIPTION("TM1628 LED controller driver"); +MODULE_AUTHOR("Andreas Färber"); +MODULE_LICENSE("GPL"); From patchwork Thu Dec 12 03:39:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 291CE138D for ; Thu, 12 Dec 2019 03:42:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9F17F214D8 for ; Thu, 12 Dec 2019 03:42:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fxlx1iUg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F17F214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gVSrukpvqY+yNpWnaMSHodGCHZzj9dZ6GCzYBfV3pww=; b=Fxlx1iUgx5Gz6a +J0Qgr1ePNnl8Cva35Hc4Zrfmu+Epj0K/nMqfAPsLuRshWmmJ8Rny4oZ3dPkf+GD4BGv3yR4NgdH+ SDprQW2h3xko8rfj2p5vWDtw5z/Ien+hl9jV8r9UNS47ZD2EhUAni7bU6jldLRx+n8oT93SEGuw5K PmlpmImbB2ZSKgWL+qdxW3QoaS2/ltCmzUp1YgEbjc1txwdZg1ALnqT6Wag1xchLD+NmLo/QcZLJ+ uboHH5J5+h3lrNLS7grxuwzicieB5qqR+0pGD4OfelIr4H5KuZ2Z6m3dAQ+53obyW+rWOIJE/dNxz yml5loB4wbNJVciUpUqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFMm-0003Ya-4I; Thu, 12 Dec 2019 03:42:16 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKb-0000Oq-LZ; Thu, 12 Dec 2019 03:40:06 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 54FADADBB; Thu, 12 Dec 2019 03:40:00 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 08/25] arm64: dts: realtek: rtd129x-zidoo-x9s: Add TM1628 LED controller Date: Thu, 12 Dec 2019 04:39:35 +0100 Message-Id: <20191212033952.5967-9-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194001_892160_0DD8A088 X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Roc He , linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a spi-gpio node and LED controller slave node. Cc: Roc He Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts index 628dfd123fa1..5183acd851a8 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) /* - * Copyright (c) 2016-2017 Andreas Färber + * Copyright (c) 2016-2019 Andreas Färber */ /dts-v1/; @@ -42,6 +42,26 @@ gpio = <&misc_gpio 16 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + spi { + compatible = "spi-gpio"; + sck-gpios = <&iso_gpio 4 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&iso_gpio 3 GPIO_ACTIVE_HIGH>; + cs-gpios = <&iso_gpio 2 GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + #address-cells = <1>; + #size-cells = <0>; + + tm1628: led-controller@0 { + compatible = "titanmec,tm1628"; + reg = <0>; + spi-3wire; + spi-lsb-first; + spi-rx-delay-us = <1>; + spi-max-frequency = <500000>; + #grids = <7>; + }; + }; }; &cpu0 { From patchwork Thu Dec 12 03:39:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FF741593 for ; Thu, 12 Dec 2019 03:42:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7D9D9214D8 for ; Thu, 12 Dec 2019 03:42:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WQxkYs43" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D9D9214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=po5g+1WMiH5i+z6r8lu4XwwHuraCqg3x2jEdur1AD7M=; b=WQxkYs43QFivo2 2UZkMFUBjU3DoMCNh2JBnnJ5uUFzv4CZzToAGe1zIcSuIN44TH4NGmqQh6mD2Ho2L89XInDVK5KrB gqI/95aYF2UVbU5Vm+T7uxSAU+iUQ7KQ6n4zby7zWjIHQpALEHYyoajAGZiGWqtI3Ib9EP02TL6MT jiASNwydOQML4psW8gWCEx1pyyE1Uf75Zw/UxnGzh9Ej1Af7xpu2INQ5x2ImZ6pTWWPSFOOdPwLVv 60Bqvaatofa109qrls5I1rnbn49CwUAe9p25wlnaqCzRKKuscL59HGtWo1k4poKdwMV83AchQJg+t UAA4vplfwUHpX54dExrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFN1-0003q0-9z; Thu, 12 Dec 2019 03:42:31 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKc-0000PY-UV; Thu, 12 Dec 2019 03:40:07 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7461AF27; Thu, 12 Dec 2019 03:40:00 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 09/25] arm64: dts: realtek: rtd1295-zidoo-x9s: Add regular LEDs to TM1628 Date: Thu, 12 Dec 2019 04:39:36 +0100 Message-Id: <20191212033952.5967-10-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194003_498443_BD0C7B98 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Roc He , linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a child node for the half-second colon. Cc: Roc He Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts index 5183acd851a8..219b4987412c 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts @@ -6,6 +6,7 @@ /dts-v1/; #include +#include #include "rtd1295.dtsi" @@ -60,6 +61,15 @@ spi-rx-delay-us = <1>; spi-max-frequency = <500000>; #grids = <7>; + #address-cells = <2>; + #size-cells = <0>; + + colon@5,4 { + reg = <5 4>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; + }; }; }; }; From patchwork Thu Dec 12 03:39:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C2E8930 for ; Thu, 12 Dec 2019 03:42:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D8B00214D8 for ; Thu, 12 Dec 2019 03:42:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fUmXet3J" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8B00214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3MlXwZaEuxco7UchZF+I01eh/MZwl3tn2Ehxc3+/JfM=; b=fUmXet3JdEKQ/X VAHyIa9MkYHOUjSoSqJmj5K9P+NiDSd9s7KHegjtZwP7+lXvckZcbOuf1Ce703Y6mJaa2Kg5G3g3E ftm4YKSKhCpibhwCEleN3sZOeVkQEUy+MEd3hx+eI/O/hF48qA20vQweK56nOlZDqvyRNT2wau163 plj9CC31crDlB1/7FHL3zAKYivyUEXGhNoi2uYFSoND3sIqWmB8UyiJFS6yDyKn+FXiU6End/aK3G n7nv4+0r0HoleuN89VrUevvh0X/wy/LBP3cer4LRbMP6V6JNXYXb+td4Y4EAijEbkjkaBZSh6/0Ie aqcOZ+o55ofjABxBy7Rg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFMa-0003LB-RT; Thu, 12 Dec 2019 03:42:04 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKd-0000QN-13; Thu, 12 Dec 2019 03:40:07 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5674FADE1; Thu, 12 Dec 2019 03:40:01 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 10/25] dt-bindings: vendor-prefixes: Add Fuda Hisi Microelectronics Date: Thu, 12 Dec 2019 04:39:37 +0100 Message-Id: <20191212033952.5967-11-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194003_509542_75DC44FA X-CRM114-Status: UNSURE ( 7.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, sales@fdhisi.com, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Assign vendor prefix "fdhisi", based on their domain name. Cc: sales@fdhisi.com Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 31d0c4772b96..34b6c298c9bd 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -331,6 +331,8 @@ patternProperties: description: Fastrax Oy "^fcs,.*": description: Fairchild Semiconductor + "^fdhisi,.*": + description: Fuzhou Fuda Hisi Microelectronics Co., Ltd. "^feiyang,.*": description: Shenzhen Fly Young Technology Co.,LTD. "^firefly,.*": From patchwork Thu Dec 12 03:39:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D6F8930 for ; Thu, 12 Dec 2019 03:42:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3667F214D8 for ; Thu, 12 Dec 2019 03:42:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nzB7gaGu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3667F214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xeBjMlzcYWU/GdpScNsDwndGtAw1Izpg6wWZbJkp9j8=; b=nzB7gaGuBDNrou Gw300PnN0ylFXi43owX+bNz/gnImqn/IAL0DPDoZH71zrmBPlwLPgbWJ3q+YqnEpTid2x75aTEqeC evtns8My7foTmOQKMMaUmJdaAiqSBRnZNTz5NL1HI7yCvhcxvsy762cSrEfzBqplX3qt2SjzfjZGr kmCeJ+0/vD9VL9bAtT2XDnyb0zXVzkeAwe5zkRrOBD0+G0QZhu2ueGWtplTuB1/5aMgEpJRZBRLEv A3TarZQmLXBnNBLCr9bXMc76OgJMzPyrj9U1bYgAz9oA1yOfHcv9WexA43xhE11pRp3g8COeooRli dKBuKjCaB9w4Eq7A+a1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFNE-00043r-M1; Thu, 12 Dec 2019 03:42:44 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKd-0000RS-SC; Thu, 12 Dec 2019 03:40:10 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EADCCAE40; Thu, 12 Dec 2019 03:40:01 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 11/25] dt-bindings: leds: tm1628: Add Fuda Hisi Microelectronics FD628 Date: Thu, 12 Dec 2019 04:39:38 +0100 Message-Id: <20191212033952.5967-12-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194004_100080_E9C7C6F3 X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, sales@fdhisi.com, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a compatible string for FD628. Cc: sales@fdhisi.com Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml index 024875656e79..3f2cc4cec04d 100644 --- a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml +++ b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml @@ -12,6 +12,7 @@ maintainers: properties: compatible: enum: + - fdhisi,fd628 - titanmec,tm1628 reg: From patchwork Thu Dec 12 03:39:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 698BB138D for ; Thu, 12 Dec 2019 03:43:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 42D3D214D8 for ; Thu, 12 Dec 2019 03:43:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QfJWq5LO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42D3D214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jd40eqW++XxW+2AKvab0d9tdF21Ls38M+qB/FhF9tgQ=; b=QfJWq5LOMxx2+r kXJHhcFhEbYU1whzAGF/jT+Cazj74ewK5kPbzhG4HIuFYSjo1sqNChEGd/DgsfoYSxStwz9lIIpc5 5S8C7qPN02hegqJA/DGQGrDugp3niUGBku4w7z5q6HoDtabwmK1lqFf3OGEyKHTcFylzyj1GJlkPj LDaVXH5tVYKbODYcXoS1eMOJdViDVxfe29AZ+K2Aqwfj7oObj02Msh8zMHohgSc/5lEaZdMvgEuIs PM7Rt1091AbZBSZy0JdLLvMy3pWPwr0tNVIQOA+6USXiE28Rf6hb3OOKnqMDLyHzKX/9eICJTPPEY gEj3wS5RSCw6gMykx3gg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFNi-0004Xl-6m; Thu, 12 Dec 2019 03:43:14 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKe-0000SE-By; Thu, 12 Dec 2019 03:40:11 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 60525AD6F; Thu, 12 Dec 2019 03:40:02 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 12/25] leds: tm1628: Add Fuda Hisi Microelectronics FD628 Date: Thu, 12 Dec 2019 04:39:39 +0100 Message-Id: <20191212033952.5967-13-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194004_625110_F2CA7EC0 X-CRM114-Status: GOOD ( 10.28 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sales@fdhisi.com, linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add definition for FD628 chipset. Cc: sales@fdhisi.com Signed-off-by: Andreas Färber --- drivers/leds/Kconfig | 4 ++-- drivers/leds/leds-tm1628.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index f3afb419a9a1..a7695d961d9c 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -842,8 +842,8 @@ config LEDS_TM1628 depends on SPI depends on OF || COMPILE_TEST help - Say Y to enable support for Titan Micro Electronics TM1628 - LED controllers. + Say Y to enable support for Titan Micro Electronics TM1628 and + Fuda Hisi Microelectronics FD628 LED controllers. They are 3-wire SPI devices controlling a two-dimensional grid of LEDs. Dimming is applied to all outputs through an internal PWM. diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 319bf34ce835..ef85712a84f2 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Titan Micro Electronics TM1628 LED controller + * Also compatible: + * Fuda Hisi Microelectronics FD628 * * Copyright (c) 2019 Andreas Färber */ @@ -400,8 +402,18 @@ static const struct tm1628_info tm1628_info = { .default_pwm = 0, }; +static const struct tm1628_info fd628_info = { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), + .modes = tm1628_modes, + .default_mode = 3, + .pwm_map = tm1628_pwm_map, + .default_pwm = 0, +}; + static const struct of_device_id tm1628_spi_of_matches[] = { { .compatible = "titanmec,tm1628", .data = &tm1628_info }, + { .compatible = "fdhisi,fd628", .data = &fd628_info }, {} }; MODULE_DEVICE_TABLE(of, tm1628_spi_of_matches); From patchwork Thu Dec 12 03:39:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEB44930 for ; Thu, 12 Dec 2019 03:43:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8CFDA214D8 for ; Thu, 12 Dec 2019 03:43:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eDNms0RW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CFDA214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dS4Rl5N3onUJHcTU4ppMrVfdwLBca/LU19kFVvH5pBU=; b=eDNms0RWcoN+Hr /2uwRZVEg3m9FmUkVU1iLfWfHjb9XXwaX9fNQnEeQhqSYipgoR19sXxNznFe6Klk3ClfVztNX9jC+ accxRCHAw+BJuWK7JxclTCsJRe4AysArH/+II654eug2W6WcrXYQ/wMjHWteV56vmfKmPxZoCH71r cGIEFCc4jD7sPS9E7aOaX2TFaetLV+WnhYmzxKoFR8TZBFAootvt5ioRWGxk3txd//ZN52x5m1BpT eTNDekMeQa1VaI+28lk8Np8aDfqTHPI/CUOQLfP4n8AntIuViqLHD6z1ddCDGoZdjr7+1vD6G3J57 0TIkuXVwlsgoAdjmKo5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFNw-0004r1-P2; Thu, 12 Dec 2019 03:43:28 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKe-0000Sy-Hh; Thu, 12 Dec 2019 03:40:11 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D71ADAF37; Thu, 12 Dec 2019 03:40:02 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 13/25] arm64: dts: realtek: rtd1295-xnano-x5: Add FD628 LED controller Date: Thu, 12 Dec 2019 04:39:40 +0100 Message-Id: <20191212033952.5967-14-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194004_782472_C8F27ED4 X-CRM114-Status: UNSURE ( 7.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a spi-gpio node and LED controller slave node. Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts index d7878ff942e6..ea9e9a96f1d3 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts @@ -5,6 +5,8 @@ /dts-v1/; +#include + #include "rtd1295.dtsi" / { @@ -23,6 +25,26 @@ chosen { stdout-path = "serial0:115200n8"; }; + + spi { + compatible = "spi-gpio"; + sck-gpios = <&iso_gpio 4 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&iso_gpio 3 GPIO_ACTIVE_HIGH>; + cs-gpios = <&iso_gpio 2 GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + #address-cells = <1>; + #size-cells = <0>; + + fd628: led-controller@0 { + compatible = "fdhisi,fd628"; + reg = <0>; + spi-3wire; + spi-lsb-first; + spi-rx-delay-us = <1>; + spi-max-frequency = <500000>; + #grids = <7>; + }; + }; }; &uart0 { From patchwork Thu Dec 12 03:39:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3ED32930 for ; Thu, 12 Dec 2019 03:43:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1CFE2214D8 for ; Thu, 12 Dec 2019 03:43:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bD2xIEUF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CFE2214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FcGAnfuEiNfaMkTr6Zs0TWv30sto0EK3Tbf5/Vai+zs=; b=bD2xIEUFI7GJUQ p34C9IYMcnWMxDWn/dyJlI5HTt7y8rrg+FwlNyUrVq5ozRZoTVicuJI1cJJ2B3xH0Kgz5y+ffjomj u0TiRHvkIN4rVJEB9D7n0LnRXvGkIPGBtjWF7QJ9FOrCpjYB6FldWxcT8fX8hl6O8/WZ01IMrRbOo 28mDVC419OnDhf/3zIWNJlYJ/0TIleso3kEpdr/fhugSS415nVY0haZRnL9A4Ihs3oQmTyMNmpFNC 1dUEH5QyNdrvfH8PxiR7H9fVb6fC3hzAmqP6L+IU2oPU/239a1UVcgfgEU6eouA+c9Hpr9z2A2I0D mH6MRrZLOXpIG1I4yr4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFOA-00054Y-6S; Thu, 12 Dec 2019 03:43:42 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKe-0000VN-Sg; Thu, 12 Dec 2019 03:40:12 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 601BDAD5F; Thu, 12 Dec 2019 03:40:03 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 14/25] arm64: dts: realtek: rtd1295-xnano-x5: Add regular LEDs to FD628 Date: Thu, 12 Dec 2019 04:39:41 +0100 Message-Id: <20191212033952.5967-15-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194005_108537_351CF159 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add child nodes for individual LED indicators plus the half-second colon. Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts index ea9e9a96f1d3..9d678b300c7b 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts @@ -6,6 +6,7 @@ /dts-v1/; #include +#include #include "rtd1295.dtsi" @@ -43,6 +44,57 @@ spi-rx-delay-us = <1>; spi-max-frequency = <500000>; #grids = <7>; + #address-cells = <2>; + #size-cells = <0>; + + apps@1,4 { + reg = <1 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <1>; + }; + + setup@2,4 { + reg = <2 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <2>; + }; + + usb@3,4 { + reg = <3 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <3>; + }; + + card@4,4 { + reg = <4 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <4>; + }; + + colon@5,4 { + reg = <5 4>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; + }; + + hdmi@6,4 { + reg = <6 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <6>; + }; + + cvbs@7,4 { + reg = <7 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <7>; + }; }; }; }; From patchwork Thu Dec 12 03:39:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286929 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C2AC930 for ; Thu, 12 Dec 2019 03:44:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C8B2221655 for ; Thu, 12 Dec 2019 03:44:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mI4grIFC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8B2221655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sEt/o+h7FDOOMMrH4g1oQqAsvWjR2aitB13QytYysaw=; b=mI4grIFCkwORyd lLZsMPtEf/TxWnl0EwIw9Iv1SV6cDglMpBC8kyJVyfXeQrv51RJGWaBe4pBCFyQ5t9AOGmb7XXky5 kuORQnNrQOQLMNOUreKR/chqCZNCYVq6q8bEmgEmu0qKheisbPX0+JQ5b7JjkoaylDRaUhou9zFwf 0W5IBe+xA2m6CAbi29ad+z0XdispytAhwzG1gt1pZ81AjAtx09jo1fq2lIu9coaxdvUkYpYFOnwbb VvfDkRxmozcX1f72BWB4oflvIpggQW+oq5/prIDUFThwfVZDj6Beh06UzEiYEEfpC3VkTjX+dtmjd g2DA34xh2P2JV2GEofwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFOf-0005Y9-P2; Thu, 12 Dec 2019 03:44:13 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKf-0000Yr-Ad; Thu, 12 Dec 2019 03:40:12 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D356DAF93; Thu, 12 Dec 2019 03:40:03 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 15/25] dt-bindings: vendor-prefixes: Add Fude Microelectronics Date: Thu, 12 Dec 2019 04:39:42 +0100 Message-Id: <20191212033952.5967-16-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194005_587871_6C2D9615 X-CRM114-Status: UNSURE ( 7.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Assign vendor prefix "szfdwdz", based on their domain name. Signed-off-by: Andreas Färber Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 34b6c298c9bd..1f44e45971ab 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -927,6 +927,8 @@ patternProperties: description: Synaptics Inc. "^synology,.*": description: Synology, Inc. + "^szfdwdz,.*": + description: Shenzhen Fude Microelectronics Co., Ltd. "^tbs,.*": description: TBS Technologies "^tbs-biometrics,.*": From patchwork Thu Dec 12 03:39:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9810B930 for ; Thu, 12 Dec 2019 03:43:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 769EB214D8 for ; Thu, 12 Dec 2019 03:43:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LaOabrd+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 769EB214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4BDqUzkhC9mZmDfoq1pXCjWQEHrxvgzlDH1VsQxMITI=; b=LaOabrd+HwxVzV //5pNJ+W1nAa6MLHAbhAae3Q9FnlosujpnuNXcY1UJYiNVWBlKTPeXG2Lj1gRnmqlIBLvBHvWPC+3 kIcSguPtdFjYa2Mz3utxXjIeDR19wOAn3SSn8INF1RKuHVLbDq9owF82Ao/6T6Eecs6hJ8Z30VI/H q+r5uMFg8qM+O+QfvUOGBAfuPgIiuA+P97V/oxONpC4Ikgytwo2nUQjpb2eeWETmqH7vUMp9CA8Xw 4w/bLe7coRoLUV8YtaOsvLCRSJBJfwE5wwCDjSgWOT96Ng6asBSY6sGVOCD/6xHANKHyAHyOG1DxV 2t69I6gl4j205dXF+nRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFOO-0005JW-Py; Thu, 12 Dec 2019 03:43:56 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKf-0000bX-OB; Thu, 12 Dec 2019 03:40:14 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 50BA0AECA; Thu, 12 Dec 2019 03:40:04 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 16/25] dt-bindings: leds: tm1628: Add Fude Microelectronics AiP1618 Date: Thu, 12 Dec 2019 04:39:43 +0100 Message-Id: <20191212033952.5967-17-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194005_969141_700FB551 X-CRM114-Status: UNSURE ( 7.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Define a compatible string for AiP1618 chipset. Signed-off-by: Andreas Färber Acked-by: Rob Herring --- @Rob: This one would conditionally need to further restrict reg ranges then. Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml index 3f2cc4cec04d..50205e3c3624 100644 --- a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml +++ b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml @@ -13,6 +13,7 @@ properties: compatible: enum: - fdhisi,fd628 + - szfdwdz,aip1618 - titanmec,tm1628 reg: From patchwork Thu Dec 12 03:39:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286935 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3ACC5138D for ; Thu, 12 Dec 2019 03:45:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 18EB4214D8 for ; Thu, 12 Dec 2019 03:45:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aLm/yfWo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18EB4214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5Bs/u+aeCCi+jpQr6xqPSaUrSt/7NnCgzREmFH4JYTI=; b=aLm/yfWo42rrt1 DLX4ra2vfooDojH2HA6rx52LSpKrV7Tnt2amc9dpO2ZG4F/1bBgdSgI2fPQ7OAs0DTiRGPIdZsFEG 9lxwSiCwGTwN7H6ydojMivwKOrQFqYK4rOlWe2unm8mktlINIs1rDz9BlBO1MA0Ef63k7phuWzqh9 upDs43TVWnakA2V/qG6O6Cx3QKfpAJq5T+H7mpIZFC/XoTL5WXjMq2ndvKGKB+YuQtrJySv6ts+eF E7vLgCpoITfqaDW/csnirnqUdDrCzsOIwVz1Ovv3vKsz4xulcHTOzPhV7Uap3M/ZqSQPSKL4jPpVJ SqNZXtiV/33uMyOOlHtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFPP-0006GR-I9; Thu, 12 Dec 2019 03:44:59 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKi-0000oZ-HP; Thu, 12 Dec 2019 03:40:15 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D8415AF63; Thu, 12 Dec 2019 03:40:04 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 17/25] leds: tm1628: Prepare Fude Microelectronics AiP1618 Date: Thu, 12 Dec 2019 04:39:44 +0100 Message-Id: <20191212033952.5967-18-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194008_947846_BD0E83C3 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add definition for AiP1618 chipset. Signed-off-by: Andreas Färber --- drivers/leds/Kconfig | 5 +++-- drivers/leds/leds-tm1628.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index a7695d961d9c..3a7e6028ae80 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -842,8 +842,9 @@ config LEDS_TM1628 depends on SPI depends on OF || COMPILE_TEST help - Say Y to enable support for Titan Micro Electronics TM1628 and - Fuda Hisi Microelectronics FD628 LED controllers. + Say Y to enable support for Titan Micro Electronics TM1628, + Fuda Hisi Microelectronics FD628 and Fude Microelectronics AiP1618 + LED controllers. They are 3-wire SPI devices controlling a two-dimensional grid of LEDs. Dimming is applied to all outputs through an internal PWM. diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index ef85712a84f2..8a8fd1562853 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -3,6 +3,7 @@ * Titan Micro Electronics TM1628 LED controller * Also compatible: * Fuda Hisi Microelectronics FD628 + * Fude Microelectronics AiP1618 * * Copyright (c) 2019 Andreas Färber */ @@ -411,9 +412,38 @@ static const struct tm1628_info fd628_info = { .default_pwm = 0, }; +static const struct tm1628_mode aip1618_modes[4] = { + { + .grid_mask = GENMASK(4, 1), + .seg_mask = GENMASK(8, 1), + }, + { + .grid_mask = GENMASK(5, 1), + .seg_mask = GENMASK(7, 1), + }, + { + .grid_mask = GENMASK(6, 1), + .seg_mask = GENMASK(6, 1), + }, + { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(5, 1), + }, +}; + +static const struct tm1628_info aip1618_info = { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(14, 12) | GENMASK(5, 1), + .modes = aip1618_modes, + .default_mode = 3, + .pwm_map = tm1628_pwm_map, + .default_pwm = 0, +}; + static const struct of_device_id tm1628_spi_of_matches[] = { { .compatible = "titanmec,tm1628", .data = &tm1628_info }, { .compatible = "fdhisi,fd628", .data = &fd628_info }, + { .compatible = "szfdwdz,aip1618", .data = &aip1618_info }, {} }; MODULE_DEVICE_TABLE(of, tm1628_spi_of_matches); From patchwork Thu Dec 12 03:39:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286931 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77068930 for ; Thu, 12 Dec 2019 03:44:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3BD03214D8 for ; Thu, 12 Dec 2019 03:44:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gT5/slZ4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BD03214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pFvQe829y8HvhPMyloR1l6BczJyJNCPPtH8SMxRKliU=; b=gT5/slZ4jZ5ph4 ie857KCVvsSZbYoh4YmzJwJPOM4q1+IMwfeXI5DBRZtAHrvmkH08Xkli4ZkshNDRyEwh4nVxcqc11 6lNVqblb3Diq9EuvTbiziNNVnc382f3gIlSf9XFJdqAIOb1gJ+PHyJCSHZaFvucn8LU+w4494aP+r 13HuQISfat5UCbKlIgT7zofzfCrfSczlIsUd2Ke2kPMvXEdJGldWIGTc3QLi+W8lwctS7MAXTBDXi uBYZmiYko/lHlMgyIcat6rgslhSZOMhTvD6WIbVLh3EGAQE2Ve8sEjcsFvLoJA1icERqrB35VfAd4 qQQD+OmVE1EwYAbwSofQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFOv-0005lw-0H; Thu, 12 Dec 2019 03:44:29 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKi-0000oY-Ax; Thu, 12 Dec 2019 03:40:15 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5E564AFA8; Thu, 12 Dec 2019 03:40:05 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 18/25] dt-bindings: leds: tm1628: Define display child nodes Date: Thu, 12 Dec 2019 04:39:45 +0100 Message-Id: <20191212033952.5967-19-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194008_577992_BAB74254 X-CRM114-Status: UNSURE ( 8.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Amend the individual LEDs by allowing to specify one special child node with more than one reg entry, with value zero having wildcard meaning. Signed-off-by: Andreas Färber --- Read the cover letter for further discussion of concept and alternatives. .../devicetree/bindings/leds/titanmec,tm1628.yaml | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml index 50205e3c3624..cf6c8d81e68c 100644 --- a/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml +++ b/Documentation/devicetree/bindings/leds/titanmec,tm1628.yaml @@ -53,6 +53,24 @@ patternProperties: required: - reg + "^display@([1-7],0|0,([1-9]|1[02-4]))$": + type: object + description: | + Properties for a sequence of 7-segment digits composed of multiple LEDs. + + properties: + reg: + description: | + One or more tuples of grid number and segment number in visual order. + A segment of zero indicates that the corresponding grid output lines + represent the individual segments; a grid of zero indicates that the + corresponding segment output lines represent the individual segments. + minItems: 1 + maxItems: 7 + + required: + - reg + examples: - | #include @@ -71,6 +89,40 @@ examples: #address-cells = <2>; #size-cells = <0>; + display@0,8 { + reg = <0 8>, <0 7>, <0 6>, <0 5>; + }; + + colon@5,4 { + reg = <5 4>; + color = ; + function = LED_FUNCTION_INDICATOR; + linux,default-trigger = "heartbeat"; + }; + }; + }; + + - | + #include + + spi { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@0 { + compatible = "titanmec,tm1628"; + reg = <0>; + spi-3-wire; + spi-lsb-first; + spi-max-frequency = <500000>; + #grids = <6>; + #address-cells = <2>; + #size-cells = <0>; + + display@1,0 { + reg = <1 0>, <2 0>, <3 0>, <4 0>; + }; + colon@5,4 { reg = <5 4>; color = ; From patchwork Thu Dec 12 03:39:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286947 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6366214E3 for ; Thu, 12 Dec 2019 03:46:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E245214D8 for ; Thu, 12 Dec 2019 03:46:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eZpDobkG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E245214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gH3MwkSuih0bnE/8T4oEKdfP0ye5RMQstC0TY38zZ8s=; b=eZpDobkGUseu9k ZidhxgyYd/dSj+L7JGV3rg2gPp9gYb/3qkcr2l/1fVOk77V2dwkUy3txjJEf7SKc2GhAiBBTdJ0YS BLr8OxZCpf79hHEbQbb4gkbOj4edJmvDD499Ldsu0bwNFw+W65dLPqjengvgWvEe6hoT3wZy/Cv47 0fo8w+Qx4dVVdXMbY0J9JS37cAnEfKnfLik77q9licUIWJ9YfPmKw1UF7fNOjqqUTyoo1Bp/dglzD sZnRcKosxfmVXY8pbXbS4xsFXg5MWyEXgBSjahDWCa5npojIz0DdgmkUTDGF4gNwUyGH+el4AeDUH ih5zWYdYDK89RC5PE3ug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFQq-0000SB-LU; Thu, 12 Dec 2019 03:46:28 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKj-0000r6-Kx; Thu, 12 Dec 2019 03:40:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E4A2AADA8; Thu, 12 Dec 2019 03:40:05 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 19/25] leds: tm1628: Add 7-segment display support Date: Thu, 12 Dec 2019 04:39:46 +0100 Message-Id: <20191212033952.5967-20-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194010_073944_914E57B3 X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Detect DT child nodes covering more than one LED component and implement a text to 7-segment display mapping. Signed-off-by: Andreas Färber --- drivers/leds/leds-tm1628.c | 230 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 229 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 8a8fd1562853..e2c2a5d91596 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -47,6 +47,15 @@ struct tm1628_info { int default_pwm; }; +struct tm1628_segment { + u32 grid; + u32 seg; +}; + +struct tm1628_display { + struct tm1628_segment segments[8]; +}; + struct tm1628_led { struct led_classdev leddev; struct tm1628 *ctrl; @@ -62,6 +71,8 @@ struct tm1628 { int mode_index; int pwm_index; u8 data[14]; + unsigned int num_displays; + struct tm1628_display *displays; unsigned int num_leds; struct tm1628_led leds[]; }; @@ -253,6 +264,215 @@ static int tm1628_register_led(struct tm1628 *s, return devm_led_classdev_register_ext(dev, &led->leddev, &init_data); } +#define SSD_TOP BIT(0) +#define SSD_TOP_RIGHT BIT(1) +#define SSD_BOTTOM_RIGHT BIT(2) +#define SSD_BOTTOM BIT(3) +#define SSD_BOTTOM_LEFT BIT(4) +#define SSD_TOP_LEFT BIT(5) +#define SSD_MIDDLE BIT(6) +#define SSD_DOT BIT(7) + +struct tm1628_ssd_char { + char ch; + u8 segs; +}; + +static const struct tm1628_ssd_char tm1628_char_ssd_map[] = { + { '0', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { '1', SSD_TOP_RIGHT | SSD_BOTTOM_RIGHT }, + { '2', SSD_TOP | SSD_TOP_RIGHT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { '3', SSD_TOP | SSD_TOP_RIGHT | SSD_MIDDLE | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { '4', SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | SSD_BOTTOM_RIGHT }, + { '5', SSD_TOP | SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { '6', SSD_TOP | SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { '7', SSD_TOP | SSD_TOP_RIGHT | SSD_BOTTOM_RIGHT }, + { '8', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { '9', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'A', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT }, + { 'B', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'C', SSD_TOP | SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { 'D', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'E', SSD_TOP | SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { 'F', SSD_TOP | SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_LEFT }, + { 'G', SSD_TOP | SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { 'H', SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT }, + { 'I', SSD_TOP_LEFT | SSD_BOTTOM_LEFT }, + { 'J', SSD_TOP | SSD_TOP_RIGHT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'K', SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT }, + { 'L', SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { 'O', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'P', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT }, + { 'Q', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'R', SSD_TOP | SSD_TOP_LEFT | SSD_TOP_RIGHT | SSD_MIDDLE | + SSD_BOTTOM_LEFT | SSD_BOTTOM_RIGHT }, + { 'S', SSD_TOP | SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_RIGHT | SSD_BOTTOM }, + { 'T', SSD_TOP | SSD_TOP_LEFT | SSD_BOTTOM_LEFT }, + { 'U', SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT | SSD_TOP_RIGHT }, + { 'V', SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT | SSD_TOP_RIGHT }, + { 'W', SSD_TOP_LEFT | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT | SSD_TOP_RIGHT }, + { 'Z', SSD_TOP | SSD_TOP_RIGHT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { 'b', SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { 'l', SSD_TOP_LEFT | SSD_BOTTOM_LEFT }, + { 'o', SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { 't', SSD_TOP_LEFT | SSD_MIDDLE | SSD_BOTTOM_LEFT | SSD_BOTTOM }, + { 'u', SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { 'v', SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { 'w', SSD_BOTTOM_LEFT | SSD_BOTTOM | SSD_BOTTOM_RIGHT }, + { '-', SSD_MIDDLE }, + { '_', SSD_BOTTOM }, + { '.', SSD_DOT }, +}; + +static u8 tm1628_get_char_ssd_map(char ch) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(tm1628_char_ssd_map); i++) { + if (tm1628_char_ssd_map[i].ch == ch) + return tm1628_char_ssd_map[i].segs; + } + + return 0x0; +} + +static int tm1628_display_apply_map(struct tm1628 *s, + struct tm1628_display *display, u8 map) +{ + struct tm1628_segment *segment; + int i; + + for (i = 0; i < 8; i++) { + segment = &display->segments[i]; + tm1628_set_led(s, segment->grid, segment->seg, map & BIT(i)); + } + + return 0; +} + +static ssize_t text_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct tm1628 *s = dev_get_drvdata(dev); + size_t offset, len = count; + u8 map; + int i, ret; + + if (len > 0 && buf[len - 1] == '\n') + len--; + + for (i = 0, offset = 0; i < s->num_displays; i++) { + if (offset < len) { + map = tm1628_get_char_ssd_map(buf[offset]); + offset++; + } else + map = 0x0; + + tm1628_display_apply_map(s, &s->displays[i], map); + } + + ret = tm1628_set_address(s->spi, 0x0); + if (ret) + return ret; + + ret = tm1628_write_data(s->spi, s->data, 14); + if (ret) + return ret; + + return count; +} + +static struct device_attribute tm1628_attr = + __ATTR_WO(text); + +static int tm1628_register_display(struct tm1628 *s, + struct fwnode_handle *node) +{ + struct device *dev = &s->spi->dev; + struct tm1628_display *display; + u32 *reg; + u32 grid, seg; + int i, j, ret, reg_count; + + reg_count = fwnode_property_count_u32(node, "reg"); + if (reg_count < 0) + return reg_count; + + if (reg_count % 2) { + dev_warn(dev, "Ignoring extra cell in %s reg property\n", + fwnode_get_name(node)); + reg_count--; + } + + if (s->displays) { + dev_warn(dev, "Only one display supported\n"); + return -EINVAL; + } + + s->num_displays = reg_count >> 1; + + reg = devm_kzalloc(dev, reg_count * sizeof(*reg), GFP_KERNEL); + if (!reg) + return -ENOMEM; + + ret = fwnode_property_read_u32_array(node, "reg", reg, reg_count); + if (ret) { + dev_err(dev, "Reading %s reg property failed (%d)\n", + fwnode_get_name(node), ret); + return ret; + } + + s->displays = devm_kzalloc(dev, s->num_displays * sizeof(*s->displays), GFP_KERNEL); + if (!s->displays) + return -ENOMEM; + + for (i = 0; i < s->num_displays; i++) { + display = &s->displays[i]; + grid = reg[i * 2]; + seg = reg[i * 2 + 1]; + if (grid == 0 && seg != 0) { + if (!tm1628_is_valid_seg(s, seg)) { + dev_warn(dev, "%s reg out of range\n", fwnode_get_name(node)); + return -EINVAL; + } + grid = s->info->modes[s->mode_index].grid_mask; + for (j = 0; grid && j < 7; j++) { + display->segments[j].seg = seg; + display->segments[j].grid = __ffs(grid); + grid &= ~BIT(display->segments[j].grid); + } + } else if (grid != 0 && seg == 0) { + if (!tm1628_is_valid_grid(s, grid)) { + dev_warn(dev, "%s reg out of range\n", fwnode_get_name(node)); + return -EINVAL; + } + seg = s->info->modes[s->mode_index].seg_mask; + for (j = 0; seg && j < 8; j++) { + display->segments[j].grid = grid; + display->segments[j].seg = __ffs(seg); + seg &= ~BIT(display->segments[j].seg); + } + } + } + + devm_kfree(dev, reg); + + device_create_file(dev, &tm1628_attr); + + return 0; +} + /* Work around __builtin_popcount() */ static u32 tm1628_grid_popcount(u8 grid_mask) { @@ -325,7 +545,7 @@ static int tm1628_spi_probe(struct spi_device *spi) return ret; } - if (fwnode_property_count_u32(child, "reg") == 2) { + if (reg[0] != 0 && reg[1] != 0 && fwnode_property_count_u32(child, "reg") == 2) { ret = tm1628_register_led(s, child, reg[0], reg[1], &s->leds[i++]); if (ret && ret != -EINVAL) { dev_err(&spi->dev, "Failed to register LED %s (%d)\n", @@ -334,6 +554,14 @@ static int tm1628_spi_probe(struct spi_device *spi) return ret; } s->num_leds++; + } else { + ret = tm1628_register_display(s, child); + if (ret) { + dev_err(&spi->dev, "Failed to register display %s (%d)\n", + fwnode_get_name(child), ret); + fwnode_handle_put(child); + return ret; + } } } From patchwork Thu Dec 12 03:39:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A7F114E3 for ; Thu, 12 Dec 2019 03:45:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0302D214D8 for ; Thu, 12 Dec 2019 03:45:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LnmANsTM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0302D214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8uskCswOcY9MxtsGcN0aA0bq93SiPKO9Hc5X/WYvH4A=; b=LnmANsTMTRy23N O47qlQpTHlfuRzJpJqkAxunlUrfDtn9Sqn+74ks1IBJUT3+2hrVDLmG7z+ZM84ZriU9MkyqfLVHVo RGzgdb6ZI1F7iJPU5Ed4kv8WXYIYICyy7Ztf0W1n8ALc5PHjjzEmr1segZu6BozDrxQ9QhKQro78H VAUzLlmgGyEOOVqUgD7VbUcM8bjr3pjRiuENCQWQarY/wrvqD/VA9JN7lJXhnjZwK0OF620bdpBpY Z5J2Wh7Mj9hklxhq58OsewOrSBtsGgW7yH+s09YVvxQfSDW8WuN067UzxfgNWsztSDJqrqYToP7Qc xiumLI+ZFJddhvRyhdqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFPi-0007gU-DF; Thu, 12 Dec 2019 03:45:18 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKj-0000r7-Hp; Thu, 12 Dec 2019 03:40:16 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6AD9EAF99; Thu, 12 Dec 2019 03:40:06 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 20/25] arm64: dts: realtek: rtd1295-zidoo-x9s: Add display to TM1628 Date: Thu, 12 Dec 2019 04:39:47 +0100 Message-Id: <20191212033952.5967-21-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194010_056023_0FCE76F4 X-CRM114-Status: UNSURE ( 7.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Roc He , linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a child node for 4-digit 7-segment display. Cc: Roc He Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts index 219b4987412c..6c2337e9282f 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-zidoo-x9s.dts @@ -64,6 +64,10 @@ #address-cells = <2>; #size-cells = <0>; + display@0,10 { + reg = <0 10>, <0 9>, <0 8>, <0 7>; + }; + colon@5,4 { reg = <5 4>; color = ; From patchwork Thu Dec 12 03:39:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286941 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53EE914E3 for ; Thu, 12 Dec 2019 03:45:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 32683214D8 for ; Thu, 12 Dec 2019 03:45:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E38UmXMk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32683214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q/ZO7mIRMn1uADZJ4HD6l9LarIEQZQ54Y7M2yPLI1Iw=; b=E38UmXMkZpSISh M5KpM9eCoY6cpy5HYRM5ihC/VBFIHz2U/MH46UhW3uMpsvwSsZsy/siNFGRx+hFKaJz/UQEPJkv69 TtV187Cb41k+hCvS10maxKHM6ne9ff1hxHGslA8R9osFlSrUt9FOKtBkw5BK6RbbN1xv6kHv+QVJc O0h49FqBQQLOZuQq23nWhJyV6jMEqd6zC7CegzUEyWXkuHu48mplTQSATxMUDyjSkEgnk8jTBZmCb 9Y2Uq4nCrpHAkEA2tS29avQu1NZiVzCbiDlcaTyMZOlbz+eNiGK7v5ysFMov4BnC3lzjNaEUovkYt pEJ7EJ12FmgTLnAhf89g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFQ9-00088m-UT; Thu, 12 Dec 2019 03:45:45 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKk-0000t8-9v; Thu, 12 Dec 2019 03:40:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E4FFBAD7B; Thu, 12 Dec 2019 03:40:06 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 21/25] arm64: dts: realtek: rtd1295-xnano-x5: Add display to FD628 Date: Thu, 12 Dec 2019 04:39:48 +0100 Message-Id: <20191212033952.5967-22-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194010_549607_66706D2C X-CRM114-Status: UNSURE ( 8.06 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a child node for 4-digit 7-segment display. Signed-off-by: Andreas Färber --- arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts index 9d678b300c7b..07de95427874 100644 --- a/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts +++ b/arch/arm64/boot/dts/realtek/rtd1295-xnano-x5.dts @@ -47,6 +47,10 @@ #address-cells = <2>; #size-cells = <0>; + display@0,8 { + reg = <0 8>, <0 7>, <0 6>, <0 5>; + }; + apps@1,4 { reg = <1 4>; color = ; From patchwork Thu Dec 12 03:39:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D033C138D for ; Thu, 12 Dec 2019 03:44:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A986C214D8 for ; Thu, 12 Dec 2019 03:44:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ur+iuzAI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A986C214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bMrVpEZOIYxpCY+s5yEnamgXOfWbldu4CFFCks3Y4UM=; b=Ur+iuzAIaZXbEq BtUeC6cSpgJ3EfrWGHSdleoKgvL9gLHHBqySCmS725c+upX+URvT/F8L2nYKYH064DC8L27s0CWnZ tVXsRDNk7BD/1f2wEIU+hcp+aDjysLrw0yS87aq4h4ZhdAsJvTyXYOtRmUWynKjqZ5Y7MGzgNP37g s8lZ53mBcQ3WTcUBlFZ1gh6rVcakvl97cYCS3XuIMHclbLInDVfobLwsXiaqC2NHaeSKNQe5yaT52 K9WIkuwpe73yC9x4RYamb/TbLPUlCAXkffPui6u698/2C8BsExd+mCr/ETdMM8m/EHUqvk496kmBw Tdv4Fi5GBiSMvtp57j0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFP9-00060j-Ie; Thu, 12 Dec 2019 03:44:43 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKj-0000tc-AZ; Thu, 12 Dec 2019 03:40:15 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 66D56AF43; Thu, 12 Dec 2019 03:40:07 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 22/25] leds: tm1826: Add combined glyph support Date: Thu, 12 Dec 2019 04:39:49 +0100 Message-Id: <20191212033952.5967-23-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194009_638467_053758E7 X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allow to squeeze the text "HEllO" into a 4-digit display, as seen on MeLE V9 TV box. Enable this combining mode only if the text would overflow. Signed-off-by: Andreas Färber --- drivers/leds/leds-tm1628.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index e2c2a5d91596..0c0d099de8b0 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -347,6 +347,28 @@ static u8 tm1628_get_char_ssd_map(char ch) return 0x0; } +struct tm1628_ssd_glyph { + char *str; + u8 segs; +}; + +static const struct tm1628_ssd_glyph tm1628_glyph_ssd_map[] = { + { "ll", SSD_TOP_LEFT | SSD_BOTTOM_LEFT | + SSD_TOP_RIGHT | SSD_BOTTOM_RIGHT }, +}; + +static u8 tm1628_get_glyph_ssd_map(const char *str) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(tm1628_glyph_ssd_map); i++) { + if (!strncmp(tm1628_glyph_ssd_map[i].str, str, 2)) + return tm1628_glyph_ssd_map[i].segs; + } + + return 0x0; +} + static int tm1628_display_apply_map(struct tm1628 *s, struct tm1628_display *display, u8 map) { @@ -366,7 +388,7 @@ static ssize_t text_store(struct device *dev, { struct tm1628 *s = dev_get_drvdata(dev); size_t offset, len = count; - u8 map; + u8 map, glyph_map; int i, ret; if (len > 0 && buf[len - 1] == '\n') @@ -375,6 +397,13 @@ static ssize_t text_store(struct device *dev, for (i = 0, offset = 0; i < s->num_displays; i++) { if (offset < len) { map = tm1628_get_char_ssd_map(buf[offset]); + if (offset + 1 < len && len > s->num_displays) { + glyph_map = tm1628_get_glyph_ssd_map(buf + offset); + if (glyph_map) { + map = glyph_map; + offset++; + } + } offset++; } else map = 0x0; From patchwork Thu Dec 12 03:39:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286945 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 573B8138D for ; Thu, 12 Dec 2019 03:46:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 35D40214D8 for ; Thu, 12 Dec 2019 03:46:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n4rieGpF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35D40214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G1ZSfSpy3P05SH7yGVDsGDELBy53gmJmLSnKoSxWc0w=; b=n4rieGpF86ToFu xsDz4DVRF/JWPshB8k+/Txompt0A7Du7XordE5EMiCrgifGdvIc0h956vzBDQUKpu9EPinH3yBEZb G1WiW3q0meaDA49uEgXoVwwUe3LntIKBIgvZOwPD5+u/GuWt/tbzsovIr2gxOvrXD2Ok4NxXFWAyx nVI3qxQZiND/E8Z4BCZ6uBVXp46B9xVbZc8v7d1LZfoa6+lj41Yw3JB8mF6BxeJBnFbzMLL+CtKNR WYpoBn4PDTccvrdppBtS/4Gn0LTL3iCxdjJC/Py8k2mSGgA9mF/kliMkQ670ze2HvcgOJ2fw/BILj /iBWR2IcVhyXeSKo+FXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFQd-0000DU-2N; Thu, 12 Dec 2019 03:46:15 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKm-00015V-4R; Thu, 12 Dec 2019 03:40:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CD6E8AF27; Thu, 12 Dec 2019 03:40:07 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 23/25] WIP: leds: tm1628: Prepare TM1628 keys Date: Thu, 12 Dec 2019 04:39:50 +0100 Message-Id: <20191212033952.5967-24-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194012_516391_D9664459 X-CRM114-Status: UNSURE ( 7.49 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , zypeng@titanmec.com, =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Extend TM1628 definition with key input lines. Cc: zypeng@titanmec.com Signed-off-by: Andreas Färber --- drivers/leds/leds-tm1628.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 0c0d099de8b0..410f34234811 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -43,6 +43,8 @@ struct tm1628_info { u16 seg_mask; const struct tm1628_mode *modes; int default_mode; + u8 k_mask; + u16 ks_mask; const struct pwm_capture *pwm_map; int default_pwm; }; @@ -656,6 +658,8 @@ static const struct tm1628_info tm1628_info = { .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), .modes = tm1628_modes, .default_mode = 3, + .k_mask = GENMASK(2, 1), + .ks_mask = GENMASK(10, 1), .pwm_map = tm1628_pwm_map, .default_pwm = 0, }; From patchwork Thu Dec 12 03:39:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286949 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6324A14E3 for ; Thu, 12 Dec 2019 03:46:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4185B214D8 for ; Thu, 12 Dec 2019 03:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RRZHnpee" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4185B214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eC+Yw4QniP/kTk+h2jJpERKCD3zNU5AOzoq5eLWfi5s=; b=RRZHnpeeCp55Py 2eszx/xcODKPLlUKcTYJmUP9Osekk7x9uRXV04cEFjrzU25OZnzC9r/rPV5BWwrf9CwLD2kkVsLX4 87L1lU86egnh0tdiTMxG6sn784rOURKHcQEcB69VF9zzb50cWkykUj/9HpsaViDU9cr6mhCwTY3lk Q1Fl6MP+X0pu9CvDDc92Ln+xi4E370HXmgMtCjptP+DIboDpNzttK1xd6t3hmKmRnI/ijxdiozi0f I2b3iqj1KY8o+utrWwrjWiYbj16gcKGt1piJwOzmMGGum/KXQqVmTXmCa8u9x8kwmB5uwna6Kp5BI Carra75kKmSjUcmvl4XA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFR3-0000ij-Pa; Thu, 12 Dec 2019 03:46:41 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKm-00015W-0e; Thu, 12 Dec 2019 03:40:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 578A8AF65; Thu, 12 Dec 2019 03:40:08 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 24/25] WIP: leds: tm1628: Prepare FD628 keys Date: Thu, 12 Dec 2019 04:39:51 +0100 Message-Id: <20191212033952.5967-25-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194012_331661_E76B7D94 X-CRM114-Status: UNSURE ( 7.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sales@fdhisi.com, linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Extend definition with key input lines. Cc: sales@fdhisi.com Signed-off-by: Andreas Färber --- drivers/leds/leds-tm1628.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 410f34234811..2caf1e63fc90 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -669,6 +669,8 @@ static const struct tm1628_info fd628_info = { .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), .modes = tm1628_modes, .default_mode = 3, + .k_mask = GENMASK(2, 1), + .ks_mask = GENMASK(10, 1), .pwm_map = tm1628_pwm_map, .default_pwm = 0, }; From patchwork Thu Dec 12 03:39:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286943 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73F27138D for ; Thu, 12 Dec 2019 03:46:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5252721655 for ; Thu, 12 Dec 2019 03:46:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pb6KVprh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5252721655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UB3vFttS8s8WrubOdjH4fKDgEgOF6gp2K4nfvtlgj8I=; b=pb6KVprhpRhGQG X+dJKXgvXf83UwOocceMOuBMMOmscvtuBJUpdNy6/kOUMVOpPRPh5hm4IIhRJNpNXPLZvRG7ap44x Dtw8jbnrvRSM+ttNcmHIvXEUy3cvfyfBShOrrzkoH5qTkDlsdNZBQV8y3GyjkZlNIqA9YOWuf3T3w eNTez7ZZYD2Eml4LzMCxaETKFcFRQQeQ/P4SJXW4kyiLRI0bQ4AacjrhZUAK2Ek3DBYbaRYUgo6GE p09Gz/IluExh+qvtxBjuslJZDRZvBr91uMcWBnTGgWi3g4RhyoUX9A/u9c4towter9hYg+ngDkOsR KheznTkeZR7MsoZxCoRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFQO-0008Px-DY; Thu, 12 Dec 2019 03:46:00 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKm-00018R-C7; Thu, 12 Dec 2019 03:40:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CDFB0ADE1; Thu, 12 Dec 2019 03:40:08 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 25/25] WIP: leds: tm1628: Prepare AiP1618 keys Date: Thu, 12 Dec 2019 04:39:52 +0100 Message-Id: <20191212033952.5967-26-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194012_844740_232986B6 X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Extend definition with key input lines. Signed-off-by: Andreas Färber --- drivers/leds/leds-tm1628.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 2caf1e63fc90..e28809d9a700 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -699,6 +699,8 @@ static const struct tm1628_info aip1618_info = { .seg_mask = GENMASK(14, 12) | GENMASK(5, 1), .modes = aip1618_modes, .default_mode = 3, + .k_mask = BIT(2), + .ks_mask = GENMASK(5, 1), .pwm_map = tm1628_pwm_map, .default_pwm = 0, };