From patchwork Sat Jun 20 22:42:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617629 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 C7525912 for ; Mon, 22 Jun 2020 12:47:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7232220738 for ; Mon, 22 Jun 2020 12:47:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NLMfUViI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OY7KbBAk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="JJlLzu+E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7232220738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=gSE6w1ErkZFPngqMYUVvyvsxgAGgOIT5niUDQbapa3I=; b=NLMfUViIzq9qrWiYn5wZkAOapk t3Ig7P8Phaej8j0nghG3JF0JWx6y5T0QOHQz0ilwHcogOWzJR363HjFR7kUbYwOFlpAPZIyO/V9/o KSkqTgFQ16hU0eck3Bilj+nSzgw6V5j8DWHlDhyn+ZYQBa3ajV9CAQ8wxPdzOFM5tuYJcMYqEEzz0 eiCnr9/fnPp1ve5/OrJdGB7FPNB1E3ElZ/dxH94lEGHZ59YcMSK5sVpZqnAG4wna1NfVmeEnUxKBV npa5XWjYSybtt9ex93mA3txc1690kbc3cM5W8pLN+zCdLMGE8dn4QjPxaMwlFjDPWp/dlKk+UCFY+ 87pKgTmA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLnM-0000MZ-PS; Mon, 22 Jun 2020 12:43:28 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLke-0006X9-Nw for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:40:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=9deCU6Vjl2RtNhSj9oISDIzFlWvZBnEvvOd4fhGySYA=; b=OY7KbBAkXwyK1XlLYARnsGtj2x YWhjk30VoGmHvLj9+t+Qt4bEMZNTSUXr0UJYM8gSKgVpDSEaFnGCfsF1GMK8zfq4aseMCHbjHshVI fwMtbxn6Sn8mIEGZE/j4y5RAhA5Ii/d9d1229iLbZXWCBYrmpJGs/CBX4D0qgxrY30LEQ4Z2uunx2 JFIjaMwGcYSYXPS6LsWNu02U+8kWzNrJVwmQnmRFThJIc/FBZeZ8mczbfPD3iMlteCaPeeLWjCjn5 zDrACfnCSTWwGakHU3w9TlvajfqdyNTaYb1QjNZ27IMkCJ4bxrrX8rkAlxm+cHq8lDwEBVoz2X+o7 Kl+AG8PQ==; Received: from mout.gmx.net ([212.227.17.21]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCv-0008GT-4f for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692947; bh=OudamScKxsSwesQWI5fhg8i4uztyIzbbtXHCU+btXqg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=JJlLzu+EP2kHN1UTDpUwB6LsqYgcAztufiCAgWCcxVFKraKCiYMrmS+mXlItATNNc Ar2ZNr4QuMEd1/btmPM4zx9DQe1/1C/Ki4Grla16r4HglxaDLrhr3slsSc2iXWxzcg iPLI2pWnBBJ38Vv5EeauBsNsISVxdiCIdDGhLFy8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M4s51-1jlPPh33Ch-0022vZ; Sun, 21 Jun 2020 00:42:26 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 02/10] dt-bindings: Add vendor prefix for Netronix, Inc. Date: Sun, 21 Jun 2020 00:42:13 +0200 Message-Id: <20200620224222.1312520-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:yZqldghSPumPDLmSQbkIreQsfprG56cHRfGVJLO/YVdhlg8pdjP qZiYkkWMBRqMgwiDDZxJ/FCfw8bxfnQru0qx9L7azU4/GJDQAEj3hBxzxC5XMdXgaq80k6Y SHT+PXTXWZyf8p9LmwX14SH2+bFjtxTBBb9kbDuWJfCuNiZWshywX2QCJaoqMczHJC6Q/50 Jg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DeXeBw93/uNzFEGV3wZ7m/RwjtjoR9zZUQFnZUYA US1nlqIwAY5Dq6mZcFv0w8eFA6mBmnO1qA/pSzihnRaemJPqBZccuknxaQJ8IaAwL3mEDR3GH vMpRDMTFujK3T8upXyiZVDnqBlgx21pKIOvv8txYkHugk9kedVQGtxKT98Wz5r0fqkz+cIwDb KXYWUc+ZoCBB5uWY1GKLQiYDQzU8VrTak0TZMvQxC2K+njpePApu/khJrp/lKWlzKaPzWZ/Ih jixY0YPWy90Yjy2NK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234329_363442_6351F5C0 X-CRM114-Status: GOOD ( 10.83 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.21 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.21 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Netronix, Inc. (http://www.netronixinc.com/) makes ebook reader board designs, which are for example used in Kobo and Tolino devices. An alternative prefix for Netronix would be "ntx", which is already used in code released by Netronix. It is shorter, but perhaps less clear. Signed-off-by: Jonathan Neuschäfer --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) -- 2.27.0 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 9aeab66be85fc..516c6b6668fba 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -704,6 +704,8 @@ patternProperties: description: Broadcom Corporation (formerly NetLogic Microsystems) "^netron-dy,.*": description: Netron DY + "^netronix,.*": + description: Netronix, Inc. "^netxeon,.*": description: Shenzhen Netxeon Technology CO., LTD "^neweast,.*": From patchwork Sat Jun 20 22:42:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617665 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 855BB13A0 for ; Mon, 22 Jun 2020 13:11:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5917320768 for ; Mon, 22 Jun 2020 13:11:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="odA2HJrO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ok1cP/ao"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="FvOk5311" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5917320768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=1oFVdu2LX7br+KjrDBU1m3309f/awUeHX21VzPG/eqg=; b=odA2HJrOzYxfP8vVii/7mkfYC yOcdbdW35BCQ7NzDeCYPAZSFE3shVLG/b/q30t8c9iVVogGTyEZ+DVrgcAZCzUSL0aoRQMyRV5mGM 4gP0XzU1QtV4s1MdF4qYURMM3dlqaEk+tmnUgy7MuS4HnVCiHdoIBGDrsL2UW7VcTGcLlSTEdgVKK PZX7821y2IhoV0+GCSLHicokPm9eTmgLHaQAUX7zaqou8zxMfd/r/ipiN/+H6lTTF9s1YhLqpRRmz lk/VXbiDaV3ecRdOGy12Q8Ul3Dzh3ynzJljmvnnNgvOWGYGNPYEnefl5RAt/b3mcG6FTTGLeyXiVx cRq0FqFGA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMBR-0001gI-CM; Mon, 22 Jun 2020 13:08:21 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLuR-0003Wl-Aq for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:50:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=qAvxnaOljZKDnE1UQNbSuXrJj3ATEGOHW/0BBg68cDo=; b=ok1cP/ao8zJFhkywPru5AHYThr 5XwxjQJxZpvb6j/ohZGMabl013McuyV6wwO1zAwhPkn5OGxfE9H09c29kjahVE8x15RddD2IRtxcm 3H/BRteZkg4PZ75w+7QTzDyzRTjXtATlKx7hx2r3AK0dpsHgX9DUnT/NogR4IicymnmhNy1Fl1RDE qezFV0IUAZ4iKROuEgPZDZRp1qGh7RyrI5WnCv/ucyRo8r080H2HeW9304AlwFs5HbfwWnujFBVyh WRjqLh9tJN9jh16G4AvIp/n/b1NVTZD3UKJF5Q17x5zZ3Q70ezw0cEWaCQEgEWJQHYKiWiS843vci RkG6tbGg==; Received: from mout.gmx.net ([212.227.17.22]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCp-0008FS-FB for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692949; bh=fz9iJvS+IQADqhRoQ/zH92wyy5n1baG4XghBRzehFfE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=FvOk5311cG2uyND48G8BKzya2u9fpnzaHK8YmvdJKt7M50kVWwih9sHWwaiS8M3sP BtgpHe3JYcdxUgJFJre3O6v7nIwP2dOB7jUccvNBJwfy5UfqbDmKfa04CvoyXDhH6P 7zDO9qrru+atBrEKXrG6QomzjJG03XZj3te4JOE4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MIx3C-1jSVUF2jyU-00KNXT; Sun, 21 Jun 2020 00:42:29 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 03/10] dt-bindings: mfd: Add binding for Netronix's embedded controller Date: Sun, 21 Jun 2020 00:42:14 +0200 Message-Id: <20200620224222.1312520-2-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:QskTcHILhGvocIQPvfd8FUOVQFGG/i9pz7IBgR13JIg2w4J5Spj zrU3wG1ZFT6FxWvc0CbTK0QAWqyc7FSbsTspi1g6jgJSJXPbILQ+pCY46jXupZggraGL8iV Rk7sUAPsGFeqgYHzkkEhQlrzu2z2aTn9MM+dYYhYIcaanJTQ/BG4Q71Nqo5cuZYC6A17THV I1j1Nb56pjLV5QKAV6+gQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:QtZPHCNxCyc=:IUkoyC/pOkJHsLV5zwhJyy +cWf4MfNeJK2AUnWJzPpNA2DY+10efIyXrp7CC3rd3nu54sRs2pfKTwbamsgIEq9+TRMVL505 RieT9GtF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nuvCjAYG92JC86F8bwH3C v6A4EaLyXoaBXo+1ES5jqSJeiPZQ3kZ9tU1qIHkY9njfZcN1oWzyf6+h3rAjfKigCjNyxDWLN 7x7HZkTLOWToUzmip X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234323_748801_C61D70C0 X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.22 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This EC is found in e-book readers of multiple brands (e.g. Kobo, Tolino), and is typically implemented as a TI MSP430 microcontroller. It controls different functions of the system, such as power on/off, RTC, PWM for the backlight. The exact functionality provided can vary between boards. Signed-off-by: Jonathan Neuschäfer --- .../bindings/mfd/netronix,ntxec.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml -- 2.27.0 diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml new file mode 100644 index 0000000000000..596df460f98eb --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/netronix,ntxec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Netronix Embedded Controller + +maintainers: + - Jonathan Neuschäfer + +description: | + This EC is found in e-book readers of multiple brands (e.g. Kobo, Tolino), and + is typically implemented as a TI MSP430 microcontroller. + + +properties: + compatible: + const: netronix,ntxec + + reg: + items: + - description: The I2C address of the EC + + system-power-controller: + type: boolean + description: See Documentation/devicetree/bindings/power/power-controller.txt + + interrupts: + minItems: 1 + description: + The EC can signal interrupts via a GPIO line + +required: + - compatible + - reg + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ec: embedded-controller@43 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ntxec>; + + compatible = "netronix,ntxec"; + reg = <0x43>; + system-power-controller; + interrupt-parent = <&gpio4>; + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; + interrupt-controller; + #interrupt-cells = <1>; + }; + }; From patchwork Sat Jun 20 22:42:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11618337 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 CDB6890 for ; Mon, 22 Jun 2020 16:07:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 98A8620738 for ; Mon, 22 Jun 2020 16:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KO+WxznH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="iNnbYG6+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98A8620738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=Bz06e1A9FFetkGdcp5dwK3JF6bD6UOz+Htd8D1vdSbo=; b=KO+WxznHb4JcPnBapswcGUMpo zxknsAVl2VcoFaVbTGwMXIVlY7ix7rhig2zGh6B6dwaS4uAdWQooed8AO4qp4f62ULbjisLWen7IN Oo9HoTZHgiy/+Xs9wBVvlStsh3T0M3IprRxAnF7Jew1COE9GD86gmCw6EuiCVU+vr4zNdlgLWyHt1 lIOgfXyrLOEHxqJiZj37CqR6JH4ri39OMVum+6/xtzW1HLUr7VMp6luFtMmU6F5Lt30kC92TJV6X+ 9tSxyw0cL5CELRr13HtbjDrsTMe4BJbVBjmuzvttjUtV5Kn6lhF9+mRuWB8Oj2S5HOq5MWhOt3X/C pVC3naG9g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnOwi-0003z7-MO; Mon, 22 Jun 2020 16:05:20 +0000 Received: from mout.gmx.net ([212.227.17.20]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCo-0007Ym-I7 for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692952; bh=XXu+luCqljJ0m62RlCeT8CmSkmbKkHxcSLuj0ORt69w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=iNnbYG6+HppRyny7oSDl/zcSixkIlEXLPpZpEPGi3ysfpx7QNmQPi0qppo63xY30w ADOgFudvJBvA5CZihzB85TvnZFodxjammv1ZB6PFWOvPOTQMZ1lSDzqMxuofpZUxDl U/mgB9Y+o/ZD3COw1SsOYIx4QvYxAa4BNsvY4crw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MkYbu-1j0qCE0pzS-00m7TV; Sun, 21 Jun 2020 00:42:32 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 04/10] mfd: Add base driver for Netronix embedded controller Date: Sun, 21 Jun 2020 00:42:15 +0200 Message-Id: <20200620224222.1312520-3-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:1u+AFOJkIXKhSwfcftLBAxIIIFzLSLtOsHVEPr+WI+ygCv/uTZx bP173tXALlMVkmQtxXC3zSy60qVZn2N5fdYQS+pNrKw78Lbqq4x2vINFjsXeXWr3lLN4Arm HmrsGAK25Gemm3fdmo1pd6x3Za5nucsZJeUPOJwe6FlcCdYJcNknAYM0KkfuAbKRq0Wbs9l 5GvBUsY9CW+YIzgQuUS6Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Dd6v43kPPRw=:9CCX267RpV8vvnDACISpr5 uk8XWpwglolUEoOdfm4ML40ZZQF9MNh0RqPQCdos/fDZbKKFXB73EdN9rxPZQT8ErV1UaAzVz FpUEHml2lpxnsR3C5Ayohy6ialKj5tpmolzhUhBX7FUnpFndtdOF+M13RvxJCGSJKPAxynoHw UIyKaX5K6gL04zdSHbntQMfewUBSivQ96bWzk+RbPBh8YS5dtG+aqhIMZ2eEGYkhbyWHzBGee xh1RWlCs0LgBHrLfjQi8+WTxk2K3Kradtj6H3lVdeNT7TpB0VEs6B/OYg7MLFsyeeGLHO/cLT GZ41yJllRiwsjkA47W2M8lvItHEq/k0pO3KZpL4qPGC6Z7u69lotbGGUF04wxyNkK+ws7hkPG TWu6k8rubzALTIrcWOShkOd4dKWuOwJ/jjZTSJNySCpMycQyQc0B01Z8b03Re08BUqidFIQ0g bSlrWJ9SO5MHLxk407BZd5doNAO2hpdwtgkWjzORyYJ2vcm4ry1Ej7miWLehkA3c6nIK6raUa YSbiaz+yNvMs/Hghz1lldY4GrPFkkyvKw3Qhcmd9qscGKrzEPrpZxmiW/6T5rafUYH5xjdwP8 um+uJubO5QCcoKoYYCuZDfuq10fnsonyqe1J4d10rtmgCYl35EVSjfB8unShhU6GaFfHRgWOi GZGbhQhUstTXV0zRoJkekg+4Vwk70aEcpE5zVvsPAvQMfA/09/g/FH3bNvuAeE6H8otGGU7xl 93Yc2oHYEPoE0VGrKsGep00HRGkr6+wz7dBSMO7hqXrwLrqv12jIGKQv9Cha3the6o+GB/o88 PNRkkG2Wcv893itk8J6AqGXZegYCkWdZCLksMw+InGUEymU8rb5dj4TWgwGbjli+RsXNZzvc8 Uk5l9ijLaUJuEfXTcojgJEoGy77UQf7Juj6sdODxD+zPvwTHJUijXSrJKzRMVPGMW27FTNVGs bs7bmaMvzh39VNbacb7mL6xNXmBAUcG/dSQ89Pmk6Q4kjbk9k6/7t8YF/e+pzh1Mqsx0JIOgK yqLU8lMmSFzmbl0H0dsp4jl2Hh28EMByv8KL4rT3BLgQgTJEzS8XYTNXWdDbHFzbdLHJcPZIh etHzCZLWZDlV0a+Kzv9r+FxJ+5QuCAno2wLwiO7rdhbhHS4cYmMr7fJaE9vZO9WUvjLeeorpW lPVHChtORF6mfv96pD0PZ9zA+JWd9ZOb+2bppQOUfRJdJ9/hHY7KIGCFNXKCOxbqKJOZsaNJa xBH09UDGhk/IHmdu2 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Third-party hardware documentation is available at https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-controller The EC supports interrupts, but the driver doesn't make use of them so far. Known problems: - The reboot handler is installed in such a way that it directly calls into the i2c subsystem to send the reboot command to the EC. This means that the reboot handler may sleep, which is not allowed. Signed-off-by: Jonathan Neuschäfer --- drivers/mfd/Kconfig | 7 ++ drivers/mfd/Makefile | 1 + drivers/mfd/ntxec.c | 188 ++++++++++++++++++++++++++++++++++++++ include/linux/mfd/ntxec.h | 30 ++++++ 4 files changed, 226 insertions(+) create mode 100644 drivers/mfd/ntxec.c create mode 100644 include/linux/mfd/ntxec.h -- 2.27.0 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index a37d7d1713820..78410b928648e 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -978,6 +978,13 @@ config MFD_VIPERBOARD You need to select the mfd cell drivers separately. The drivers do not support all features the board exposes. +config MFD_NTXEC + bool "Netronix Embedded Controller" + depends on I2C && OF + help + Say yes here if you want to support the embedded controller of + certain e-book readers designed by the ODM Netronix. + config MFD_RETU tristate "Nokia Retu and Tahvo multi-function device" select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 9367a92f795a6..19d9391ed6f32 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -218,6 +218,7 @@ obj-$(CONFIG_MFD_INTEL_MSIC) += intel_msic.o obj-$(CONFIG_MFD_INTEL_PMC_BXT) += intel_pmc_bxt.o obj-$(CONFIG_MFD_PALMAS) += palmas.o obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o +obj-$(CONFIG_MFD_NTXEC) += ntxec.o obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o obj-$(CONFIG_MFD_RK808) += rk808.o obj-$(CONFIG_MFD_RN5T618) += rn5t618.o diff --git a/drivers/mfd/ntxec.c b/drivers/mfd/ntxec.c new file mode 100644 index 0000000000000..82adea34ea746 --- /dev/null +++ b/drivers/mfd/ntxec.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright 2020 Jonathan Neuschäfer +// +// MFD driver for the usually MSP430-based embedded controller used in certain +// Netronix ebook reader board designs + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NTXEC_VERSION 0x00 +#define NTXEC_POWEROFF 0x50 +#define NTXEC_POWERKEEP 0x70 +#define NTXEC_RESET 0x90 + + +/* Register access */ + +int ntxec_read16(struct ntxec *ec, u8 addr) +{ + u8 request[1] = { addr }; + u8 response[2]; + int res; + + struct i2c_msg msgs[] = { + { + .addr = ec->client->addr, + .flags = ec->client->flags, + .len = sizeof(request), + .buf = request + }, { + .addr = ec->client->addr, + .flags = ec->client->flags | I2C_M_RD, + .len = sizeof(response), + .buf = response + } + }; + + res = i2c_transfer(ec->client->adapter, msgs, ARRAY_SIZE(msgs)); + if (res < 0) + return res; + if (res != ARRAY_SIZE(msgs)) + return -EIO; + + return get_unaligned_be16(response); +} +EXPORT_SYMBOL(ntxec_read16); + +int ntxec_write16(struct ntxec *ec, u8 addr, u16 value) +{ + u8 request[3] = { addr, }; + int res; + + put_unaligned_be16(value, request + 1); + + res = i2c_transfer_buffer_flags(ec->client, request, sizeof(request), + ec->client->flags); + if (res < 0) + return res; + + return 0; +} +EXPORT_SYMBOL(ntxec_write16); + +int ntxec_read8(struct ntxec *ec, u8 addr) +{ + int res = ntxec_read16(ec, addr); + + if (res < 0) + return res; + + return (res >> 8) & 0xff; +} +EXPORT_SYMBOL(ntxec_read8); + +int ntxec_write8(struct ntxec *ec, u8 addr, u8 value) +{ + return ntxec_write16(ec, addr, value << 8); +} +EXPORT_SYMBOL(ntxec_write8); + + +/* Reboot/poweroff handling */ + +static struct ntxec *poweroff_restart_instance; + +static void ntxec_poweroff(void) +{ + ntxec_write8(poweroff_restart_instance, NTXEC_POWEROFF, 0x01); + msleep(5000); +} + +static int ntxec_restart(struct notifier_block *nb, + unsigned long action, void *data) +{ + /* FIXME: The I2C driver sleeps, but restart handlers may not sleep */ + ntxec_write8(poweroff_restart_instance, NTXEC_RESET, 0xff); + /* TODO: delay? */ + return NOTIFY_DONE; +} + +static struct notifier_block ntxec_restart_handler = { + .notifier_call = ntxec_restart, + .priority = 128 +}; + + +/* Driver setup */ + +static int ntxec_probe(struct i2c_client *client, + const struct i2c_device_id *ids) +{ + struct ntxec *ec; + int res; + + ec = devm_kmalloc(&client->dev, sizeof(*ec), GFP_KERNEL); + if (!ec) + return -ENOMEM; + + ec->dev = &client->dev; + ec->client = client; + + /* Determine the firmware version */ + res = ntxec_read16(ec, NTXEC_VERSION); + if (res < 0) { + dev_dbg(ec->dev, "Failed to read firmware version number\n"); + return res; + } + ec->version = res; + + dev_info(ec->dev, + "Netronix embedded controller version %04x detected.\n", + ec->version); + + /* For now, we don't support the new register layout. */ + if (ntxec_has_new_layout(ec)) + return -EOPNOTSUPP; + + if (of_device_is_system_power_controller(ec->dev->of_node)) { + /* + * Set the 'powerkeep' bit. This is necessary on some boards + * in order to keep the system running. + */ + res = ntxec_write8(ec, NTXEC_POWERKEEP, 0x08); + if (res < 0) + return res; + + /* Install poweroff handler */ + WARN_ON(poweroff_restart_instance); + poweroff_restart_instance = ec; + if (pm_power_off != NULL) + /* TODO: Refactor among all poweroff drivers */ + dev_err(ec->dev, "pm_power_off already assigned\n"); + else + pm_power_off = ntxec_poweroff; + + /* Install board reset handler */ + res = register_restart_handler(&ntxec_restart_handler); + if (res < 0) + dev_err(ec->dev, + "Failed to register restart handler: %d\n", res); + } + + i2c_set_clientdata(client, ec); + + return devm_of_platform_populate(ec->dev); +} + +static const struct of_device_id of_ntxec_match_table[] = { + { .compatible = "netronix,ntxec", }, + {} +}; + +static struct i2c_driver ntxec_driver = { + .driver = { + .name = "ntxec", + .of_match_table = of_ntxec_match_table, + }, + .probe = ntxec_probe, +}; +builtin_i2c_driver(ntxec_driver); diff --git a/include/linux/mfd/ntxec.h b/include/linux/mfd/ntxec.h new file mode 100644 index 0000000000000..9f9d6f2141751 --- /dev/null +++ b/include/linux/mfd/ntxec.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2020 Jonathan Neuschäfer + * + * MFD access functions for the Netronix embedded controller. + */ + +#ifndef NTXEC_H +#define NTXEC_H + +#include + +struct ntxec { + struct device *dev; + struct i2c_client *client; + u16 version; + /* TODO: Add a mutex to protect actions consisting of multiple accesses? */ +}; + +static inline bool ntxec_has_new_layout(struct ntxec *ec) +{ + return ec->version == 0xe916; +} + +int ntxec_read16(struct ntxec *ec, u8 addr); +int ntxec_write16(struct ntxec *ec, u8 addr, u16 value); +int ntxec_read8(struct ntxec *ec, u8 addr); +int ntxec_write8(struct ntxec *ec, u8 addr, u8 value); + +#endif From patchwork Sat Jun 20 22:42:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617733 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 4F85F912 for ; Mon, 22 Jun 2020 13:31:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 E653920732 for ; Mon, 22 Jun 2020 13:31:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vzHVNNh1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RWTCu2Ky"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="J+FgROFF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E653920732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=DEv/xVXnJcGXRxu4my7MNPQ0PWZ3lkjxBV3lOHg3WpM=; b=vzHVNNh1WqBXfFz7DQjs98abU qhNpCDd9ZuDpI1xp0+VgP5gpqKHjLoGvI1r6eLwTAYiKJ+/NGMVOiNcbvAQ0RQZn8dzuxK2Hrl8Ws JGurScg827qgl/VFZuZfPUyAO+W8woO0behOAwcFYrvrdWBmDeA/nOIz7FKgTIkkSUG/YzLUe1FsH 91TjLxBPnseID7fPMXN3Fg4KIQQO9O3FkL7rl5Wd3qUDZxotYffR1+qpbuRk75yuBLgV3ikv2VfQd O2f/tKULh4TAq/vnlFdK0wKHR5ur5l//7hLGkkbxINeRhCqJNI7vzsHXFCvAsxadV2wZls6r24I7C 4sxcUA9aw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMUC-00013y-6c; Mon, 22 Jun 2020 13:27:45 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLwd-0004WA-No for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:53:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=06KPuJThpazmn2WcMq8nuwdfCe3hdYtpq4G7d9Z0/lw=; b=RWTCu2KyvIhQvQX6+nInFDveYo jZUu6Fs5f3lKCWb2R8Phjpc+7LSC9HwHkWWteCF79UGgXOxvrnvTgXYPNcfEtmafrNVP85S9WZElw nLt8utVrN3nuM2SsHRWoxiInVEfX/DX99WTQivx7sqhnW48C/d1FuxEZWrox7g9A+PCdYX6XLkQQR GyStAr3ctJkOsQaj5fSc3Cqvoyovdhvy2Vqvca5u/xt49c1jRE9VzdQdA3sXd903sJGYIy89Y3oda S0xT8iO5Ovyy71xfWlB8O6Fgt9GgestG73iMkrY1VqxL7wotCoWtD3Xo+pDrPrfBzw/V1av0afZMM wvZMtYxw==; Received: from mout.gmx.net ([212.227.15.19]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCt-0008G9-Tg for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692955; bh=ndIbgrYQmb2subu3Oe9fLJNTph0wDs4Jgr3O6ddsGCs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=J+FgROFFQ3bRtxN3HX8GAAM80SYvrFVum3jbjkMuDoZv82bbzd7p4v2lwUObmvi9U RKKkU7ABlhhOf3ucQr/YoDYi2VelWwIOv4bta+W+0QX2BbXRhXfTtTs9zySXTLu11L 7T1AUf5LhLDeDqYz6VADvdNbwPyJo8wPvWSJhok8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mzhj9-1j0ZJq0foH-00vh75; Sun, 21 Jun 2020 00:42:35 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC Date: Sun, 21 Jun 2020 00:42:16 +0200 Message-Id: <20200620224222.1312520-4-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:cHtrETJXmtzDsxaAmeos/P2xE+50CNmj6sgaAzFuUOlSUWq/6Ys cqIg7vWmvwXLCa21o6GeBXwf7oIp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asDZZZWjOX/Th2kUcaDN+I /4je8CQoaIG0UGtbZsAkFLy/1LMvLLPS3RZnSBbBgeyqEUOKmMbV1QwweQvoxrDoyxrHMi7Gy f0CXDruLnA9KezIt5srHTBpDD/s8cnyqpoIMkRwLzNo6vntAGe4flze443K5S0lvoeTaE/Lhg FK6WurPDfcgGo7nc0XLaWxFV23mCGRplOl0wIVexTiT7P5ZX+0/H2CBUg1iNb/gUgsUz/OvYr NHO8JLR/iMAhn7YqXEib1JicjAFSXpl7DZCkiwZlBCf0qq3sZ9SQZ65/6ZdcYN44uMkx2/tSr JUicJiTDBAVIjZFgVdM/hOgF2/wViONZSXF3ZCMfWDTBXZHst1/sSne2cl0mqYQKVr5KeVl9W 4L+uoGkI98FY33KXZ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234328_311095_EAF8726D X-CRM114-Status: GOOD ( 16.36 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.19 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.19 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Netronix embedded controller as found in Kobo Aura and Tolino Shine supports one PWM channel, which is used to control the frontlight brightness on these devices. Known problems: - `make dt_binding_check` shows the following warnings: Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: Warning (pwms_property): /example-0/backlight:pwms: cell 2 is not a phandle reference Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: Warning (pwms_property): /example-0/backlight:pwms: Could not get phandle node for (cell 2) Signed-off-by: Jonathan Neuschäfer --- .../bindings/mfd/netronix,ntxec.yaml | 13 ++++++++ .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml -- 2.27.0 diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 596df460f98eb..6562c41c5a9a9 100644 --- a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml +++ b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml @@ -31,6 +31,9 @@ properties: description: The EC can signal interrupts via a GPIO line + pwm: + $ref: ../pwm/netronix,ntxec-pwm.yaml + required: - compatible - reg @@ -53,5 +56,15 @@ examples: interrupts = <11 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <1>; + + ec_pwm: pwm { + compatible = "netronix,ntxec-pwm"; + #pwm-cells = <1>; + }; }; }; + + backlight { + compatible = "pwm-backlight"; + pwms = <&ec_pwm 0 50000>; + }; diff --git a/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml new file mode 100644 index 0000000000000..1dc1b1aba081c --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pwm/netronix,ntxec-pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PWM functionality in Netronix embedded controller + +maintainers: + - Jonathan Neuschäfer + +description: | + See also Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml + + The Netronix EC contains PWM functionality, which is usually used to drive + the backlight LED. + + The following PWM channels are supported: + - 0: The PWM channel controlled by registers 0xa1-0xa7 + +allOf: + - $ref: pwm.yaml# + +properties: + compatible: + const: netronix,ntxec-pwm + + "#pwm-cells": + const: 1 + +required: + - compatible + - "#pwm-cells" From patchwork Sat Jun 20 22:42:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11618581 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 F1810912 for ; Mon, 22 Jun 2020 18:07:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 BE5E420656 for ; Mon, 22 Jun 2020 18:07:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qErbvIYI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="YxTuL3n+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE5E420656 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=Uj1UPEOwosct0Blu5SisqOWq+y1KEge9HpPthjYDxzo=; b=qErbvIYIeualzuDIuy9xp65vr mjKm3muxnSKx7H9baMWG+VZHk2DVKOeq+CKTO/K5vcw3qztF8lpHHBqQCCvkVA71u2B4vLeAX380k tYYDPQQ7aT2hQTsOIs11IYu3cMV3rLVYurT3UrrjzIWqO9A7+P+5PWfp3R3TZYj+0SMc21IL4kDBj uFNJZAJqVFp286fvRXR71AFQB2FkA+HqY/FHlTk4tk0LNJ9x3FylL4pD+Z8reYzysjEhIgdzGY31Q AOVwJKFmJl9ZzVh5n2j3V3+upbf2AXiAJ/wDuObbpgXu5taKWDfdDqY/smOd5eSYylc/AvAroF0aO TKPRud7Cg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnQpP-0001jy-JY; Mon, 22 Jun 2020 18:05:55 +0000 Received: from mout.gmx.net ([212.227.15.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCg-0007YV-9d for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692957; bh=SdBTcHanE6ZbSETuw4jjAPlmlGZ23qUH4Z8rV7FhLqQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=YxTuL3n+V481rorkdamPXRDikXiZ4sMt+CjKxF7N/98UoosFo6tpOzlGWFGEWX8LQ FrAgzp+7ELpv2f3k2RR5PgS5R1JGO7IZDTFM43JWT9mCYGGt8pEr2Gf4fw/nUtyMQ2 Q+DpRzkhb3wal/Nxdl4tv8ABsVmOslJKe86GEpyQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mdeb5-1jDiUW2ILp-00Zk6L; Sun, 21 Jun 2020 00:42:37 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 06/10] pwm: ntxec: Add driver for PWM function in Netronix EC Date: Sun, 21 Jun 2020 00:42:17 +0200 Message-Id: <20200620224222.1312520-5-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:eUueW2vxa2QRAe4bcVFkBFTG7+5ALMF64PP7ISg/TUL89veAYiC zNUGbINCeiB6/qRtz4KAMn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BO840c/djV/zHu+wU6JcMqw+KFRn0 0u65/B84cQqih5Yx8a7xOtriEWAhHpfv3ZHeI9JMTHH8M1k/NP0DL+8Km0UzXzk6JeQVW7knk jF5oAgSsPW/zIMcGLkZ9AEOFE8yT9a5TIbt3DR0psuqpGDr5PZE02aIsPJsD/7vDGTrvak8Vf tZUl7nvsY4ZTUEAFNuqt3IYNu5iW72E7hUUc0uNnWlL5roX0EbiAvzwUd4xq8xY2dXGLylqf1 ihgWpydBZJmc7tNGYNVVnq7qR/TXMrVcC/N33Cm5PT/0FSFUyAcP+iNDzoK/AHvRF8vo5KIM0 Z3i9Evmup2f6fATU3TCUE57JimLZ8AQ+egNfAs8lJZyQdojNsC4jM97SsQ1pjQyDwg4uxzE6K P28bc+lylSvUrFUxi X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.15 listed in list.dnswl.org] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Netronix EC provides a PWM output, which is used for the backlight on ebook readers. This patches adds a driver for the PWM output. Signed-off-by: Jonathan Neuschäfer --- drivers/pwm/Kconfig | 4 ++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ntxec.c | 148 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 drivers/pwm/pwm-ntxec.c -- 2.27.0 diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index cb8d739067d2f..147d6629e662c 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -350,6 +350,10 @@ config PWM_MXS To compile this driver as a module, choose M here: the module will be called pwm-mxs. +config PWM_NTXEC + tristate "Netronix embedded controller PWM support" + depends on MFD_NTXEC && OF + config PWM_OMAP_DMTIMER tristate "OMAP Dual-Mode Timer PWM support" depends on OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index a59c710e98c76..15507a6d9ca12 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_PWM_MESON) += pwm-meson.o obj-$(CONFIG_PWM_MEDIATEK) += pwm-mediatek.o obj-$(CONFIG_PWM_MTK_DISP) += pwm-mtk-disp.o obj-$(CONFIG_PWM_MXS) += pwm-mxs.o +obj-$(CONFIG_PWM_NTXEC) += pwm-ntxec.o obj-$(CONFIG_PWM_OMAP_DMTIMER) += pwm-omap-dmtimer.o obj-$(CONFIG_PWM_PCA9685) += pwm-pca9685.o obj-$(CONFIG_PWM_PUV3) += pwm-puv3.o diff --git a/drivers/pwm/pwm-ntxec.c b/drivers/pwm/pwm-ntxec.c new file mode 100644 index 0000000000000..eca305d8e915b --- /dev/null +++ b/drivers/pwm/pwm-ntxec.c @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright 2020 Jonathan Neuschäfer +// +// PWM driver for Netronix embedded controller. + +#include +#include +#include +#include +#include +#include + +struct ntxec_pwm { + struct device *dev; + struct ntxec *ec; + struct pwm_chip chip; +}; + +static struct ntxec_pwm *pwmchip_to_pwm(struct pwm_chip *chip) +{ + return container_of(chip, struct ntxec_pwm, chip); +} + +#define NTXEC_UNK_A 0xa1 +#define NTXEC_UNK_B 0xa2 +#define NTXEC_ENABLE 0xa3 +#define NTXEC_PERIOD_LOW 0xa4 +#define NTXEC_PERIOD_HIGH 0xa5 +#define NTXEC_DUTY_LOW 0xa6 +#define NTXEC_DUTY_HIGH 0xa7 + +/* + * The time base used in the EC is 8MHz, or 125ns. Period and duty cycle are + * measured in this unit. + */ +static int ntxec_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm_dev, + int duty_ns, int period_ns) +{ + struct ntxec_pwm *pwm = pwmchip_to_pwm(chip); + uint64_t duty = duty_ns; + uint64_t period = period_ns; + int res = 0; + + do_div(period, 125); + if (period > 0xffff) { + dev_warn(pwm->dev, + "Period is not representable in 16 bits: %llu\n", period); + return -ERANGE; + } + + do_div(duty, 125); + if (duty > 0xffff) { + dev_warn(pwm->dev, "Duty cycle is not representable in 16 bits: %llu\n", + duty); + return -ERANGE; + } + + res |= ntxec_write8(pwm->ec, NTXEC_PERIOD_HIGH, period >> 8); + res |= ntxec_write8(pwm->ec, NTXEC_PERIOD_LOW, period); + res |= ntxec_write8(pwm->ec, NTXEC_DUTY_HIGH, duty >> 8); + res |= ntxec_write8(pwm->ec, NTXEC_DUTY_LOW, duty); + + return (res < 0) ? -EIO : 0; +} + +static int ntxec_pwm_enable(struct pwm_chip *chip, + struct pwm_device *pwm_dev) +{ + struct ntxec_pwm *pwm = pwmchip_to_pwm(chip); + + return ntxec_write8(pwm->ec, NTXEC_ENABLE, 1); +} + +static void ntxec_pwm_disable(struct pwm_chip *chip, + struct pwm_device *pwm_dev) +{ + struct ntxec_pwm *pwm = pwmchip_to_pwm(chip); + + ntxec_write8(pwm->ec, NTXEC_ENABLE, 0); +} + +static struct pwm_ops ntxec_pwm_ops = { + .config = ntxec_pwm_config, + .enable = ntxec_pwm_enable, + .disable = ntxec_pwm_disable, + .owner = THIS_MODULE, +}; + +static int ntxec_pwm_probe(struct platform_device *pdev) +{ + struct ntxec *ec = dev_get_drvdata(pdev->dev.parent); + struct ntxec_pwm *pwm; + struct pwm_chip *chip; + int res; + + pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL); + if (!pwm) + return -ENOMEM; + + pwm->ec = ec; + pwm->dev = &pdev->dev; + + chip = &pwm->chip; + chip->dev = &pdev->dev; + chip->ops = &ntxec_pwm_ops; + chip->base = -1; + chip->npwm = 1; + + res = pwmchip_add(chip); + if (res < 0) + return res; + + platform_set_drvdata(pdev, pwm); + + res |= ntxec_write8(pwm->ec, NTXEC_ENABLE, 0); + res |= ntxec_write8(pwm->ec, NTXEC_UNK_A, 0xff); + res |= ntxec_write8(pwm->ec, NTXEC_UNK_B, 0xff); + + return (res < 0) ? -EIO : 0; +} + +static int ntxec_pwm_remove(struct platform_device *pdev) +{ + struct ntxec_pwm *pwm = platform_get_drvdata(pdev); + struct pwm_chip *chip = &pwm->chip; + + return pwmchip_remove(chip); +} + +static const struct of_device_id ntxec_pwm_of_match[] = { + { .compatible = "netronix,ntxec-pwm" }, + { }, +}; +MODULE_DEVICE_TABLE(of, ntxec_pwm_of_match); + +static struct platform_driver ntxec_pwm_driver = { + .driver = { + .name = "ntxec-pwm", + .of_match_table = ntxec_pwm_of_match, + }, + .probe = ntxec_pwm_probe, + .remove = ntxec_pwm_remove, +}; +module_platform_driver(ntxec_pwm_driver); + +MODULE_AUTHOR("Jonathan Neuschäfer "); +MODULE_DESCRIPTION("PWM driver for Netronix EC"); +MODULE_LICENSE("GPL"); From patchwork Sat Jun 20 22:42:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617641 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 9FCBE13A0 for ; Mon, 22 Jun 2020 12:52:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 784E32070E for ; Mon, 22 Jun 2020 12:52: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="GzCKDBCJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="T7RpgiXd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="jXPADqgs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 784E32070E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=iIndOV/fBzcNOxw14Zfr1Fs4B4slfKjJyMlGLFMiAM8=; b=GzCKDBCJHD0Oqe0zAIXZfR+fg A1kaaWrTKBJ8meXIiOeEJx95HxHM+pHUMfVGmeqUWeGuO44ivxyXKUVDcrAe23bxVeS8FsgQ7BNDQ Sn4vuPG2HPV33IukCTH1p1ZwUL2+w/EMB2KbGQZZWYj8bZTaZ26ED6YKIpaehHtlYJHQV9woDeKlm cFW2S7xkVI8ntHkFV40ldJfqohcjPJhMWx+00ChJIMCz4joygiiaFNGXOdSUarOMbzymSc/2pkN4s K28S4uUexdhF8QqNQRgA4MEVr7iZWGGK/NVy2jfXcKkpsViVgi6uZ6gWn4C8r9Qd/R2S4TJf3QBOL xw4uy6u7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLrb-0002Dg-KA; Mon, 22 Jun 2020 12:47:51 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLlR-0006uI-RD for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:41:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=KWvliYBVtciYbIgEWScOqXmCjE2ErLBRzNkWaiPp9Vw=; b=T7RpgiXdaJEYqzxXgne1+rDlqL 09CDIN1Qln1rcATSmocyAe8DKssCsB4BSyUKrXehx5SomjVmhN8CqmOiRse3hL8QJHtKRuPzWTHj0 QAjH06nB+eiQPG8lH1Aek7Jh0jCvJTdD+xua1AIuQsyDAZwhaM299NdFDPo+9HPU4sbg+x9Ph2kbx 8X+berOfcfXfUo8HgDZc2nuSBa+P4k5l5t508i1yKra+Q+EsI9bfc78f+Ea4J7V5W3UxSinZb2rhF lnmdWQ4T85DlEMG+JfMas5odqjFLuo3P07a6gw4fPiU2zresTtPCv8iw4DLvW824XQ5Kq0MC6RNid XhF1P+2w==; Received: from mout.gmx.net ([212.227.17.20]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCs-0008Fk-PE for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692960; bh=quWpSURYzI37HAY+ZRXyoXMx0x6xymIR9XadTNWbOm0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=jXPADqgsQRfGRq3jn39dE8CWtm9UG80OHy4kt1PrelCzVkXkybJYMQphTkqHVBJPP YLLnHZSdABYy1qBb26AMLiEERbuGCVV7DGKhldESZJ8O/um3jRfTMWYVgUr0dpqXBl H2aQzH9d7skrZZ34gaihGa/eIu/8MAeG72wXESfI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MybGX-1ixHWs3fLx-00yvXe; Sun, 21 Jun 2020 00:42:40 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 07/10] dt-bindings: rtc: Add bindings for Netronix embedded controller RTC Date: Sun, 21 Jun 2020 00:42:18 +0200 Message-Id: <20200620224222.1312520-6-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <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s7BehJF5VVBQc37TIp m7SSMZnLXXnVAa+0rGwRd7+8OqpeUg2PKViDWJpo22mt0fIXjgNwpu8oH8cwPWJg2t8iii9jv WVMw0tgfK00/RwA42SUEZGmay+gZw4/CgkSjttfjvgzZyT2T35bQAFFScpjE7n5FWn6Jr8aNP e5CUOCuH9ccb2VF3wuRXDA+9ifLavvO1I95VLxybYSxaVQRwaxykN1Q7m+BdQMYDMR5J3Rn+r g6b2pQA4ozXIa7tGrJXzcIdLFApeYA5h0SpHETeMHznHyf3lBug26ikiIK9SK8UINPXY9/WdD WEt/jx1rTFj0Dldgk1uWPcevCtU3UelskVKKc0pzRDK9Q39xZd5CjZzFDNqBtKDYUC6w8PwlZ qkIrrp4Jc/NstteeqCcs4awLU2EZ672W7G1LV8+9vJYa2s2JM/kpCX0DAD71Lxpp96gIEPpfD pU/2wcDHBPnAISBOBHp6Ufn9BUzpo3Q9Hxp2YrvQ/KK+f2VauYs9yfaxcpTFj3rbhZytMLMS3 4kXQD+CJkowm3JN8x X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234327_121307_4490CCDE X-CRM114-Status: GOOD ( 13.68 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Netronix EC implements an RTC with the following functionality: - Calendar-based time keeping with single-second resolution - Automatic power-on with single-minute resolution - Alarm at single-second resolution This binding only supports timekeeping for now. Signed-off-by: Jonathan Neuschäfer --- .../bindings/mfd/netronix,ntxec.yaml | 7 +++++ .../bindings/rtc/netronix,ntxec-rtc.yaml | 27 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.yaml -- 2.27.0 diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 6562c41c5a9a9..f6a32f46f47bb 100644 --- a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml +++ b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml @@ -34,6 +34,9 @@ properties: pwm: $ref: ../pwm/netronix,ntxec-pwm.yaml + rtc: + $ref: ../rtc/netronix,ntxec-rtc.yaml + required: - compatible - reg @@ -61,6 +64,10 @@ examples: compatible = "netronix,ntxec-pwm"; #pwm-cells = <1>; }; + + rtc { + compatible = "netronix,ntxec-rtc"; + }; }; }; diff --git a/Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.yaml b/Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.yaml new file mode 100644 index 0000000000000..4b301ef7319c8 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.yaml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/rtc/netronix,ntxec-rtc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RTC functionality in Netronix embedded controller + +maintainers: + - Jonathan Neuschäfer + +description: | + See also Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml + + The Netronix EC contains an RTC, which can be used for time-keeping, alarm, + and automatic power-on. Note that not all of this functionality is currently + supported in this binding. + +allOf: + - $ref: "rtc.yaml#" + +properties: + compatible: + const: netronix,ntxec-rtc + +required: + - compatible From patchwork Sat Jun 20 22:42:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11618335 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 1D880161F for ; Mon, 22 Jun 2020 16:06:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 E90E020738 for ; Mon, 22 Jun 2020 16:06:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fMY6VgCa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="L0TS6ZsL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E90E020738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=AZX2EDP1Pdzw569D8bh681NLzOdiJR72/d0MlocXXOI=; b=fMY6VgCaXbD/iUkxRcC9ZAWY3 LRqFDFhmnZiCGOouMGZdGSJK21276WJu9jtk5Oi1BjGozNW8HQwMc0+Yn3Ek+xr3E1okmw7NJ93Rn RxZqJKn6XFp+G7eHq8NuIuvxYX/19UeBnZbQH95UUOZp1Uu5jVxHH/eMUu6FiLwfukRVKJ+Zg1See N2xOkSTD/hrreazRUNAxJYiI5jdYJJyzIwh/IXb3LrIcmkoZ8cGI0dM+RJRqLp2YmJUQDlZg0yJ9B B7k0l8IvVEk9MKUjw9Hqmx6P6jPwMBuqmLKDW8S0vqPrwzHh78mdu3He5TdNOBjI1eNq2MTN0uHJU C+K8Edosw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnOwH-0003m9-Db; Mon, 22 Jun 2020 16:04:53 +0000 Received: from mout.gmx.net ([212.227.17.22]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmCo-0007Yn-ML for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692962; bh=SJkG9V9Ioa9d4mEs8B+Ts1mrBz/DoBrNbjbG0YqcoW8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=L0TS6ZsL9wzNE0nZD/qm5ZJjxYPd9mb0bHz+Wc89GxEVngTEO1oEtUnBDPVvqWDSW utlwhk8cyNqJfnConKj8VnRLNbAfPwQZqnawGcKdQqeFVaDWjUrjK7rrApjllI0D3p O3UGHr8naeDiHytOMobzDZmzy8GMBiHrY6pwXuwk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1wll-1ilEJH1IF7-012Gjq; Sun, 21 Jun 2020 00:42:42 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 08/10] rtc: New driver for RTC in Netronix embedded controller Date: Sun, 21 Jun 2020 00:42:19 +0200 Message-Id: <20200620224222.1312520-7-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZySx5t2KwCOIhxVvsNRQk0BHTuvPhh9i+aJrLHsgVrp4vASHns/ K/Sng6XDPFxIADTuQhRqPpAiIQTxA/wGOa2PSbQbB4sTuJ0aojUJGE8Ag92fPQLXO9nJD6G QLoS+fsnoA5cMrwfz9npyau2UOADYu9551W2HpisS3/JZwVYAkM5yt+jitcvhvxSNHOoB3r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l+u+cH80iRBr8jJ+PA/3Q5QGZ660fK6hjyEb16NG22QKVP L/ECG3hvFjnJdNMaNEpqNriFUDIsWnGaW1J5qp3ugwvB5F4zU5R1NTJGAWdbN2r5o1BjNABnH cwybOOoZixgQqd50QSyGd2l4h3JcHriVwhM+qV3h9yKHVwkp74WsYomw9NMRgSDY3RMzOMMJP S6uvfUe03QAQM/EL+X7vKcQ1HWp91d21pH3T7c2goOl7w0GVtcclM4l3ke8BskRkHXeih4Yqh PA7OqZbtxvORAmFOC X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.22 listed in wl.mailspike.net] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With this driver, mainline Linux can keep its time and date in sync with the vendor kernel. Advanced functionality like alarm and automatic power-on is not yet supported. Signed-off-by: Jonathan Neuschäfer --- drivers/rtc/Kconfig | 4 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ntxec.c | 115 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 drivers/rtc/rtc-ntxec.c -- 2.27.0 diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index b54d87d45c89b..2310d08933f9c 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -1300,6 +1300,10 @@ config RTC_DRV_CROS_EC This driver can also be built as a module. If so, the module will be called rtc-cros-ec. +config RTC_DRV_NTXEC + tristate "Netronix embedded controller RTC driver" + depends on MFD_NTXEC + comment "on-CPU RTC drivers" config RTC_DRV_ASM9260 diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 0721752c6ed4c..8653d04aefa99 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_MT7622) += rtc-mt7622.o obj-$(CONFIG_RTC_DRV_MV) += rtc-mv.o obj-$(CONFIG_RTC_DRV_MXC) += rtc-mxc.o obj-$(CONFIG_RTC_DRV_MXC_V2) += rtc-mxc_v2.o +obj-$(CONFIG_RTC_DRV_NTXEC) += rtc-ntxec.o obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o obj-$(CONFIG_RTC_DRV_OPAL) += rtc-opal.o obj-$(CONFIG_RTC_DRV_PALMAS) += rtc-palmas.o diff --git a/drivers/rtc/rtc-ntxec.c b/drivers/rtc/rtc-ntxec.c new file mode 100644 index 0000000000000..44d5a5eedb597 --- /dev/null +++ b/drivers/rtc/rtc-ntxec.c @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright 2020 Jonathan Neuschäfer + +#include +#include +#include +#include +#include +#include + +struct ntxec_rtc { + struct device *dev; + struct ntxec *ec; +}; + +#define NTXEC_WRITE_YEAR 0x10 +#define NTXEC_WRITE_MONTH 0x11 +#define NTXEC_WRITE_DAY 0x12 +#define NTXEC_WRITE_HOUR 0x13 +#define NTXEC_WRITE_MINUTE 0x14 +#define NTXEC_WRITE_SECOND 0x15 + +#define NTXEC_READ_YM 0x20 +#define NTXEC_READ_DH 0x21 +#define NTXEC_READ_MS 0x22 + + +static int ntxec_read_time(struct device *dev, struct rtc_time *tm) +{ + struct ntxec_rtc *rtc = dev_get_drvdata(dev); + int res; + + res = ntxec_read16(rtc->ec, NTXEC_READ_YM); + if (res < 0) + return res; + + tm->tm_year = (res >> 8) + 100; + tm->tm_mon = (res & 0xff) - 1; + + res = ntxec_read16(rtc->ec, NTXEC_READ_DH); + if (res < 0) + return res; + + tm->tm_mday = res >> 8; + tm->tm_hour = res & 0xff; + + res = ntxec_read16(rtc->ec, NTXEC_READ_MS); + if (res < 0) + return res; + + tm->tm_min = res >> 8; + tm->tm_sec = res & 0xff; + + return 0; +} + +static int ntxec_set_time(struct device *dev, struct rtc_time *tm) +{ + struct ntxec_rtc *rtc = dev_get_drvdata(dev); + int res = 0; + + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_YEAR, tm->tm_year - 100); + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_MONTH, tm->tm_mon + 1); + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_DAY, tm->tm_mday); + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_HOUR, tm->tm_hour); + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_MINUTE, tm->tm_min); + res |= ntxec_write8(rtc->ec, NTXEC_WRITE_SECOND, tm->tm_sec); + + return (res < 0)? -EIO : 0; +} + +static const struct rtc_class_ops ntxec_rtc_ops = { + .read_time = ntxec_read_time, + .set_time = ntxec_set_time, +}; + +static int ntxec_rtc_probe(struct platform_device *pdev) +{ + struct rtc_device *rtcdev; + struct ntxec_rtc *rtc; + + rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); + if (!rtc) + return -ENOMEM; + + rtc->dev = &pdev->dev; + rtc->ec = dev_get_drvdata(pdev->dev.parent); + platform_set_drvdata(pdev, rtc); + + rtcdev = devm_rtc_device_register(&pdev->dev, "ntxec-rtc", + &ntxec_rtc_ops, THIS_MODULE); + if (IS_ERR(rtcdev)) + return PTR_ERR(rtc); + + return 0; +} + +static const struct of_device_id ntxec_rtc_of_match[] = { + { .compatible = "netronix,ntxec-rtc" }, + { }, +}; +MODULE_DEVICE_TABLE(of, ntxec_rtc_of_match); + +static struct platform_driver ntxec_rtc_driver = { + .driver = { + .name = "ntxec-rtc", + .of_match_table = ntxec_rtc_of_match, + }, + .probe = ntxec_rtc_probe, +}; +module_platform_driver(ntxec_rtc_driver); + +MODULE_AUTHOR("Jonathan Neuschäfer "); +MODULE_DESCRIPTION("RTC driver for Netronix EC"); +MODULE_LICENSE("GPL"); From patchwork Sat Jun 20 22:42:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617775 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 274C214E3 for ; Mon, 22 Jun 2020 13:45:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 F375420738 for ; Mon, 22 Jun 2020 13:44:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="daernW9R"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nXgXib/h"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="JBv4w0m4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F375420738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=OxqFgKdKzaR6NEAk667qhsNKmYLR4Yy4Kw2mJhO/rpk=; b=daernW9RHkvrzknZcr5t3RLAv I6vlCE5fwG69fkAzSL3veuPCM9kbk65zgnmq3YAeznEpIY0p+fgdzjhQ2IqgRSBIwivbQ9FZJo/t9 1t0BuWBKFvkVMPBYUMY9ROX6bXiaUIGRPyHNbH2+9Wj4c3GEeVOSAMlKBoj1BHjSpehaIkMFWr2PI lI0MHo+wZZ8E0ntIdFxNJocVlLHaHMLqPnZN7SMZzqJpMKV8LRAhylx6nm+rBLc7/IdIvxevBGpXk wm9xvfkUQCaUMnj2rzBuY2IdDML4BEwXcG+YwGx+cGpsz5Lb8yzoKyDuscybEfmllXEy1gIJUbQXz M8gwv1Qhw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMiL-0007Is-OR; Mon, 22 Jun 2020 13:42:21 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLxS-0004uT-88 for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:53:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=b01H0vq2zJZ5EbF61nBFxKB5qH+H+Rf2ALVSmwgY+To=; b=nXgXib/hm+4PP57Tde5ga8PpJk 4P+BhARdEjfciH06hjJZFxPyroI/jcA3Rd6RSQji2LGlVsYGzd9IuNZUFGcDymTlaHeFb1uewF4N9 I/Zx4amBsK/iH8pBHvJyhIUIjkIaPXKWy65+1J9UyUxd01cxGSyU5FdIDwpRJ8lI06T5aP+dNwZ/5 pmFS8hVi6a6XJi5WrNpzxK9iu4zhAK/X6lyHKxXDgzkB1LORI76D7ue893X2ko4nJjqgKWQruhv5/ MIFTH1I43OQrkDFrSQcN8n1tvuGX3te8fyyliLbHZjIjAilaaXGccrNjIpXS9VBoTIb3Z1zRLwL/w 9pzjx6YQ==; Received: from mout.gmx.net ([212.227.15.18]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmDV-0008Io-Kh for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:44:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592693002; bh=exgY33UX1mwRdxvLq8yooJTHfmjPedUVVmEPFY8Wxms=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JBv4w0m4fUZXFqvaoIbr9dXZUDiQqmvQ4ioKKwtnNr8qgyBa4BG/kOiVOASuUfdz3 yBjIZxS3dzErvIBYnwpky1YCgS0l7H4HVKd+2uPAAPrXdkPTrfPN+8ON0/SukiY+PA sdnQbFWz+tk/LUoxvqth+RzEMaAVmP+9GtfVokZA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MmlT2-1j328S1M1O-00jnKT; Sun, 21 Jun 2020 00:43:22 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 09/10] MAINTAINERS: Add entry for Netronix embedded controller Date: Sun, 21 Jun 2020 00:42:20 +0200 Message-Id: <20200620224222.1312520-8-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:a65/Uk4zRPdbL+IjcV4kAQ99Lb08INVuwG5/wNz6bYWQ+nM3Q9r W2TutNVZXIZOUC0etTK03LElim/glyhxLFYIlDNQtixa6qEIkcInbfnpQZT8T68b1EVXG3S OWV1HTw+ppWJfHlftINozC77z0hcFIPAi8An81cPnK4/3eQPKRO8Z1pjVoICXx0dx9bF6WN tcWUPjbQ5/Su6cKOt9qiw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:SU2qUZVZ8c0=:/3Mhge4lP4yfuQJDIZRgR0 86BKuRLH7WVPJTbL8W0owLdBkDGHeaG9UT47pAoJYP8IfeVL3vADlbKbgm+auZYEHucvgRdL9 fJFj1bp/29hGVgPQqQRRCBMlm1p5HIOTfduwrRsV8YlQOdzhXvrSqZEo8eJVjz4OygZs7Iv/6 DIUUM87Kc3wrk1pOB0rxZi7aC7fSRufR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4v03UOLN2j X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234405_907265_6407F49A X-CRM114-Status: GOOD ( 11.35 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.18 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.18 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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Rob Herring , Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Let's make sure I'll notice when there are patches for the NTXEC drivers. Signed-off-by: Jonathan Neuschäfer --- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.27.0 diff --git a/MAINTAINERS b/MAINTAINERS index 68f21d46614c4..d4333f7490f5d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11850,6 +11850,17 @@ F: include/net/netrom.h F: include/uapi/linux/netrom.h F: net/netrom/ +NETRONIX EMBEDDED CONTROLLER +M: Jonathan Neuschäfer +S: Maintained +F: Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml +F: Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml +F: Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.yaml +F: drivers/mfd/ntxec.c +F: drivers/pwm/pwm-ntxec.c +F: drivers/rtc/rtc-ntxec.c +F: include/linux/mfd/ntxec.h + NETRONOME ETHERNET DRIVERS M: Jakub Kicinski L: oss-drivers@netronome.com From patchwork Sat Jun 20 22:42:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 11617741 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 5788A912 for ; Mon, 22 Jun 2020 13:34:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C971120702 for ; Mon, 22 Jun 2020 13:34: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="Yy9euUBV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QcjJjR86"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="CFnOTQM3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C971120702 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net 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=merlin.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=qXnUSgdSzo90VzygrmAmZ1MGiw64zdEVwsmy8ze/tps=; b=Yy9euUBVerU1nl1pr2XrwU1Hz Na+LUDzCb2v+CxNei3bzeJ97st/LXpDoD0xScyHPcNLjmWu72aYI5YxXMGlxqNkvAmbGaDOZxAeWw 9Z2QvYJJYkWWJcwc5l33KLX3XXc5WdfQ/VhITTXCaf7AdUERhnOJBzlNa+UXMtmyzGGr8eU5jAYg+ 2A5w7tqToKkIQ1HASRD5DgpG3tsCxsOMi0Oo+YSXPUT3RYOKjTrxSnzlaZkzlPpjt1hWloFeL4Zc3 3JDCdVTsg8CNaqyMRBMue5K3XeDFEr4dtS68Qx4uSUmAqNFTP7IDZTqVS4I+IM9pOWxf/TsQxInml 9/Dk8sw0A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMXT-0002Tm-9b; Mon, 22 Jun 2020 13:31:07 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLww-0004f4-1g for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:53:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=wwvPMMm+YXcThKipTzZfQbHG4q+VqOcuV93TcpE5ppA=; b=QcjJjR86woDK6QajCL3FedVyQe u95BuTzoy/SyyQaUDphMGXR3twYpDb9dVaZN7n//eHlGrhWRcQgn2VmOf56EGTjPxD2DXNeC7hMBB VnMq55jVW0IvJWfxQGlgiICk8Gp92rr1J8IOsW9A5ylVBmBCaDjAF2jffqI4QiXuICR3zfbUzG8iy 3nlO/qUZRNXG1SxE9ey5JuJGGj22E7xCSYZgiqS/N66H5lJBJe37/FXReHUOsJ9PWkNuRhMwtZGc6 DtTwpPj810vld3OhoC6hcKTYAmJvnu7SvJa4nTn7285VO2xt8KpbSmLBrCjSr0mg2hw6KIqADUXbn cV0ZEDCQ==; Received: from mout.gmx.net ([212.227.17.20]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmDM-0008IP-OM for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:43:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592693004; bh=VyVCIBxPFyt78YSnxS+0Id2tmE8pzSJjUVG0PtP0FGo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=CFnOTQM3hDO8qn9SOfaIxccrUDsONIICDvI+jIsmU+SlgaKoyLBeI2FNpplaFvAWy 6vY1mnLluuZd7IZt/swaQFqEX18Q7jG2KaUvebExAJHnaAawbBx2eqD9VRW6+OUS7b rt5yw5PsHF5ZMIRapjiBMysuRzC8UMFUS1FKtUgw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MkYbu-1j0qH413NO-00m7VT; Sun, 21 Jun 2020 00:43:24 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 10/10] ARM: dts: imx50-kobo-aura: Add Netronix embedded controller Date: Sun, 21 Jun 2020 00:42:21 +0200 Message-Id: <20200620224222.1312520-9-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200620224222.1312520-1-j.neuschaefer@gmx.net> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:4FNCq66znOgeVyoZjrNrgMQNLnnTq7LrgHosR3ZKBWDuWQR51Y9 hYPhfmsJMKVLhNUIXKWpXJ8DaN+Mi7bhYl3wdJNS0UubbVPRgXNfjSkkZ5Sakhi9Sdwyrqb n/bhq7zcYZO6wnOqrkTvllNX/Rorn0iDQKN/y2kqkLi3twA6ydDRZZjvdVGpX8tOPT+hgXi qyEaws9q/M2HxQVCbgODg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:UY/7ZGF2UsM=:2TV1b5ihDM1IbSjjYU1cq1 RurzmoY+h7ogNf0pk+B8diNEMciUuUtbF+eEBnMAlAYZQAeyf7ODTcGaAYuxubkKzrw6pRrKJ u7YKup/L3RbNQoPDjcWXk4fy6YId5jZy64LSPR1WidU++P1QdFUMTRGMWdhQZRHO2wIaO1BZn pHCfee3VGUHyqGqVCsLTVs+nflPhgABgpwXuXsfcI7/8A6YfGAsPsMbNIyWSZ9tHEGmFYIrXV 9sw+s9jn3cymB1+YgQBkvFyB3pz5SCd4jYb11PbjEXKNeBh8PslQ240dM4MRaMPBzmpsfqKzd KqKZ9BV56kgqBZ0rqvOt+lJiaiIHTK5vvbTwOq4x5h0CL1x2Y7X2N8h2G0eGp8UFoJKBezwZ/ bptNe9he5o2CR60qp6N7yD0sKvcY0Zven21jgG1dd8+DHfVHZ1rN2XY2vM5U/W0niVLm/JVfB gZ33qS2Thm0GwLuVsIxhLIKT0ZlBEUFS4VhQNhi98hXbiiZYHHR53hFQzWiP1sKO3z4Our42E 0IVOARxJspuAOEqe+aXN1hCpwcfpDg+BWJ7dgKhX4N+Fnp9gHg+7KNHXbkzcIqP3V92O0rPba M9ftV0TJkC6NfKOo/SJasHwCVxlJFzkbHcbK57O4PNMZ3cxmyVNamvu46vkMKdKRcqk/EJAQq 5gia4k5YBdK+aeFaDR09cV714TJyM6Dd7A/B79plDwQs/lzQiRlQLF0dmiJwtLG7fo6xX5evk 7RPAZWCIjix7UrczoIc39V/7i7ymswXVcynXVEd0ujyQOmWG1o3RzWj450uvLgZToixsKuuUq KGZmeDaq8Or82WumlQWOQrcyRQs8dI/KM0xj/TwIUJXahH4mAfR10uTlxIFg0sLxYZognpgVP qDruGDJNBKefU/b+VzCyuE+Mda+XtDSapia4GD9fseEy/7U2DRmZ36JKDE63uKdgfZtlFXuv4 A1cEFebGf3D/i8AJaFUFevkThCFTLPmDye9CabeWM486RdZriVTukJ920ITC2cAWzpAvJV93p XAsaI1gazr2r4BfRSecIP0hsrjuO7zsDsCAWskQTzEQ4rXEshJ1HGGFJuiIEeT9lcxPRspQmB O5GzmmA+VzRqk1K63LwvFdcz0X6nWMfZjvFiFUlHSpceygtOdqA11RG8sx5tyYrT4n1tlI7Xc ijf+a/KpCxLlVe1eTikWgm3UKYCPw6bjRo7MVI9Euzi3A+UP97FKrDiq8RN+x9J1Z4DzjO667 BmUzrKMJbsAVFhh5M X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234357_239970_7053313A X-CRM114-Status: GOOD ( 14.07 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Enable the Netronix EC on the Kobo Aura ebook reader. Several features are still missing: - Frontlight/backlight. The vendor kernel drives the frontlight LED using the PWM output of the EC and an additional boost pin that increases the brightness. - Battery monitoring - Interrupts for RTC alarm and low-battery events Signed-off-by: Jonathan Neuschäfer --- arch/arm/boot/dts/imx50-kobo-aura.dts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) -- 2.27.0 diff --git a/arch/arm/boot/dts/imx50-kobo-aura.dts b/arch/arm/boot/dts/imx50-kobo-aura.dts index a0eaf869b9135..003a7d894902c 100644 --- a/arch/arm/boot/dts/imx50-kobo-aura.dts +++ b/arch/arm/boot/dts/imx50-kobo-aura.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "imx50.dtsi" #include +#include / { model = "Kobo Aura (N514)"; @@ -135,10 +136,34 @@ &i2c3 { pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - /* TODO: embedded controller at 0x43 */ + embedded-controller@43 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ec>; + compatible = "netronix,ntxec"; + reg = <0x43>; + system-power-controller; + interrupts-extended = <&gpio4 11 IRQ_TYPE_EDGE_FALLING>; + interrupt-controller; + #interrupt-cells = <1>; + + ec_pwm: pwm { + compatible = "netronix,ntxec-pwm"; + #pwm-cells = <2>; + }; + + rtc { + compatible = "netronix,ntxec-rtc"; + }; + }; }; &iomuxc { + pinctrl_ec: ec { + fsl,pins = < + MX50_PAD_CSPI_SS0__GPIO4_11 0x0 /* INT */ + >; + }; + pinctrl_gpiokeys: gpiokeys { fsl,pins = < MX50_PAD_CSPI_MISO__GPIO4_10 0x0