From patchwork Tue Dec 1 01:15:06 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: 11941733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93C81C63777 for ; Tue, 1 Dec 2020 01:18:23 +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 26CCC2085B for ; Tue, 1 Dec 2020 01:18:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r/ZHKMAA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Juwbyv1K"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="bzTeNGFS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26CCC2085B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=LLhe2NkBrygJ/Fl3TtdIdx0B7GB2bSwBPGSdXJ866K4=; b=r/ZHKMAAusVbmhs6Dq7KthFPTD 3HWOnEyXaPn3KrJyDJy42izoAIZzbztdr2QiRAoJiw2/QS17ko4h4WgXDv0Mf6idi3HQLgP9tVIzn HMqqDJecKC+PX/cNDsfRpYp7Eyj+nwPznQGeaZgoqYhTKJaJDXSWEqBtq3BPq2G4sVESiAX7dvqqQ 1aIzlQlhH8O7szlGB14u+Bw+09Sy406rDXSJA5MtkLCPIvC82jCkW2T6P6FC1zv3qqDoSEqOC8dDd ydddrU55DwR4ANiouDd4xqJyEGDBkYFPBiOAoUnoA3SPgGePJPIwmA1tmFZDQ/tIWBhp7m7wv7bN7 p8X4ybdA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjuHt-0001Jy-2x; Tue, 01 Dec 2020 01:17:01 +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 1kjuHr-0001Jq-Ax for linux-arm-kernel@merlin.infradead.org; Tue, 01 Dec 2020 01:16:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=ABVoxiC2UiOe0TgAnXAlMgUYDeyBL+/q1V6knR6yM2I=; b=Juwbyv1KDb7uMRw+fceQ7U6Vg9 XIJRhacWfBZiYnEeukYdW4G8mzsSrLBpSjLZYGTK5/mIOCJl7q79uKJ6/AEZykcBfZYFpJAUrGC7v 5MECbsmwSE84hs59miCJ/VyeWHrwALjV654VixLXkLM8Dr5AZTYrVCCTWdna4DYy25V1pF6MXmrOC TwuFqZkS2dM+9gBjXiFIwcwPDxUt3XcddPSuvZFi7mi+5m4stvKU9S0XgOrFxEez0vPNQPXwfj1vY og261X109GaNG3nsDhTYpkIm99xDGA/q7Cm88MxXaJPkeiyNTOD2117oOMh5ZQf3f7rWlXsW19aH1 iSxbIz4w==; Received: from mout.gmx.net ([212.227.17.20]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjuHl-0007Nv-EQ for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2020 01:16:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606785355; bh=mD0Si5W49evwADqXMAI9/Un1LBCPTBcDxQlGOJrxn+g=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=bzTeNGFSNBvYoVCNZ2QIQpDvSFOpk5YVXzIIepsg0gYvdAfglsEj4reL5k7dCGXtM yc0cHM5SaFmJcDlj/+2GJiS9ZkvaO4ZTswUbjRsoStFc9TUYrRmpX5SK89DPyQqmy7 QvcWpHJKUi/8r3yKziP4FZHA6MPV6DEP76WkBYf8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([37.201.214.162]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MFKGP-1kz2R80npR-00FilY; Tue, 01 Dec 2020 02:15:55 +0100 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v5 0/7] Netronix embedded controller driver for Kobo and Tolino ebook readers Date: Tue, 1 Dec 2020 02:15:06 +0100 Message-Id: <20201201011513.1627028-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:SX923n3QBE3V79LeM2lq2SqSH46aAJ2pp9lz28fvewY9IxFxeum tIlpd4v6DpGfzWKWtfuGqjC8aOqs8k8zHIUMm5ohrLHV/V+p9ik5AeNb1+H5VlzG7RxLh6o MRRnQA6qEc5dzG58N4nNHIUGI1R6WX/DA5VRmNp/1qLj8qAt3Ib5eBbWzqUcIGmv0QpENY6 wlOh0zbRFEFgHy+hZIJDQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:bvndPoRiDog=:XjqbPRvTdzaE3VMzEp6pW6 KyYdfRIs8iSO7faGcBMo7mnh1P7GCWPtlkWgT6p7l86fDptWXxYRMSn2zD9yYEtZpx1JkgD3O ictGk1EDF3a5/3Twfe1/qzk1Gol7y8NSV5M0wan0uz2sSnavNjvTRUloyB0pl+nI5t+wPyyWm fy4u4Sueh8obE2zamTRx/+pwzAxWGL/Q4tcfg6usqmVtExbRmEo8KAb+tM0lfUdaoCdqSaHeU 9sd7RITBsFIzprN7A6dHFELpodJNrIY8CVpDWMA3gw3Rsl3OK7iy/UZwNWgbD/q5wfgKoYO4I jBx7Eu+97n15tWkPJvcbCJZEiXxtcoxU9oFIFEJ7YnjVyXBSQ6mpIdtWgVyR2WJTgbZc88Iis JbFwEEehGcZPV5sXoti9LEbIJyhHnUauBaEsaRULn/HNyDZRlNVn5Tqn0pP6FN9oEBTd5L16e vGbzyaC4GvprTD5OZ8nZK0wmbKTohGtkk4lvcRSG1xoZfMkAGxh+eZdg+0ToDmoc2NdTX25pA Ypfnt2Px73JJNh7mRuTrYI0U09ZL0WNbqbxgQQ/MBFKWQYxUa22M90Fzb5OUndYfQXJd5bVpT mZsOWse/zBgBPglsAR6O7Vc0Vcos0Dsp9nvp3mJglobtJJawk9o0DG0Zaa+bRa/OPys0NQw4U 1RP1jqTD5xTd/5B8RETDkqJMxcY0jj5hH7BpkhxALjqyJDy44lnpPajnQYfZRFBnloO70PGUr y23sSY7lMi5jVjZ4KRb4Psmb7yJbXkjRvrySeLHCATTITbW+oXq/mx1ps0zZHA9fVbGVdE76z ZYFnxQOk4aXwpl0UKCwdY8iApUDFdwsV5PqDuuxf2I/9dsi2zaHWwym7Dfk0H1artAdnVc3Wm sO8D/Osnx7zUicaov8EA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201201_011654_078717_F40F6FBE X-CRM114-Status: GOOD ( 19.47 ) 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 , Andy Shevchenko , 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patchset adds basic support for the embedded controller found on older ebook reader boards designed by/with the ODM Netronix Inc.[1] and sold by Kobo or Tolino, for example the Kobo Aura and the Tolino Shine. These drivers are based on information contained in the vendor kernel sources, but in order to all information in a single place, I documented the register interface of the EC on GitHub[2]. [1]: http://www.netronixinc.com/products.aspx?ID=1 [2]: https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-controller v5: - Avoid truncation of PWM period and duty cycle to 32 bits - A few cleanups and additional comments in the PWM driver - Use regmap_multi_reg_write v4: - Spell out ODM (original design manufacturer) - Solve corner cases in the RTC driver - Clean up use of log levels vs. error codes - Add more comments explaining some peculiarities - Add missing MODULE_ALIAS lines - Various other cleanups v3: - https://lore.kernel.org/lkml/20200924192455.2484005-1-j.neuschaefer@gmx.net/ - A few code cleanups - A few devicetree related cleanups - PWM and RTC functionality were moved from subnodes in the devicetree to the main node. This also means that the subdrivers no longer need DT compatible strings, but are instead loaded via the mfd_cell mechanism. - The drivers are now published under GPLv2-or-later rather than GPLv2-only. v2: - https://lore.kernel.org/lkml/20200905133230.1014581-1-j.neuschaefer@gmx.net/ - Moved txt DT bindings to patch descriptions and removed patch 1/10 "DT bindings in plain text format" - New patch 7/10 "rtc: Introduce RTC_TIMESTAMP_END_2255" - Rebased on 5.9-rc3 - Various other changes which are documented in each patch v1: - https://lore.kernel.org/lkml/20200620223915.1311485-1-j.neuschaefer@gmx.net/ Jonathan Neuschäfer (7): dt-bindings: Add vendor prefix for Netronix, Inc. dt-bindings: mfd: Add binding for Netronix embedded controller mfd: Add base driver for Netronix embedded controller pwm: ntxec: Add driver for PWM function in Netronix EC rtc: New driver for RTC in Netronix embedded controller MAINTAINERS: Add entry for Netronix embedded controller ARM: dts: imx50-kobo-aura: Add Netronix embedded controller .../bindings/mfd/netronix,ntxec.yaml | 76 ++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 9 + arch/arm/boot/dts/imx50-kobo-aura.dts | 16 +- drivers/mfd/Kconfig | 11 + drivers/mfd/Makefile | 1 + drivers/mfd/ntxec.c | 216 ++++++++++++++++++ drivers/pwm/Kconfig | 8 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ntxec.c | 173 ++++++++++++++ drivers/rtc/Kconfig | 8 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ntxec.c | 143 ++++++++++++ include/linux/mfd/ntxec.h | 34 +++ 14 files changed, 698 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml create mode 100644 drivers/mfd/ntxec.c create mode 100644 drivers/pwm/pwm-ntxec.c create mode 100644 drivers/rtc/rtc-ntxec.c create mode 100644 include/linux/mfd/ntxec.h --- 2.29.2