From patchwork Sat Sep 5 13:32: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: 11759123 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 A249792C for ; Sat, 5 Sep 2020 13:40:47 +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 6567F2072D for ; Sat, 5 Sep 2020 13:40: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="tUu4W7Ly"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="HXxfcO+M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6567F2072D 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=GFwvvoowhQsHfBBX/YZbg1Px3zPAxWKW81nHq+YwN70=; b=tUu4W7LyRuGN0kjz6F+K6u26t /akXC9ufJI4mfPLSVzt2TJfeZ4hCZGcWETrWUIS5P1MI+eehsv17MlNoQ8BQLgCf/Oz/0ducQys2s XskzQhqrHyumddvj44R3PxPxVjAmZlDSl+rWVUr8DbFHSzgutZAgXzcf6HmiufZGQ3U6JbIf9TFfP Cr8dgvtjMvYIoG/Rpx3MOGHB276nBBZlMhVKPwOqcAtqt8gX+r93+DDKuRShvvMFJS85hWJ+n7CmU lC1lQ0UKY5MM83B8q+4zLpDziUerU9el+eKslMtD4MPQ1WkptoEs/rdyg6J9w3zivozvKVQYc9l5c l4j0eOgIw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYQk-0007iN-AT; Sat, 05 Sep 2020 13:40:34 +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 1kEYQh-0007hl-MR for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:40:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599313223; bh=rvCCbE4pID8W9dS94D/nwDcZnqQFH63RXYcvweJTvUY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=HXxfcO+MUDyliHTTpBSVYJkTCOljygFkv2LbVGtOJ2A8jPAJVh/HmrFQZevYgWBrj 0LYUeIs+gNTiUWmmHLhksXpA+HY/d3m67IYX9pYKLpSuwn+6SDKNozxy+nlHNIq2ZY JTzVGS12Kb2YcqGg7ErgGcmh9HehKRB47isjks6o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MLi8g-1jx1T61wDw-00HiaX; Sat, 05 Sep 2020 15:33:28 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 01/10] dt-bindings: Add vendor prefix for Netronix, Inc. Date: Sat, 5 Sep 2020 15:32:21 +0200 Message-Id: <20200905133230.1014581-2-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:L1lxZBEqC4oQRcYC8Ye2ZaSaJiFuYq/v3pYJeYuD9nVH2S8v6fg TKjEkhmqkWVW3IoB9WuytdxC+R6Zp5uPAxzEe4NoNkOsvQ6Vz7hexOC5DSlCVrsNs6obqZQ DBiudNkvyYo8GNx85RyEMBgfdK2AnCMR6k3W+dq4O33c8SGRdBNomwa99tVFh2rASqwpLGL H5AXaJdvAXEAtos+UDa7Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KSy3L/AV0CA=:TGTFkerZSTcy5Gr94Zcvri RCrAeCopnZyD/64gBzKdInX6a8jYZl6t2VhIQG6ojtjQ2wke6wL1AcjzOuPHdA2ojHjeCY/PK L5kD9RuPo4ObOAZSYX51XSeQKjsUZu+ofnw8XXRaz66TH04HmEK2mx0XBHLD7i1ZHN3UgIFV6 UXLAjsmP9n28J7nyOV/pdynfqOBVnjihFIyJ+xggfCVpkf8J9zehS+mH1fKRxxKYn7OEU8RKx mCSuGQy8EXFNLaB9Tk9CSvifCHyGxgscPEn0OpGdYiutGyn+AQ7cJoinhzGRMZE1bYvKUUyrG DUJofXEBctcZeLM44CMyU1uKD+WSMsw9srf1tlrZuvEll0ULnu3WXBJK0fxVgytIoZMZRhmY3 NyO63pdppIbhSCvV0WY2violV4MczLhulMfVYuzJN2jJNgft0EkYkyAHao0B+wHSFGbjk/3x5 6yCY4AM03oAze1uIwzmkTtLtQCBngJlIAlZq3SzUfMoT+0LRXHDWBlwEUdrINhrn6YBgaOfpt 8p9e5usp7ePpHJdtqH4pt5x0yjZXq4SO4OYT0DzqZtqg/ZCOAJbitFHrp3mS888mxEhD+hKOY i6KOChVoQkERI1ydr+W0cCiVD/NyakfpAUGq734mAsBgoHbVgrPbS4h/ti4ADWxFPQ+sGHAse nofd3OjgOSGTs14+QjqMUDlK8i8u7fGGlHe7TPaNTE0NHuyDBDVgCi40e/wsWQJUsDegQ4Y3d nC1CGyf40CbAH57sGTCRn2RQOi1YGB1TdkKD0HvGSNdIZRm2C1e1cb8ApFJEW7wKXvWikVtuN MNHMeRXv7biIcih/O0SnRpwNfX6FNU8WnrtcnK6XsxufPqiAT91Cpap+jA9OvKRkkGudopSms P2tU7eIZm55cvbDyP/OUCBVuDOuD75YQIVAtciY8EAvyWggLkFle7y47VX30iCVoaTTi1lSMa kkyWuzc6RKetTb/sjIVVbSn4XQRVqJnCDUTSQSp56W3CJEDZJFtB8nduxoPEWbjUdlun6QQGx B9s7792PmL9VIv4SVsFcbJEltriJovrTmRpBhThFZwBHOvn8Toph71TN0+IZOzy+8qwoC1RsW NxfGO4duxlPqtCU50ClrhQ8XirBCOG/SX62iuZAgEri4GEp2OJ6oE9VYNDcj76qaA7ohXcAdL rXDD/G4rMAimk7Q28V9hI7EHXhDaiVtGUGwFk/FsOilpzpfy83X7dP9xR2N+5USJ0CdQyjjDM YmSTjjI4dDYTCwBCWKXK588qY3lBvwUmZDUD0UQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_094031_932621_486632E7 X-CRM114-Status: GOOD ( 13.97 ) 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.15.15 listed in list.dnswl.org] 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 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 , Kuninori Morimoto , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Geert Uytterhoeven , 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 Acked-by: Rob Herring --- v2: - No changes --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) -- 2.28.0 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 63996ab035217..fa173802000a0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -712,6 +712,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 Sep 5 13:32:22 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: 11759111 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 3A81B618 for ; Sat, 5 Sep 2020 13:34:50 +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 7CC992072D for ; Sat, 5 Sep 2020 13:34: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="rcxhAWxy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="dKmlOkci" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CC992072D 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=Ma/OWbWJM9U6M/CkI8K2lUbnCSanEVTgCMHDUtEpSas=; b=rcxhAWxyrey8MWACRlAJLI8yt UseAqvQTFPjiVsyGnBFOOo1C2h44FIgvHGIFE0O2iU23J8n9GJR7LKf6R/2d4VY/CtCo3kjrWDHRu o8AblObNrS95vqtOK7G/bhSXroXoH32iufjiw+O1GxItsaWmMRxlcWn+sfVuNRMcL82udiO8nsXx9 4wqQ8yNP60IxAaytaCyVHlcemi3LAIj5rQlMY4tS3wV4VfFO0Tb1ummqPr39NeKtrfiYvhKpsmDn5 u+Hl4yQiWw4D3xg2hlVEApEOcSmtIamS4CChp3Y4da3CF5pc4Tx2VI9rPSI6xyUOeKurwxWOXWrTs hWOU5XTRg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYL1-0006Cl-FU; Sat, 05 Sep 2020 13:34:39 +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 1kEYKz-0006C3-9T for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:34:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312831; bh=dUozDayDb3rFWMmvDYXmPqx3PtWjU/j5UWsQB+GibEk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=dKmlOkci75mW5whWMWqHXkc7HzP21sXxTAwPH9lCJ2HOB2zShwVgnEz2YhZhvRAHv 1SAYqEeAsxMZ4h/uouL90pLNPtbfEb4QynsxhJ3PagmiF634JkfHkuh/44xyavmpMv V6gsxA8eYEdfzUueOCVbROPIu21Y2uXCwO6oYpTc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MsHnm-1kXjrp1uaw-00toAA; Sat, 05 Sep 2020 15:33:51 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 02/10] dt-bindings: mfd: Add binding for Netronix's embedded controller Date: Sat, 5 Sep 2020 15:32:22 +0200 Message-Id: <20200905133230.1014581-3-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:KsJzyKCQwvS5BlRV0/850L0IdR6x4/dBrHBq7mSHZliTz8m15VR aOCXTl1oQJda9EIus66MyDVy9PVrf1df1zrgqUz4Zt/YXICmKRkNMGBR84B7sDEgDl3+yba WkmNDtiG8VAfYfRitvk0Sy/ovX8cTu8e+ETW3EFKXNE/zZXMgz5druzR5fVPayywYP3zLdG 6HHrIm1Ttfw/jGrYFXLYA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:71DsHEi3L3I=:T10erDS9EyZBaX8oDbQspC NnhLkb2BRMKd2VGqsu6pvf0KwC8U0EB4I/CLxB0+dBRXqhL6VdBKSiixDvh9ilJKLUEFIloyf lLNP7y+rKRIzPV1b0vsbLZ24nICXSvLQEHPgRYqtS0WC+G5fOsFeXfbmOEMP6iLPGsTH+DLYN /P6ISkyF/mR+OFr8E2iu1KTxrwkOLY0SKHmDwYbn1KDAEKewiAOa6QRBliIPLPuUfOLRO3nb7 CMx9HDsm2qYBTFwFNAXPft4SFJJEwY9mPQOC2clmdotuzhTvkDj0qqkSYr7b5igVZ1vGhKGZa ZfR1FlrKToOoSM4+GKdZgZdw41xvHhNegdUfHYNKL/58hKf5+qqr3f//iitYkGNV7jt5u4d7s 55eNY0S5Dl5B4BAJ9H3jgntd47FWvzbgTW+HMjAkrVLKzhnQlsplyTahpHP7SACM+OBjDomif q2RMYQWUMMkWRXKi5Jc6q2/KfUIlRvduoL/l3oR0G7D+RP8DmHSLujzrEtd+zbsUSVQIAHSxo IqLl3OnNEJdSelMuyAQCZHuZxJT46EOBsQSNzsqnK3GzbVX9zFYM4PuwTseaRyl9ekBsVIQoH VuHQrByq7A5x0DoDhE0y57pjMFR9DPFNFeTr8GZYtX6N8KD0wWzFg7foz3qsBStmOTlQIzBxS b0Gh4hj9YYyEFVj47XsAny0O5atLVzYv81ICQLM8OlGQ0ummRI/XjzO4ziD8aR/jzfg9+/TSa pFoG49va7jen2OTqA3EFVTUQQxuoK9reubfYy7wGD8pEjS77TOnE+/vOMk6UDLqexqZS4y5XQ EsTKGyg7/OByN2itgH0KiLS56RBqDDNjjs2UBgv1hW0GGQ7zrJ4GNCXaD3tn/ejgVfCrppFEY XnTGMXRdBn0cisd6nNk87J7B0HjPoj2AOwB5sJ5b9DV6/5nftONQfU2lhMI/pKO7gzjDe/TK2 HupgCbDeKR2lJJEJLpjDPMZXcJivy2D/ODfbSnY0GrqkW0DeS80pjS+u6VQaCpU6QULA8xkxB ErDc2fEfKVoj5Sb0ab+Mz4qVwAxifJPH11aZE4JfE78Y/f6AY15y1+qCwr7qyMeW5K4ckut3l oSPtih6LwglvqwwnDSQ706lXum2bZ2nYADUro47ZvI7hAWs7rmm7BewYCHymrrB82MYWMAVIq PISxogXIVtjPC+WZ190wbn3+CS6vYeWf4IXVoS3OveYqkYJJYmCfe0Od5FUAHswMq1WTdbQ8u zkmSLVDrSBiE6P2Xsl5NALOXNr0yzhAN4HcoAlQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093437_547019_6AFA4C5E X-CRM114-Status: GOOD ( 17.08 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.22 listed in wl.mailspike.net] 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 SPF_PASS SPF: sender matches SPF record -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 --- v2: - Add the plaintext DT binding for comparison For reference, here is the binding in text form: Netronix Embedded Controller This EC is found in e-book readers of multiple brands (e.g. Kobo, Tolino), and is typically implemented as a TI MSP430 microcontroller. Required properties: - compatible: should be "netronix,ntxec" - reg: The I2C address of the EC Optional properties: - system-power-controller: See Documentation/devicetree/bindings/power/power-controller.txt - interrupts or interrupts-extended - interrupt-controller - #interrupt-cells: Should be 1 Optional subnodes: Sub-nodes are identified by their compatible string. compatible string | description --------------------------------|-------------------------------------- netronix,ntxec-pwm | PWM (used for backlight) netronix,ntxec-rtc | real time clock Example: &i2c3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; 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>; pwm { compatible = "netronix,ntxec-pwm"; #pwm-cells = <2>; }; rtc { compatible = "netronix,ntxec-rtc"; interrupts-extended = <&ec 15>; interrupt-names = "alarm"; }; }; }; --- .../bindings/mfd/netronix,ntxec.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml -- 2.28.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 Sep 5 13:32:23 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: 11759113 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 D452892C for ; Sat, 5 Sep 2020 13:34:54 +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 2C97F2078E for ; Sat, 5 Sep 2020 13:34:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jkh819pv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="Wge91bLk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C97F2078E 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=wXmbzbNe+hpjcYAIKYP+32l1fPSJTZdk40XxmEgFDd0=; b=jkh819pvlLpH9YTWwiuClN0G+ 8VULy77igeXeoEP3L5mDSFhzxx/GjLP6qvVKe0bswVCEDfQS1Cbs+IewMI5sItvAfMSAPj3p2V4dT F8SncF3ZYdJAsvd0wT4wgHqB0ebAuqbOl0tODL4IFHSv/53ZD9FWTGpdowOVVuHAc5BOOrlPtxSXy g89RC2PamxJfBwD9SZ0KAYbPQiTkFce9cbwlMpOeoRGgCSKg43baj0bwDlfYDjIgjC3utd1lGS5pM TBmBccG1Bfk+387gPgpD4THTmqDL6MCYvbUod8QvKwv0Pnep+jOaXs+DdwnXkw1K4pXvfDqfOin+p SsG++LNKQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYL5-0006Dc-FU; Sat, 05 Sep 2020 13:34:43 +0000 Received: from mout.gmx.net ([212.227.17.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYL0-0006C6-Jx for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:34:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312843; bh=lFP4+48b1q9wMps2dhvfqju3YXkQySHJhiYh5hsMw8s=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Wge91bLkSC8JeDMRv2xoC7qIr/ccP9aTthWA9Z/RA1ByqkvieReeA2RRMVrpoIBNN Jq3/x+3iCZlvr+tTN3FRE3T91dapHwktkOg9Cx/O0v7Cq7iiXPa6EX320kyNnx2Czm gteuOJDiciQz4Sz9iIICaUMdRlJXEvDzca/F3AOI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MnakX-1kxH5C1QLl-00jVm9; Sat, 05 Sep 2020 15:34:03 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 03/10] mfd: Add base driver for Netronix embedded controller Date: Sat, 5 Sep 2020 15:32:23 +0200 Message-Id: <20200905133230.1014581-4-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:9nyrMwTGKpf8aFfMoAAzhrvimxGgK1Ibt7IlLGUdrACY1CUOER5 2GSjH+eh6PDU9Iec7TWg/lwHJDr9kUkRIxU4QIXbZ5Ij/ubOVjhFySYN9zcRMiG5svJgC9O 2bb38VILsliYSS1xPc7zOFZhMKcMvAm6tnY2Cwlbc1kiYnozFVo8vB/qMBf/Wcngcon1aPP sudH74a8PDxuVW8o3iMVg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:tcXlN4wr7mI=:NkyhodHlWwhy65wMxx1icg MjIRdgKrVnGotYB8jNs+x0SEFFE3EB5RAA9Ya9TLtr8vK2gSQBxt6guFmrtUUmqJWUh5eAvpT WBMCWmI09MxjbT1ZbAcNfmumZaoDX215M4fJAWirCVj5+yEEOZspZnV2U8cPLdyJR2zyPJ/Gk FgV3DSYkpQiXwZ2d2qdPeLNHgYRyJbNomuP1QOg3NiV2GlpOH+ku4sPPqTUv/U4U2QnBfOVyi p2/3DKKZE3c+IQTus5IGA8gC26iTGFlA8w7Hz1Id7oPT7I80v2663Z1HgS/BLDsQGXhoLubJv cgKq9NWKxQyXh4ecypi6mN+UQQtlESx+LQvEgegqHj0mig02fgfKbaloWNPLG9DELDB4owNfw kK4H2q2erIWVbNTjfZVVqUlNa5m3qT6LVgoo2/dolNopaBmgOrIjO2KTmN0Y/om1U+Dz5wT/o i9YRNHjLxLcUTvtQowO8F/+G0MxVDOw0NoX4jStv/MelPWezFJqnbiFeLdnMNn3npPzlXQLzr 0FimdbaYLmjnJg3Y8b+XTUzRg+6bfURKiSMLjrGHhNTg+XF25Ns6sN1kOaoX+1RseVp5gY8pO v6DVKQ7BHePTYbS7L5gumW/KcIYAv5gIcAi6XQFBaDKcQKkW0nHxt0ERDxs3nxATmpBqE0oa+ wXdoR2ZMZEWgDPh1NzWi9+AXkFvItoCdhvQoeFGwp++J2oC5ZGztzxdlNKwtv3su7Nxv20dG3 cwRk/53AHHT712hOsZLCpkZDX2wVag3S9GnNh35F9apF/QIz6UbvJkTjDq7IE6iTeseP+h48E RBW0x1PPy0Xf0D1SX2eb5N1Y4/FSjBsciA//S3BSGS1jddIfA5Rwvanjq4EE39f4uKRV+jZoJ nGcnNLeSgsJLWnSN58HDebwfmHajzyvYc+kniw+OBwksvGU6F2DBOdgI330pjJPXyvadBBJEF ry7ZhPCOT3h0fcClSrMVhpDJA2PCGDQj8fUMcAj+t04ANO2/M83Drq9yJ6f9cu/yBCKDCUJJT dzkhKwKibheArntmVF8YzRZ9BWWjtcUwS/S6fK4gPITG1ZNGpfLWgnsa6Q6uIVu2PzdLxLIq/ nLP9PEHD8cjDCkkayNlOMHQfsh0P18s26aYm4RmioytR1896ILph/637feoQzlFdEU/SVFI+F 0WlF1+Cpu+goFEjskAIm3pq9BIAKgBgCJJJj6jfuQxDt871CY7S+/VjDh9KKfC8e50N5l0YsB FNGZlc0ZflJ5RokLud3oaTihbER+DAFOgR4RveA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093438_855159_2025ED6A X-CRM114-Status: GOOD ( 34.43 ) 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_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 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.21 listed in wl.mailspike.net] -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.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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 is a microcontroller found in some e-book readers designed by the ODM Netronix, Inc. It contains RTC, battery monitoring, system power management, and PWM functionality. This driver implements register access and version detection. 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. Signed-off-by: Jonathan Neuschäfer --- v2: - Add a description of the device to the patch text - Unify spelling as 'Netronix embedded controller'. 'Netronix' is the proper name of the manufacturer, but 'embedded controller' is just a label that I have assigned to the device. - Switch to regmap, avoid regmap use in poweroff and reboot handlers. Inspired by cf84dc0bb40f4 ("mfd: rn5t618: Make restart handler atomic safe") - Use a list of known-working firmware versions instead of checking for a known-incompatible version - Prefix registers with NTXEC_REG_ - Define register values as constants - Various style cleanups as suggested by Lee Jones - Don't align = signs in struct initializers [Uwe Kleine-König] - Don't use dev_dbg for an error message - Explain sleep in poweroff handler - Remove (struct ntxec).client - Switch to .probe_new in i2c driver - Add .remove callback - Make CONFIG_MFD_NTXEC a tristate option --- drivers/mfd/Kconfig | 7 ++ drivers/mfd/Makefile | 1 + drivers/mfd/ntxec.c | 217 ++++++++++++++++++++++++++++++++++++++ include/linux/mfd/ntxec.h | 24 +++++ 4 files changed, 249 insertions(+) create mode 100644 drivers/mfd/ntxec.c create mode 100644 include/linux/mfd/ntxec.h -- 2.28.0 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 33df0837ab415..bab999081f32d 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 + tristate "Netronix embedded controller" + depends on I2C && OF + help + Say yes here if you want to support the embedded controller found in + 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 a60e5f835283e..236a8acd917a0 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -217,6 +217,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..49cc4fa35b9fe --- /dev/null +++ b/drivers/mfd/ntxec.c @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * The Netronix embedded controller is a microcontroller found in some + * e-book readers designed by the ODM Netronix, Inc. It contains RTC, + * battery monitoring, system power management, and PWM functionality. + * + * This driver implements register access, version detection, and system + * power-off/reset. + * + * Copyright 2020 Jonathan Neuschäfer + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NTXEC_REG_VERSION 0x00 +#define NTXEC_REG_POWEROFF 0x50 +#define NTXEC_REG_POWERKEEP 0x70 +#define NTXEC_REG_RESET 0x90 + +#define NTXEC_POWEROFF_VALUE 0x0100 +#define NTXEC_POWERKEEP_VALUE 0x0800 +#define NTXEC_RESET_VALUE 0xff00 + +static struct i2c_client *poweroff_restart_client; + +static void ntxec_poweroff(void) +{ + int res; + + u8 buf[] = { + NTXEC_REG_POWEROFF, + (NTXEC_POWEROFF_VALUE >> 8) & 0xff, + NTXEC_POWEROFF_VALUE & 0xff, + }; + + struct i2c_msg msgs[] = { + { + .addr = poweroff_restart_client->addr, + .flags = 0, + .len = sizeof(buf), + .buf = buf + } + }; + + res = i2c_transfer(poweroff_restart_client->adapter, msgs, ARRAY_SIZE(msgs)); + + if (res < 0) + dev_alert(&poweroff_restart_client->dev, "Failed to power off (err = %d)\n", res); + + /* + * The time from the register write until the host CPU is powered off + * has been observed to be about 2.5 to 3 seconds. Sleep long enough to + * safely avoid returning from the poweroff handler. + */ + msleep(5000); +} + +static int ntxec_restart(struct notifier_block *nb, + unsigned long action, void *data) +{ + int res; + + /* + * NOTE: The lower half of the reset value is not sent, because sending + * it causes an error + */ + u8 buf[] = { + NTXEC_REG_RESET, + (NTXEC_RESET_VALUE >> 8) & 0xff, + }; + + struct i2c_msg msgs[] = { + { + .addr = poweroff_restart_client->addr, + .flags = 0, + .len = sizeof(buf), + .buf = buf + } + }; + + res = i2c_transfer(poweroff_restart_client->adapter, msgs, ARRAY_SIZE(msgs)); + + if (res < 0) + dev_alert(&poweroff_restart_client->dev, "Failed to restart (err = %d)\n", res); + + return NOTIFY_DONE; +} + +static struct notifier_block ntxec_restart_handler = { + .notifier_call = ntxec_restart, + .priority = 128 +}; + +static const struct regmap_config regmap_config = { + .name = "ntxec", + .reg_bits = 8, + .val_bits = 16, + .cache_type = REGCACHE_NONE, + .val_format_endian = REGMAP_ENDIAN_BIG, +}; + +static const struct ntxec_info ntxec_known_versions[] = { + { 0xd726 }, /* found in Kobo Aura */ +}; + +static const struct ntxec_info *ntxec_lookup_info(u16 version) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(ntxec_known_versions); i++) { + const struct ntxec_info *info = &ntxec_known_versions[i]; + + if (info->version == version) + return info; + } + + return NULL; +} + +static int ntxec_probe(struct i2c_client *client) +{ + struct ntxec *ec; + unsigned int version; + int res; + + ec = devm_kmalloc(&client->dev, sizeof(*ec), GFP_KERNEL); + if (!ec) + return -ENOMEM; + + ec->dev = &client->dev; + + ec->regmap = devm_regmap_init_i2c(client, ®map_config); + if (IS_ERR(ec->regmap)) { + dev_err(ec->dev, "Failed to set up regmap for device\n"); + return res; + } + + /* Determine the firmware version */ + res = regmap_read(ec->regmap, NTXEC_REG_VERSION, &version); + if (res < 0) { + dev_err(ec->dev, "Failed to read firmware version number\n"); + return res; + } + dev_info(ec->dev, + "Netronix embedded controller version %04x detected.\n", + version); + + /* Bail out if we encounter an unknown firmware version */ + ec->info = ntxec_lookup_info(version); + if (!ec->info) + 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 = regmap_write(ec->regmap, NTXEC_REG_POWERKEEP, + NTXEC_POWERKEEP_VALUE); + if (res < 0) + return res; + + /* Install poweroff handler */ + WARN_ON(poweroff_restart_client); + poweroff_restart_client = client; + if (pm_power_off) + 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) + 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 int ntxec_remove(struct i2c_client *i2c) +{ + if (i2c == poweroff_restart_client) { + poweroff_restart_client = NULL; + pm_power_off = NULL; + unregister_restart_handler(&ntxec_restart_handler); + } + + return 0; +} + +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_new = ntxec_probe, + .remove = ntxec_remove, +}; +module_i2c_driver(ntxec_driver); diff --git a/include/linux/mfd/ntxec.h b/include/linux/mfd/ntxec.h new file mode 100644 index 0000000000000..65e389af79da6 --- /dev/null +++ b/include/linux/mfd/ntxec.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2020 Jonathan Neuschäfer + * + * Register access and version information for the Netronix embedded + * controller. + */ + +#ifndef NTXEC_H +#define NTXEC_H + +#include + +struct ntxec_info { + u16 version; +}; + +struct ntxec { + struct device *dev; + struct regmap *regmap; + const struct ntxec_info *info; +}; + +#endif From patchwork Sat Sep 5 13:32:24 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: 11759117 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 261E5618 for ; Sat, 5 Sep 2020 13:35:25 +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 C41C72072D for ; Sat, 5 Sep 2020 13:35:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IRl0oy/F"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="VTrOrwLd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C41C72072D 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=l54IjWuvYAVC1eaApMyx31qNZelrSmY6iI0EUNwVWHE=; b=IRl0oy/F8CBFtw524N7OJt+ZB WmpgVUbhx4fx2dYdG6AaMJQx9M+b4uzt27aQ3UYnoC++CAcrdpxn7776jWqjolE+xOvVHULThEXM0 /BQyo+FEYPoJP4Duydy0o0bVltS+Ty8Z3DEwr1lSK6RN90/OqU5uwm0ntlWowTrQO9E5r5wAtdWdD 2IY5idbkAXeHrF5LH27OMhvDOK8xnTMg6zgC/ZCZbVv0KSdRYBcFDUHfxVozM1sCy/DG4WLuTjNXx 9uWKWOfbymSSN0tmxxyyutUKfQNBbPfL+2rTT+ZVWiH4BtVC+7NUXLKXFGZ23DlAqaqTezjereJnU JrkyPr8zA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYLa-0006KG-Cp; Sat, 05 Sep 2020 13:35:14 +0000 Received: from mout.gmx.net ([212.227.15.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYLU-0006IA-8o for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:35:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312868; bh=u6aT3F2Q3gGj9nh0VqE3OXnqr1dQ+ZyFPqUs/hm8TgM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VTrOrwLdl4pu3ogu+tX1ulxWEe25edkYiUMGaIhQ/mTYlTRBQOoFvpqExbfUQUSry JOrlpStlTpnVAsnfTjlxaxKe2R/Gunh+GF03rfAbLw6g+nu60sbvsYBZFZsOK+GajF ItQfPSPZGJ6UY6SwcxSmNpqIB/LPZwDjYOYwZzsw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1fis-1kh7lb4104-0121s1; Sat, 05 Sep 2020 15:34:28 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC Date: Sat, 5 Sep 2020 15:32:24 +0200 Message-Id: <20200905133230.1014581-5-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:BsE/idGOdG/2VXSLRx4X2BZv664ZNJ0vKz0CEYNYAzQ7v4uWeOA AH0UJ2IvlSFVX/IPDzYUdnVcGC28q2xjtegYX7p1jz6XfdEKfPefQNjGkbZtUVs0iWyDsdq pi1cQ/C4oPqlEjjGnAJWf4fX/TKoh1ScMzVbK0LXQgdYA4NsLCioS6RizAlvLK1+CLNqmE7 y1U84rzjlrWmDVonmfVwQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:l9Pn3RK6sU4=:32jTXN2fuXC35YyG4qm9yc rqzKI+D7X8fDm05U4U7UdsotjDgUMgt6dXGzqe6hTgvIDavtF1XZ39TZc9FIAtwNSivTUAZ87 281tV/cSuc5eQtMxk22j11gA8XDt4Sz9M7v89ej54wYhswdpfMB5F4enFZSLzC+nSeUIOq5kz K12u+VqN7ImWu/xmahRs4V/Wl2NwQIJ44mxCD5CEfKHW/17b+9z2IrDFX5NlEr4b8sYROI3eU fxqV3tQc5pDk8pHYIC/IvaHtA28gC4CwPPgW/TfvFBvMm5T6/nVRrZ+sslUbW5dhIRY2hNREj 68444En7rlvmeg0JYRA6NNZ4y1fysrOa7GLnp3DbjwFm9rFiRWEhpjayYguXa9abljff42YEx cU92jNa7+ccR91m8Ig7QBIRBuLT438N6++695t/lBMNLob/XpYhPZ3Q01yQ+A2BnX47iMpBxp TbzowqVtlz5GeBAEZCobwlOLI13McPrvCiOprOpbBmYpkpc2OEkyS/GDm32vQ0q4b/VXDqX8e X2JdSvamxIB3A9CHs+sSkzKLRCn61r0+jQHcvsUgz3xq0t8yh8xMiKerGIresipwdmokXOq9p yPmXghPsgckUPApCt1KGI7F+uMNoH1jWAoWkedKKofq7VKaM7zZwpxnSD2/4w+C6kQmAS+PPG MXFSDiFzpHjz1M3VTDdS5Bkv/YKK28r9c6v7UAvhYH03Kb7tIxjDt2bHhsfD0eoeqCh2IFuVP bRRF7hPCqGRjrp6ydImrY+xczgbyTbZZmlCmT4VEW2kr/H4iQhJuviIjpg+HMIyJTSaQxNIOd cMdN3flWBpfZe/mc1C6uRmYe/rcYe8ndELUT0LrzitHbqpEeQkOTiNB3cj5AQJRrLFCBxmGWu ico6cruOgvc45p2TaVJtL5pV1ry+cMaKB/bHEtjAOWKEuiHSo58E7AZIdMZG8jhI9Y8lvm06K ylRtcrbePCjaE+eqAmXEf+pTqpCr5eDNPZU3/4oTs9cKspXsC7muJfU5i+bDBwLmRhElPqjhv 5aIMBEjR/7BHC20WhFr8gAGB802rwo+y6dLxiuWQDPwsvtahqvKybyO7az5kI7tlebOvcyesy qv/KyjhP0oWNKqQCRro/10VOjjWzUl4frT86KXg+DNrQkq7P9005Het/s7AxMqFJrq38AAL8a v0NZHR2T28KJ9c+8pSHqsvvPi98mSqvABWRFJBvtFe/BqN6ilvXx1lV4UdBmRIH9ecgppIhMJ Kg2t0RUPELK4a94nagaOer/50rwkWsi54i2g7ig== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093508_548159_5B3B01B6 X-CRM114-Status: GOOD ( 18.82 ) 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.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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.0 SPF_PASS SPF: sender matches SPF record -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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. Signed-off-by: Jonathan Neuschäfer --- v2: - Add plaintext binding to patch description, for comparison - Fix pwm-cells property (should be 2, not 1) - Add dummy regulator to example, because the pwm-backlight binding requires a power supply For reference, here is the binding in text form: PWM functionality in Netronix Embedded Controller Required properties: - compatible: should be "netronix,ntxec-pwm" - #pwm-cells: should be 2. Available PWM channels: - 0: The PWM channel controlled by registers 0xa1-0xa7 Example: embedded-controller@43 { compatible = "netronix,ntxec"; ... ec_pwm: pwm { compatible = "netronix,ntxec-pwm"; #pwm-cells = <1>; }; }; ... backlight { compatible = "pwm-backlight"; pwms = <&ec_pwm 0 50000>; }; --- .../bindings/mfd/netronix,ntxec.yaml | 19 +++++++++++ .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml -- 2.28.0 diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 596df460f98eb..73c873dda3e70 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,21 @@ examples: interrupts = <11 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <1>; + + ec_pwm: pwm { + compatible = "netronix,ntxec-pwm"; + #pwm-cells = <2>; + }; }; }; + + backlight { + compatible = "pwm-backlight"; + pwms = <&ec_pwm 0 50000>; + power-supply = <&backlight_regulator>; + }; + + backlight_regulator: regulator-dummy { + compatible = "regulator-fixed"; + regulator-name = "backlight"; + }; 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..0c9d2801b8de1 --- /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: 2 + +required: + - compatible + - "#pwm-cells" From patchwork Sat Sep 5 13:32:25 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: 11759115 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 E4247618 for ; Sat, 5 Sep 2020 13:35:19 +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 7F0402072D for ; Sat, 5 Sep 2020 13:35: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="p71cRLrV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="PZZAz0sW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F0402072D 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=lGjJPTDhKiUDhv/4oujFPKMfPgjYs/KZ7S9h11HESB0=; b=p71cRLrV/Y9ni2bltYnwsZr8v MrjOf/W8qAy4koe0gqvJdASIK+o0L3cvTEaUKyGw2eZ3Fv7ynyfaTbUYTCqZkB9AiwgMEmWHWBRYo ZiUsywIuUN9+8FoYKC0AA+hlbrc/W/MWaqag/RNAYwYteKS8pNtf1Rcd+ybzKhXvpib0Gm4JKK1Qr /Dmclef/MpjKK6Sv9d8kSmLKCxnhiX4rRcq/4x9oUWOfIKun3krV81lDIceoKMIIQuvMZqBm/zN6B nbyRlYSPVobFN/WrDbvRRjzOEzvQVVq2Om8gEWaqX5F2OppdXqZBCy69xBTaDOj2af6gfpoZe8FhR TXcil79Ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYLT-0006IE-Pu; Sat, 05 Sep 2020 13:35:07 +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 1kEYLR-0006Gz-Ec for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:35:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312876; bh=NYuBBLNYiGIhFA8o9V2DO+rgKTITXVswEb0z0J0XHbQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PZZAz0sWRcfz36991DP8m6xp3eKauhXE0K4YfzOn+5QIZBC90lhhZDJG1nKjqtzTK p6b+ujbvUAxEabLeXQbGQwXYQ51UjtfS+dAX+gVqZnVTNIA/Vx6DxkPcLbqTN9JWIO bfSOsbcnupi2poRxHd9JqGb9YfRvcgC5mu2txxSQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MFbRs-1kLjKk2AD0-00H3tl; Sat, 05 Sep 2020 15:34:36 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 05/10] pwm: ntxec: Add driver for PWM function in Netronix EC Date: Sat, 5 Sep 2020 15:32:25 +0200 Message-Id: <20200905133230.1014581-6-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:5pnqftFZLWVKcseh85w/XixgLxNOAvblrI3RkgnBGCnWbcUdOQO oR6pTp5i1i9KRv6AEMAEDIyzQAlJojtBLaPfURJpdu1/0ASyla0RXdIjvkOFjaP4sc3LlJ8 xJh02xjBlZutvFYchDqsCsNhLQrB5vxUZosPqH6NoGqqqXBqmBv/M0bZA8KktA2q35/a5tA iCf1U3MUMlRq4AH+juyPw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cf/EYcs42qM=:Litgd/tjvyuyvzxMu1YSS2 fLvKl54JHoKIZ1yz5yGT8zsafFeUBLXMsLyAwwPQ1iOg4nVSfvmt1/RcORbHMgwrfAqvftoV9 J3Yv+phuDNvr75ci2KGj/034Ok1MbTwUSHKWMfEaoMPvsV+Hof1cu/UU5FO5Po6MqsSYT02OE z7TDap1Uo+0ZPUXfuMJbvPdF7YCo64VWmWlv/MQOXS2/vSR0ZqEHNloPxnmSVTobSJEoXHIGu 8zctdgQs0SkKbxtTJmv/uJi9cyOU5WzDd9udffMShAnOkV22w/nsBFX6Jg3pnZbkuqfb6eVlN 83Uudbkx08QoY4ieXs3aVt9OSHylJnj7ggKBnUR0W5U5L6kZzaeies/ffCvqCiQYAfjnmvMHz Fq9WIAZxhjP92fvAddD8VfvvlF/oXgfmAj+1TYzPiT1lXU/fj1QeoFVZv9XMAqUWVprs7d0pb nwd5vaCf+SyTW5JtDFtp7y0uZaJf4+sWsce87DnLMCLYLA92Tqv2h025DjC3ZCusjxP2HjKa6 3PLrghEwkGsbeerM+SeLDPmnbcO/Qw2mJteHVG6NJGaWr4iFa630RzEnDqvT0ZIaBzjLSB7kU KHzjYDh+UOcVPdf0Wx5P0dXKxIHOcY7Q6G0NGmd3OROAJtaD/pA66L2jXGnhWOTC+zrK5z9Kx klK8TreMmie5KAyJdgDimR4Xh2JmtWLR4fyggCzLNdzbPeTfC8VGbUFcJei54Lc6jcZ1N6LY/ hsLpMLjbYCP58rM5Vz11THQEhvCV2eod5Ca1UlEROJMOHOgeGzeBRfmSVAy5hZwVl362qwVMN INdHDDqHMt3GDVgkeMqsCjwgq/IwsCqVZE+zRo84i6FvckQ1G5f5CZwb2odoH+mQS9Mpu6ZX4 Gq7mqzj0j+DbEiCy0PGWN6TCnJHhpamvBffkkmuEH8/175wX62wfgZ6WDeDF5nVTL11n4igLK TrV4xWY/9TI3EgnZH8LSqXg51VnNGGMTqQWh31Vx/qVZVwPfGNV4Pez4ZEfRuNwI5R6j72NlF l3moxh8K5MQZ0OMKQ8MKONtT6nUs/AuR0E+LYhB3YDH6ixGDqas4WEK5C+xs58w0bQ3HELsG4 mxnMPP8i793R3UI0OatXaaf+FdOMil+QGbReqxvY+JpvVD3fFjCYXAgXlf4GfxA0Dtd16uyVJ YfGjX3iscSx7JKYYXWJ/P2XBbIFkhtd4mTbN7g2SRNRbkh19ppqw7nwQ4vMJhzTnqDiVfKn2I c4kGV/RCiw6PquXi36muUXOT19y2In45ftIAsbQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093505_699477_630456E5 X-CRM114-Status: GOOD ( 31.26 ) 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_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 SPF_PASS SPF: sender matches SPF record -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.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 some ebook readers. This patches adds a driver for the PWM output. Signed-off-by: Jonathan Neuschäfer --- v2: - Various grammar and style improvements, as suggested by Uwe Kleine-König, Lee Jones, and Alexandre Belloni - Switch to regmap - Prefix registers with NTXEC_REG_ - Add help text to the Kconfig option - Use the .apply callback instead of the old API - Add a #define for the time base (125ns) - Don't change device state in .probe; this avoids multiple problems - Rework division and overflow check logic to perform divisions in 32 bits - Avoid setting duty cycle to zero, to work around a hardware quirk --- drivers/pwm/Kconfig | 8 ++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ntxec.c | 160 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 drivers/pwm/pwm-ntxec.c -- 2.28.0 diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 7dbcf6973d335..7fd17c6cda95e 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -350,6 +350,14 @@ 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 + help + Say yes here if you want to support the PWM output of the embedded + controller found in certain e-book readers designed by the ODM + Netronix. + 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 2c2ba0a035577..1cc50dba22d1b 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_PXA) += pwm-pxa.o diff --git a/drivers/pwm/pwm-ntxec.c b/drivers/pwm/pwm-ntxec.c new file mode 100644 index 0000000000000..325ec0e8f1996 --- /dev/null +++ b/drivers/pwm/pwm-ntxec.c @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * The Netronix embedded controller is a microcontroller found in some + * e-book readers designed by the ODM Netronix, Inc. It contains RTC, + * battery monitoring, system power management, and PWM functionality. + * + * This driver implements PWM output. + * + * Copyright 2020 Jonathan Neuschäfer + */ + +#include +#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_REG_AUTO_OFF_HI 0xa1 +#define NTXEC_REG_AUTO_OFF_LO 0xa2 +#define NTXEC_REG_ENABLE 0xa3 +#define NTXEC_REG_PERIOD_LOW 0xa4 +#define NTXEC_REG_PERIOD_HIGH 0xa5 +#define NTXEC_REG_DUTY_LOW 0xa6 +#define NTXEC_REG_DUTY_HIGH 0xa7 + +/* Convert an 8-bit value into the correct format for writing into a register */ +#define u8_to_reg(x) (((x) & 0xff) << 8) + +/* + * The time base used in the EC is 8MHz, or 125ns. Period and duty cycle are + * measured in this unit. + */ +#define TIME_BASE_NS 125 + +/* + * The maximum input value (in nanoseconds) is determined by the time base and + * the range of the hardware registers that hold the converted value. + * It fits into 32 bits, so we can do our calculations in 32 bits as well. + */ +#define MAX_PERIOD_NS (TIME_BASE_NS * 0x10000 - 1) + +static int ntxec_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm_dev, + const struct pwm_state *state) +{ + struct ntxec_pwm *pwm = pwmchip_to_pwm(pwm_dev->chip); + unsigned int duty = state->duty_cycle; + unsigned int period = state->period; + int res = 0; + + if (period > MAX_PERIOD_NS) { + dev_warn(pwm->dev, + "Period is not representable in 16 bits after division by %u: %u\n", + TIME_BASE_NS, period); + return -ERANGE; + } + + period /= TIME_BASE_NS; + duty /= TIME_BASE_NS; + + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_PERIOD_HIGH, u8_to_reg(period >> 8)); + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_PERIOD_LOW, u8_to_reg(period)); + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_DUTY_HIGH, u8_to_reg(duty >> 8)); + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_DUTY_LOW, u8_to_reg(duty)); + + if (res < 0) + return -EIO; + + /* + * Writing a duty cycle of zone puts the device into a state where + * writing a higher duty cycle doesn't result in the brightness that it + * usually results in. This can be fixed by cycling the ENABLE register. + * + * As a workaround, write ENABLE=0 when the duty cycle is zero. + */ + if (state->enabled && duty != 0) { + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_ENABLE, u8_to_reg(1)); + + /* Disable the auto-off timer */ + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_AUTO_OFF_HI, u8_to_reg(0xff)); + res |= regmap_write(pwm->ec->regmap, NTXEC_REG_AUTO_OFF_LO, u8_to_reg(0xff)); + return res ? -EIO : 0; + } else { + return regmap_write(pwm->ec->regmap, NTXEC_REG_ENABLE, u8_to_reg(0)); + } +} + +static struct pwm_ops ntxec_pwm_ops = { + .apply = ntxec_pwm_apply, + .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); + + 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 Sep 5 13:32:26 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: 11759119 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 6461415AB for ; Sat, 5 Sep 2020 13:35:32 +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 336712072D for ; Sat, 5 Sep 2020 13:35: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="K/EAdUiB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="k4LfdyL9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 336712072D 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=p0DEI0BVKyCyS5MjizykEveI2k2Vr6Img4E8L2wJQb8=; b=K/EAdUiBitoDrOPj8008cygTN dms8o78GqU1ZU8ZlOUCvLc7eb6G+g9BfFO02Lqk+rKkckmMvCwDGFrkPk+76S60tjs/Q3Odos5D5Z cY3QwolPUzPY4YnL7sYMrtnh4F8e7dBpNJmr0h1P/LkAJL1VRWspcLKLV6a114RZF/780UTGp31aM cHcmjhV3z9+xUn3BUaq8ifm70f4lveNzdHS2c88EZciQUMazZiBXLhsuwTvrPB6HZCihFD3t4m+gt us+7MY/vH9tUQ2hF933vLL3qliTCcmwD+sB9qLIQMPL6pEcsT03JGZW4Wvh6VB86zSDsYqOSzrxiR 3xziU3xrw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYLh-0006Mu-EP; Sat, 05 Sep 2020 13:35:21 +0000 Received: from mout.gmx.net ([212.227.17.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYLe-0006Lf-Rc for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:35:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312888; bh=oB862ovvKrxnFrmHbMCSfUj8GGDxcJ/jixBV6lZKv/Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=k4LfdyL9A+K1gxU3PB7ejxBozNmNntB6J/4OndUwkMCnJgTzmmkv+4XLRVfiaNPTE wgVWJdmKIBk4H/nm0wqw8uIVj2SRa8hUQC24RuZmDR7XzxK6a+hUWO9DrT+qUZcZrD RUA1JOEfdYSlA9rAeiHwEZdz8cSFdQp+o+i5XnE4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M42nY-1kEYL92zs8-0002MP; Sat, 05 Sep 2020 15:34:47 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 06/10] dt-bindings: rtc: Add bindings for Netronix embedded controller RTC Date: Sat, 5 Sep 2020 15:32:26 +0200 Message-Id: <20200905133230.1014581-7-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:TZpuykeJdULCir7TLJLo7AGLc8R0kvTY5dCpFHXfT1Fx47XRCE9 24Jw4Jwoc/bPG+D/c4IQipGKpf/SFgh/I6SRC5zN/ByScZKtbpjyHM15mqNN8s/nG3A3Ohz dsPIwlZzsSWuOdr9cjlnWAbiqL7uVHeqkqFfmuGrWNwMggk1UzWvRTYrMgZC/H++zQCobq+ RMEW1AMp2SjRXxYRHpQxw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:S5q3cVrTyaI=:ie9pgEotpTy1HY6RmNy7Ue XwychflidZQcYVmwYUlzMlyqY5zzAsGkHY1WUO4oOZA3srn9fVzD6ubpkgBTjCr4SWipLvytZ y2zH0egrtJhRwd/0Bh5Q6aKCKHhRd5dKiptC3mPAE+TRnghsixtZL5ukeUwt/TS6IVj9lInnW C3sQwHqwUqrANgZun0tayejT3pVKymdc0POfkz7sL6CwXXxNQrY4ZYT+ro++Sa0scl07yWXT6 axWCWYSOBcFD3i+R9KRMMpuLskfbrO+neEVQWC81vDK3PNsymue2fkCm4tMMvAqRYPKa4BVGb 6qTUki+KlGFCVI+nYnMabYgbEot3NZVwuIkU2Clb55xO7sl54foiduYydTF436qsc+vuZKR9J pZTK89YtX9Sv4js0suhGutQNrTmNW09nDTl/y/O62w98w/x+3P/4RnDeJuqA4mA7I1oO6S/By Pql3GJ0nzYpY2QxHPFD4yfpWvoS2a14mBeMDdgGCavZqf4C1YBlWOITprRxy107m1XC8WkM3F JNNAzLmp2bPe5OIbZW/UXmM7xdYqxlmND9a5y+KU6R2vVvXoJMAVykihBD680kw6Q5AXrUrZz BOqskKZx6BYPXBYJaFDGOZSwMiiq6pcWHDmey+1ogg6GlZKiiOFqsxNPdkzZ/05EjgEycGumP ExVX22RUXMa6T9TyxZWunfxGErVwZgFCGpTnhfaw/e4QwOA/VGfpu4yFinPa/v/ulCgmV+zM7 0I/rDfNuypGPw9KgK+uDgrtfX5PW0qs5Y0p+iY1v9AeYBnak/hVSfk16tCWO03k2WSTiU2cJp SM9fwQI3c1JqIOWj0nybaSvYZiyeTAgcAA9Fj0LlpQSZYT4zpXdTXdRxKOQU9NLgqzW2bqwrU LxsRCNPxAGWbbMRUg/gGE3TJq9RLf1/LRaGIFgaqQBFJxd20AHLuf+xvHBpHupTDC+5cJrtRo 2pF6miDmjVUf4yv7DH6HdqrI0YKVcoF3oo056rr89Oxh6ZSB9JIKUOmGx7qxDpQxMFhQR+HrB vrE35S9Oryt2Fkq4fQo6YzpRDMGmkXmK2B/IWcgRfUBZNy1BxajLa+2iENFYz6RBOleOJnjL9 RqTuuWRAdszLEpL91AUrDe0Mws6L3+wRh29qZsgP2VaaG7qtEnSbGeBrbFoPjWZMsxXn8yyZN 4sjbSXeG1ettPm76PZUw9Bhc4GvwLksuAOaeX6bC6jzn6xEuz/lIrOQZM3o1cB6oXFNBWIhNB 2i0jByC4lobc94/V/AZRWjAA/weU3IAf1N39Qdw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093519_096846_29EB22A8 X-CRM114-Status: GOOD ( 16.80 ) 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.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] 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 SPF_PASS SPF: sender matches SPF record -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 --- v2: - Add plaintext binding to the patch description, for reference For reference, here is the binding in text form: Netronix embedded controller RTC Required properties: - compatible: should be "netronix,ntxec-rtc" Example: embedded-controller@43 { compatible = "netronix,ntxec"; ... rtc { compatible = "netronix,ntxec-rtc"; }; } --- .../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.28.0 diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 73c873dda3e70..7e1a21a82d82b 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 = <2>; }; + + 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 Sep 5 13:32:27 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: 11759121 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 B45F214F9 for ; Sat, 5 Sep 2020 13:36:19 +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 720EA2072D for ; Sat, 5 Sep 2020 13:36: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="oOgEDXB7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="QE1RAvNc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 720EA2072D 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=5gTR+4oZ43kklPQPW4a3oenDRubHuGAzZq9clEjD0G8=; b=oOgEDXB7nkg7sFYv+ar4TigoA /s88WIeYief9nIgJC+375l3Ce2vcIpPAhyQZhrGUdMDrMTZnMF07zuiRKkxBrPGEXPc7vH5pCDLaq 5xw4LJUQHPPzs6ytqvAuc4L2N1PTmTdf1wZu39OHoWFmhSrmiGnDDCnz2+A4Pb/8q3tkfsKNjG1kR A1PJ6Izu0jmI6zs/BZJ7jNGcNmW3n4YqaLImv6Gp6mRKQf9whZAppN1a3AcwuKo0a3WaaV+ho+/rN eM5ANUwUf0h2YdRxGvz4UXbCYkCiTg5YTYQf9MN2zTRvr8mTWbSflU9XYO1OypjmkTcuqhPLLsMIz pP/XbNHDQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYMS-0006eb-O7; Sat, 05 Sep 2020 13:36:08 +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 1kEYMQ-0006dJ-F9 for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 13:36:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312926; bh=5W5bgNq9LYqoutaDK2rdA3mh9k/FJm8P+tiRpaZx/oU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=QE1RAvNcsKuOzWHvtSCwY8f+5D7QfHAziYrgkJQoekPhVEFjQDihltHUXpSnjw5nM tZVqTltohz0fuTEHEuaFTDRDd7SwJLI+tz6f0wOCBwNJg63/ARJuX9WDDAeSNh4zfC EbWa0/1oJLt/Hyvzn5xbJIjNappCqbZDLyFrbfMw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgesG-1kmV7K1v7E-00h63K; Sat, 05 Sep 2020 15:35:26 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 07/10] rtc: Introduce RTC_TIMESTAMP_END_2255 Date: Sat, 5 Sep 2020 15:32:27 +0200 Message-Id: <20200905133230.1014581-8-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:gdbZilmswnyaFo9HLwRIhQfH6ZnJNWEaZw34e8xYCo5CcoTu6Vj f4r7gD746AQYDN3lxm1zljlQC1wQzBfzwb31hL0i8/XNRcXOX+1dLuuh2TAmZYO7Qkh1245 8iXnpFze3eZKkxM4Qvekt7VthPmkb5HFVShC3zPEHqKTebboy8NyKLexLtjw/h6PYd66bWq y7rTxCB8v+jALVbVAUY3A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:z9SeE1U8x8Q=:TvnLuwG5M3R4SehEmJ79gq MLS1kXDrpEa7OI5/hCdMRBzmpZOzktum0GSMQjgXpzhNLGEO7JHVu/i9PVWvAJu4K7T3wzetI 2Bd8wVPlgSnqXgnZgtj6scpIIee35IBd6n7n2LNIKUuYTzC6xq+EsZoMweRnoI5SuKRG0bVc7 GmMlBRqkFGSZBoRUPZX0v4G8XNi8RGuZoGQ/fYdK/V9T/EexxXJRQX58qJ+c0smribAr6yfqy MrTNNIWVF2OUwJGFfHBaDS7PDmRYIhoJPXDUQG2jauijomVVqs1jQfrafIW5sXzhIQjuDu1QQ p9fpKhIjWl31FrA6no0UqmCOPjQX6ZeFirQdw2ADmKnQzYtVtCcmcb+Buo1ha4P/LB9hfriGF kfaih2s6AV9hc2hipPnuY1Oi3t324vCWASwY1wzUttx4WietR+fodWoqSl/UC6/XIfV3j2lSG SrPp8COmooDcZsZExP0zWMMGXyVRE7wZUcli+R+PproKwSZDUz2uVYNxPsAC93AeyrU95eaj/ Ev/z6afzlqpSdn6EdCwj25+zrcMwyjVk00Wrcs7tdZnlb2BVuoxLekSjiIH+yCsmz+insZz58 nYgYdFbYslffgecFRzfEAFlMgNlBg0NrzRRckr7RIHmYONfUsRAhHcQN92rAj/tyLPQAwjMk+ bJrgFZIkoMB0fpPLVd5VnYYefb8KFFZX6+pT/BxH/MC90kC94/SV94nqV+B/PenJ03iSrs9aZ 9ySr6SZhQh9boXOg3p6PP+hf/hc+j/TUl+NwSN9TXoqwAqkPBUxiGoj9Hxq0fqwq16wQ6hH6c FKuAoG1J1EKc8+o2HLuH2WzIUhQQAJvUmdmrbZWyk7eqHV72hw7VLfwkYtQziMJzPdYLJHM7W 1kTvmaLL3AXRL13M+LP7rzIOD76bY+h11DMIaIZjkO7WL5ZTnQaX0H6LumQ4tnYS+hPuBVtfk clDU3xrzpxDoNjq076e33DcSqfgKDlosBSieWiAs/xWu87w9HKOMqteqhTJE4xH3XLUTvL8mU E2FTGqK7bzbevSD/+rm+nMOFGKgS6sEBvpXQrIrCaL1hx4EmU0je6dfjoVOn3Cs0BtKxITiHY fb9sTGbWlreupiGybAVeE7CRfr/NJrDtUw5KVYv+VThHePt4Bqankm8UYvzpUZ+/sL+gVgmo9 gD//aqkpcS4zYljM0auiePsqYBTIcnu/LxAaY/J3dE8U7SH3BjJGELqJrcriO8KmE20PkQQSZ xCcnWx7Ab9DuNLppmxShuYb3rHkUta3tggBSIkA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_093606_722937_E2ADF412 X-CRM114-Status: GOOD ( 14.41 ) 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.20 listed in list.dnswl.org] 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 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 Some RTCs store the year as an 8-bit number relative to the year 2000. This results in a maximum timestamp of 2255-12-31 23:59:59. Signed-off-by: Jonathan Neuschäfer --- v2: - New patch --- include/linux/rtc.h | 1 + 1 file changed, 1 insertion(+) -- 2.28.0 diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 22d1575e4991b..fcc086084a603 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -154,6 +154,7 @@ struct rtc_device { #define RTC_TIMESTAMP_END_2079 3471292799LL /* 2079-12-31 23:59:59 */ #define RTC_TIMESTAMP_END_2099 4102444799LL /* 2099-12-31 23:59:59 */ #define RTC_TIMESTAMP_END_2199 7258118399LL /* 2199-12-31 23:59:59 */ +#define RTC_TIMESTAMP_END_2255 9025257599LL /* 2255-12-31 23:59:59 */ #define RTC_TIMESTAMP_END_9999 253402300799LL /* 9999-12-31 23:59:59 */ extern struct rtc_device *devm_rtc_device_register(struct device *dev, From patchwork Sat Sep 5 14:45:00 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: 11759145 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 3C69D112E for ; Sat, 5 Sep 2020 14:54:30 +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 EF41D208B3 for ; Sat, 5 Sep 2020 14:54:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="G/MuiK3S"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="fGPuaB7R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF41D208B3 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=seCV5YD3mLhFIp5bYcHt0h+VsKqEBGVcIPs0L8WYxAw=; b=G/MuiK3STgp/qtn2DjelFOGhs tbEtXn18t4xO7NbvWxAMbK7lB2J49F1ldUlpSM6acWGTrOFl/MpEysinAozeDF4uILx+BJlxCPd65 IWkG/vjkrxLXe/zL4ELzleZloBhvn95v42kYpnebyJnRbM1XRuOxYbXQaP7Kz17GwUhjOs9yLGEcb cnp1j9PXrCZ0MAbzJZxiXjY+0VpmnUuXhusX6Mgnp+V+vo+u/HAwDmScVpZ3zLgroPCOySchsgEhr osbQv5BQthN7kBfIVKESh7JCe5MP40Q7YMPQIvZYRifV2dHMW9Hl7Nd9ss6Hm7MGhQsqsPblQIAMg rDpZ3SxUQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEZYJ-0002wV-1q; Sat, 05 Sep 2020 14:52:27 +0000 Received: from mout.gmx.net ([212.227.15.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEZYF-0002vz-QT for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 14:52:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599317541; bh=AmcVqt376Z16SI/dPXXTlsZxd3ygG5eId5RZWTXwmYU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=fGPuaB7RffFFwirpNW7YWlIhxcYSBDK9NwYcLhOZsn+FKfnORixNe0U8cYAXJB7Jr clkgFHJ9pHaDPKQA3DeHzBnEw4AIqTW2dgvJ77I/1Rc2WVgf2gFgBG+JWQyj4DWxct kSRFpo5yYy//AufxS0aSImyCfFD5qs29mAReVoEI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTiPv-1k8pu63Yvl-00TzFu; Sat, 05 Sep 2020 16:45:36 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 08/10] rtc: New driver for RTC in Netronix embedded controller Date: Sat, 5 Sep 2020 16:45:00 +0200 Message-Id: <20200905144503.1067124-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:s1Iuy0DqF3nvuCeJDEoK6kI2mBJxXiedCE/mjpNaXYYDwjmv37D RxR6zMa9OiHI6c3hAO40fXIgiLrCbUToOLmrQxoNxuNVYu5CsOSFv5sh2yR5c8DpscEysJC /nYdzmBrKo0DxrcxUpjxHo8yn5AvKv2KxrZCg4floK3I5QMI8c2XBgs4igC0T5OCv0/Kof+ mUzjOZUPeEP+5QnC6jNGA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:5SWfn4hfEiY=:iKTvceN57gmD2GEmGlnaRC RG6omwJ2nmiByVrfSj2qTcvsGSRq4dCShYR0ztwHY/+pvWJnhHx57f3WkdXcHrTHlNJI+ZckN 93UC+Nljb191MhTugvULy4kGhd8gF7O4oQchDGJhcOnUAJTfbFUyLAq+pkCVh5owGHpsxBJMu QruJZ/8T8b9EtACcBt6rCfuzdXzoEcU6cgZ+9TYOQ9j1cfrbfrCWBOz9mM4MnlIUK/u/gFzdN b4TcY3Hby6Zex736wXlWtJ0bKa8THzZu/TBLDw8e778CemgighiAPzrARw6Q3rKZFY5tSosT4 8pr8JrGbj6k1IjQOOApZdVHoKO6fV03CrhMNC+5Q4I6r/c7oh0eGalmxBp+SFuuxXj4nlBtq5 ApREmRkB/SjeCP7dX/KY23Sl2f0R4177u4XF8cEiAN8yPU4Eydb1KCF1PNpclY6IpvY4euI00 xPnTTp+xFnKZpiGtmdubG7aTUWAM/YpGOUaFr9AdQhLIWshR4WgaNPVzfDwC895JcA2z1Fz/m +fEB2KFqoTir0p6g2FxlH9+6vwJ0M9zMSEDfTlnsWMATOiDs7G1h5YyRNpwMAkIeUkyqOSb0C 9/OvhNOjdddYKzKR/Vgqu4Hm1z9WHmI3Qs/HszsfwlcoNQ8Uf65BpWL+JCI+jGutp4/9oyXHX opVEk903ZCQR6Sk0SG5e+dVcWsls7fYTgACOwwkW6LcCafm7+BtzOZ6BVLtX8d6AuhH3zAmZz lpM9w6XG3NQMPABIAk4RZDJq3b/4cBraU3lgIuHajVomU/Tg8C8NStwOwgXoTrD8G0+jT6ksT yRASnL/TFOf26ugj481Nq8OVsiQu1B3rA+952GmDw/KJ5IG4YFzIepFABPmCBPjqoEJ2NlO03 VltVTv161JnAffhedcsGTxScRmW5bcaWlXvqAYcachxz7M6201hLrqYcdqcfor9LuB7unPwjm aF+0GpI/1QdWz0ffFNYBrBrQRr1/dILhyWvl9s0r/CrXuNxQa5LV05J4F7xKtXTNFNwuq6rg9 W/1SLmLQ9+Rug9XWSfU5eG/Dd7yBTMAtouSapfomMADP+7i2fGLR6zuXnkRxt0lXwxtUfvW6T lCwiewDafZCRn1Wjefu/l+0G4o5Lpz6oPs1b12OgKpgRwvrZ6VdfIK3DYa6j6cxBbzEQ9Sy3l pkj6ZYbgXI2vYWUXjp6dcdxrA2ATZ77r9Fo53MplDFgWjgePbohv7cyRCzz6n9rK9XUqRRL09 PIcVlucfhK5j6fELUF5GXvB+8HngmScGagPULcQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_105224_078666_C2BA2262 X-CRM114-Status: GOOD ( 27.79 ) 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.15.18 listed in list.dnswl.org] 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 SPF_PASS SPF: sender matches SPF record -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.18 listed in wl.mailspike.net] 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 --- v2: - Rework top-of-file comment [Lee Jones] - Sort the #include lines [Alexandre Belloni] - don't align = signs in struct initializers [Uwe Kleine-König] - Switch to regmap - Fix register number used to read minutes and seconds - Prefix registers with NTXEC_REG_ - Add help text to the Kconfig option - Use devm_rtc_allocate_device and rtc_register_device, set ->range_min and ->range_max --- drivers/rtc/Kconfig | 8 +++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ntxec.c | 130 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 drivers/rtc/rtc-ntxec.c -- 2.28.0 diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 48c536acd777f..ae8f3dc36c9a3 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -1301,6 +1301,14 @@ 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 + help + Say yes here if you want to support the RTC functionality of the + embedded controller found in certain e-book readers designed by the + ODM Netronix. + comment "on-CPU RTC drivers" config RTC_DRV_ASM9260 diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 880e08a409c3d..733479db18896 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..82eb6352353cd --- /dev/null +++ b/drivers/rtc/rtc-ntxec.c @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * The Netronix embedded controller is a microcontroller found in some + * e-book readers designed by the ODM Netronix, Inc. It contains RTC, + * battery monitoring, system power management, and PWM functionality. + * + * This driver implements access to the RTC time and date. + * + * Copyright 2020 Jonathan Neuschäfer + */ + +#include +#include +#include +#include +#include +#include +#include + +struct ntxec_rtc { + struct device *dev; + struct ntxec *ec; +}; + +#define NTXEC_REG_WRITE_YEAR 0x10 +#define NTXEC_REG_WRITE_MONTH 0x11 +#define NTXEC_REG_WRITE_DAY 0x12 +#define NTXEC_REG_WRITE_HOUR 0x13 +#define NTXEC_REG_WRITE_MINUTE 0x14 +#define NTXEC_REG_WRITE_SECOND 0x15 + +/* Convert an 8-bit value into the correct format for writing into a register */ +#define u8_to_reg(x) (((x) & 0xff) << 8) + +#define NTXEC_REG_READ_YM 0x20 +#define NTXEC_REG_READ_DH 0x21 +#define NTXEC_REG_READ_MS 0x23 + +static int ntxec_read_time(struct device *dev, struct rtc_time *tm) +{ + struct ntxec_rtc *rtc = dev_get_drvdata(dev); + unsigned int value; + int res; + + res = regmap_read(rtc->ec->regmap, NTXEC_REG_READ_YM, &value); + if (res < 0) + return res; + + tm->tm_year = (value >> 8) + 100; + tm->tm_mon = (value & 0xff) - 1; + + res = regmap_read(rtc->ec->regmap, NTXEC_REG_READ_DH, &value); + if (res < 0) + return res; + + tm->tm_mday = value >> 8; + tm->tm_hour = value & 0xff; + + res = regmap_read(rtc->ec->regmap, NTXEC_REG_READ_MS, &value); + if (res < 0) + return res; + + tm->tm_min = value >> 8; + tm->tm_sec = value & 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 |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_YEAR, u8_to_reg(tm->tm_year - 100)); + res |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_MONTH, u8_to_reg(tm->tm_mon + 1)); + res |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_DAY, u8_to_reg(tm->tm_mday)); + res |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_HOUR, u8_to_reg(tm->tm_hour)); + res |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_MINUTE, u8_to_reg(tm->tm_min)); + res |= regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_SECOND, u8_to_reg(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 *dev; + 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); + + dev = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + dev->ops = &ntxec_rtc_ops; + dev->range_min = RTC_TIMESTAMP_BEGIN_2000; + dev->range_max = RTC_TIMESTAMP_END_2255; + + return rtc_register_device(dev); +} + +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 Sep 5 14:45:01 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: 11759155 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 6FF7414F9 for ; Sat, 5 Sep 2020 15:37: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 BB223206B8 for ; Sat, 5 Sep 2020 15:36: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="Ht5zzZSp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FSaM3JMH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="fjaOM5gw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB223206B8 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=nj/4yYvt9dFc0c3gmIscbDAOXDoN+MoELay4Xvb1j1Q=; b=Ht5zzZSpmDqmtQaN+ccR7aJsM IUQ/PX2x2k4B9XD/Ge+m+D1nRnrjoOyrqyeyXDFGBuXY+X5uy51olbE13tuPd483Z8sfJ0ytw+Ivr nlYF38QxkHxuPySzCfEyYqoWx34a2TNI/b+1TJHuG0VZIQwKdIzdO5hK8fx/xJXgzZfOi2d731qfX vQLcSYaG7XmYov8fXGdcmmJ4l9d75lOhzQAE1rUyGYO4hQQ/uF2UtXIkOOEuepwZ4S73MhXMjDE6f HNsrA10p4pWc7mTEI+ppi5LeidwFPigN7v9Hn/arVG+0jl11lEnkA4WSvpkVuwKImZkM+uVxqBQtz xB49eM10Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEaF8-0005Ql-NA; Sat, 05 Sep 2020 15:36:42 +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 1kEaF7-0005Qd-DW for linux-arm-kernel@merlin.infradead.org; Sat, 05 Sep 2020 15:36:41 +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=FrQttvKYWoOxMjIE2u8aMCNCz0ApHKBVNarqK/Q1b/k=; b=FSaM3JMHD3tGS9SF96XKFCM65+ sXAJVDnixnjqTzbuZqp7ul9upchUwiW2NCHIo2/MZ/gnyx/aj+Se/l5JOHoUC58LPV4k7V4YWGrqs BFBQn7bG3GQRPSTKtLmx2NobRRg4oLqJ27nA4RG10rb7G7NVQ7M2lPrfbwZcBk5UonvmALyBwNVO1 R2sY5WJ3AbjPFl3D33g6Xo/A6MltM01Ne2VS9ao9nuCnU+cBkcezGjpfS3L0/31pSKl3K092A/bAy /zmQ/cr2SXF9AV+B3180cut+oyV5NZKWLkQuStMEEvWzqvbDbkfCbyUZtoKm0uZCHPPZgHdDAdd4F uF2lLAVA==; Received: from mout.gmx.net ([212.227.17.20]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEaF3-0002ts-9J for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 15:36:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599320188; bh=RAHiNLnG3IuCWYe2owQpbYIJlYLYNj31Ysy4ZzQO/Kk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=fjaOM5gwjwu/f+ViCQ1/pphi5Ppsl84h2QTmR36V853gvzWvgumDB6w7qyzpfhzOQ 6arfpVsipqU1YsLAHVwQpbI6Dm0sC0INmtlycKUBnGxOE3ymtYJBL4B3WOi0cD/pbj QWz0zLh1o//YiFB188GznW25VpT9S6v0cQdvkIR0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOzSu-1jvxiV0uAG-00PQz1; Sat, 05 Sep 2020 16:46:31 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 09/10] MAINTAINERS: Add entry for Netronix embedded controller Date: Sat, 5 Sep 2020 16:45:01 +0200 Message-Id: <20200905144503.1067124-2-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:/DsAtZ/PqYMgUwapHdEQ/vTEgQHX9OrG+983qc0/gY1GqdsLSyE C5PYbHAjRpbdE0HgY/pvNaD7H4MioM5n/jdxlXlWetPImCNmiB4Kcjw1lppFodHRxNywoT/ 5k0fx6BVM+VEi+lbYypkVXW54Mxri2GMWWGIsQQcyNPqZ7RhuorWD8WpQIuGO8WgTxx/HMN RPVZxXlmA48rgTjIQohvw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ti0kpmpB5QI=:dzY4sHrL1yp2wFV72WKOCA 6sCsHThgLCi3K5U+QFPUsJCRqk+F8/SSbnUktdYYRbEx3gIrMqB86COfOSQT5mzGNF/QjQTkO FXfGZPfvwkNQwxBAl958O7sQFwh8Qi8DbmdB64wOHQpf8J1BKZ4KDOIytJrneqGGGWH9mncOQ 1lsukMoR33meklaGra2rwL8bYSALxt7Sklot03XscjWBlH+8e/0nY0Rm+kcVr+jaygjIfJwFl IOf+7VTC75e67xIJ2Jliea6hsoVeBypPjQJDfj9vYMQBjCLBCwKHzgJXc95P3OQu5tSHiobn7 ltTSkdqxaixgtQAz8D/S5tYSk+Whk+an5ELm/diYzHGp3wOwqmM4NgckDuR+vCg9eR7z95Ktd eurW91v4kc/IBIXwnzaZoyjXTSSgfkXLTc3yV+FqHOnQGsgY4o9bZVmcQp66qSTA7wy5n0yzw MQeJa8R8ZEORoWsKyVay4Xo40c1Kgl60yVl2LFStTAWtajZbSB1jD0GpdIe4uTdljblySGOGE 7xWKaZxQ3VrAm+i7d0kj3FiLC/A+/ni3gD7nSeTH3KES3Pa8KcxkfxRpOIVeQnBGSNwdm7una H8vbL6PEpAH9mys/KcfHdCNg47xBFUGcRSBO4hWwkT5W2MW4kM0w+uvBZpfT/FIIZ0uwlfokp HLe7VqTby8QLS97MRZZ/vgWe8DYFMPLGtyFTYtHiXmj36FUTQPsiQIQ1moqkyrVviY5RZtUMT ZOePo0uYTAadCkgZAG8B+RU4eXgxfBG9+zCfuSjrr5+Ewi8XczFMDsXa5PAqnNSM1j08GZzqQ UrOhHSlabeFvPDX0u4zAGJK/IDhNuRZAZQvMe9JB1f2myYCal0OwYZBD7rAhs5zp295gXRfff hXwT2Jvt4Cg5CvvUgViU4lqCx5FCA4hGMwPCfB2sFpWp55HFX4O0CgZq5XbY8lNBj+nwNSmqR bZPl1ESSm0bR18xmuzcyK/amBiUctuvsbzKouc/XMVRhD5R5DjvogDWadpYFZxS1PPdv2/8zO 59yRC3bgVQt+OqQF2M1U2nZ/+HdC/N7/SqeuxRY972qtPpg8ex4jfgHbQGhLC2Qjd6A1Q7dwJ 0vUQH/ag0UJB5W9yxhq/w2GCLiizT3Jtj0MufRWtvmLwEGtw9kRax+OQl9IncJdNnlQdxe2n2 mVqsp4Kp9g6qkddw5jmsC4QnD3PbfpiX/UndDsBAMTNLbk4pIZZa47KWsraTEBv/VwqqQQTh1 8ujGnyjoOX8cOWgkusY0gLHWS2R0jrP3812kKsg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_163637_479770_FD1AC3E9 X-CRM114-Status: GOOD ( 11.95 ) 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.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] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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, Rob Herring , Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 --- v2: - No changes --- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.28.0 diff --git a/MAINTAINERS b/MAINTAINERS index e4647c84c987e..ffe15a65bae2e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11995,6 +11995,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: Simon Horman R: Jakub Kicinski From patchwork Sat Sep 5 14:45:02 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: 11759147 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 6313E92C for ; Sat, 5 Sep 2020 14:56: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 2CFCD208B3 for ; Sat, 5 Sep 2020 14:56: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="EPGxfSl4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="i4x4DLes" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CFCD208B3 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=fcWCdyujLgWFZu+9RKyhkl/LjFSFdsAmXJfT/KNFiPk=; b=EPGxfSl4MPTLYNHJPMmOYn5g5 jLT2Jabo7LDXe2iK1NX+mowTDRp+oRXtunwAiqdHY4wl/wq4SF7RqCM0Tdh84OXVzXWtH1WmHZmAx 1rktq02POLQzqtt/W1izv7E8b1yEtCaO6Ha0wHdsPuw5BDlkYmlldZQ1f+FiZxw48mU40PhCi6DMR J7Oe4qFJjofmYYMDzCdl9hOVG6dMUz4hrOsbvUvw0c+d5XQLe/T7IxvICGqAdRFxgiZDvjiOys/wG PhYcx2on9QDIH9bJ2/iqlF/ovznYgIG5MjxxVFk00HIyIz2DkOF0dduwHyrjt1J7CSgP4apTC2Pfc BoS1pMP0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEZb8-00035S-KH; Sat, 05 Sep 2020 14:55:22 +0000 Received: from mout.gmx.net ([212.227.17.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEZb6-000351-H4 for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 14:55:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599317719; bh=IEqH3VoTRXkoCSwxpZXBM0ZvuxmxgH/x3EDZy/MG2ug=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=i4x4DLesx36NbPgIIw5rOLeihOyVHf1ZaEmZRJVgKRqUAoRaACGIs1+BdJhq6EZ/J Oqps5yba21wzHSasLqcGxUu0pS6e/6S6EfQKFR9UqLtzsMv0YgO88MucDY4rw+ALxT yDaj+fV9aQC0kRCnzBkWUYl8nhYLnWlVxelwFpOs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxDkm-1kTvby1Z5U-00xYm9; Sat, 05 Sep 2020 16:48:22 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 10/10] ARM: dts: imx50-kobo-aura: Add Netronix embedded controller Date: Sat, 5 Sep 2020 16:45:02 +0200 Message-Id: <20200905144503.1067124-3-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:vd9WOJrL43K7tgXIjq+fdw9XpujdDSKHb/13PJSlNAFTkIecV3o YX60zXdJjQ7qrZGkVCx1QVkyHK577opkAkZxYApe/pLtMTeHNJdsZBVrxxltqp8R826PARL YT8qR1GI4TmQgraabm+q2Jo32c+tsVXi91TIHEnv5RGm3QIjbzxvXecgaroLZC4XJTqqpdO nUWXhlV+LNhWwUkEfiCzQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9tY5OlXt8p0=:LYF5y4mOfTOcCi0fgO3yTt 53Gmtl48fkQ1Bi6K+Bdiv2jK83azr4T75HHTGUOM+ogBQ/8Ip8QYS0LAxyNT7C3/79pkPqVJq CYU8/doVgJ5IAA/1jH2AjFDKVKGcGz5g4IbgrbJYbWcJx4FVv4/BlTRo0ahbhfz/l6UsJrJ13 c87ZDJFJts/aXWrTz1jlYIs7u6IXW99LDRV1tzX+p8eF6QD/v73JvQKb7LWmRff0pKOpOpJXP kliaNsYvWqummxc3zEfVrv6QmVPYnCt3vn52F7w8HpddaxK3n5Uyl0GrPvQUMRU5wsEkSXPOb RsH+tR0d4p8+t8yXjuDmjou7rfuVs23HGsIiZqDKN25Ra8JtlJPrW5wBbw7jx8LFMDng0oHJB 2tmtXd0fK/+W0bYasBMy5zXds/WGNI0+XFiYNoSZ9LP9uLudVXf+uz8jzPruL8EbgL9HHS99m rObCpdkzq9Fom8FBrxwhZ8/N9Hyyf+oer2YGB2naLcw4S33oGJ7ytFYWZMc5CaXbhBBkXoo3j U73IpzqpZaECgNKRM176IPJc2zCmcrzUrri+eGLPa9rEhQzEugoF1fdYoIeU9pqrXwJFj2UZh DerBnATSiGgjlTgJHjghFAC0qAHJ6TmeW+7cF1sW+qgHGjeQE94eC8UML/iW31cYr/uBIbWrW 4TPNXJKKHnNqi6ArC3wvC90gKPqj7Q3dm/AqHwZarII0ZBUU8O/oJQtRybOVdm9yYyuKHl65q s2rTwWA2CNHrEYRH7MWPlowiOM6mY0mmt1ztqjKeQ+yzobNBhGVCLZIPrEMefK1lgwcQ/18P2 i6y5Zh1agZUw7aoTcuDg8lMVPuuBwiuSveIUtElbvhidK6II0RjzAqpPOEfxY76YYsPfd4Wky CvokXktCjWYMh7wafeTXhlqBfPGGLWQWnrlRFILmzBV75MmEsZQ4aBteJoijON92cE5ZNGJL/ 5VQVRLp8GeSCGB2e07otYIQqurcpyPNOOB5ebwtSC8XByvcX/Q99Zi1Ci9/fzomA2SW+X21qQ RI4QgKMONf5HbYgL3ZQHYiAo8B7UgaXnzzInrOZe8ZngvtXLJWRV2n92++Kis7ktbje/wKnAP eYbZc4ud+n4g+CRP5KvIrRJOk5MDpMJVx0m/VYpTFSwZbsc6PW+2ny/IUW/JHyTU8yc/OUcvS QhfiN/jTw6YOFE4k4j6Pn84ejZMgPts9JmvCeD6ISuUXWXNg8jSUw7VxS5D+FU2AAgRK258UH 50Z/wDbX9j8jP/IRBnr1XFvh7MQkloB3J4/g7Bg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_105520_766802_F77B5DFC X-CRM114-Status: GOOD ( 15.94 ) 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.21 listed in list.dnswl.org] 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 SPF_PASS SPF: sender matches SPF record -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.21 listed in wl.mailspike.net] 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, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , 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 --- v2: - Fix pwm-cells property (should be 2, not 1) --- arch/arm/boot/dts/imx50-kobo-aura.dts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) -- 2.28.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