From patchwork Sat Jan 9 18:02:13 2021 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: 12008587 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.7 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 214FAC433DB for ; Sat, 9 Jan 2021 18:05:58 +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 B6942239FE for ; Sat, 9 Jan 2021 18:05:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6942239FE 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=8tVfeQ4AgmtqYD7AMY0uYDPryip4T2NZCB7qrJr/jow=; b=2ypGLCkRZRU/RMa/THSfbVgwt5 UQpR7RkWH8eHVzTjpmuO6QIiy7hxxwm60BS8rQunmrUIYWAbe8oKkV3N/45XPbJj4IgCIN3kH1K/Y Imb7mMo6dQJgv6qftzxOvXPUBZw6WOE044/lwpm5nvp3NUUoqGjB/WP42yziwh2IPWOFf6aIXVDvB XB70I26I9o9iksxpjlMBKQkQecq2qzfMvo8f2lweHaqczJgjr6lfbNX3wWjEyxQJ8c9yHzPIE0C/L V3AqGT9p/LPqIQLl6sLbk84TLJPsQzKz0o416zqZvwRMt3Ad+efccV2cI2f2IWBakrZeBSi0GbPos gq7o5vqw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyIaX-0000eI-3x; Sat, 09 Jan 2021 18:03:45 +0000 Received: from mout.gmx.net ([212.227.15.19]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyIaR-0000d1-Vc for linux-arm-kernel@lists.infradead.org; Sat, 09 Jan 2021 18:03:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610215372; bh=GshT6Emj2YPd4xDlfNg8v444oOEqvQ7VPXB25G6wNjg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=ST/NLreBMxyp3rs0wQyPO8T5jXl6de4euwFAOyNHsdPUil/tvCTA5b7hU2IRjhLC2 NFU5TE34tu0HCpZbdO59nbcRUbV3XotSLzebrJzLAtq9V0xpn/JAf/Tvh8zwG1Wb4B z6XSXWNGTHPKNSLhPi5r2kDOWn2MZcv/9i0+JAWE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([37.201.215.57]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhlKs-1kKa2l352O-00dlrC; Sat, 09 Jan 2021 19:02:51 +0100 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v7 0/7] Netronix embedded controller driver for Kobo and Tolino ebook readers Date: Sat, 9 Jan 2021 19:02:13 +0100 Message-Id: <20210109180220.121511-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:PpsWGt2cJ2vTxq46vyyclCzBKkk9EFV5FUbpr9tDhdVWQPdDBWy sLYlF1q/j78lAA7uI64n01A5VNRR3dPyWjtOq3zUMvw9y3J/Uoal+O0IESEkhJCvbZghvqB NVQJ7NOduA2MAOiWM9zuBnQCTfBvpSR6KXu84SFkxVywlWa3UTORO5MlpCnBEt16SedwKuV wUhpyhJwuriv2nN6zSSSA== X-UI-Out-Filterresults: notjunk:1;V03:K0:NbWmK64jiis=:A2NkSQOAqPUQo2ba7pYZs0 3HXT3+nzeiRSKIHJKZN1D8M/fUNKOE/kziqOVujnV4i2KGoFmNcD1nJia0qoKLvONKIQbyL5p LV+9YZsqIEIigKsmL7NZhKcG0xx+r2F8SBZ6WWKHBqf7LLyG5JnUV8SaGEVFgjNWBGJXEkz2O 53eusRgy9LNpfzM7UErM4TBqe5Oh7a+HGpnSxSPWfq7X4TgZt8xKXQ6jIBJxRi0uZoKDUmBfW uqEpZWS3Onf4O52Tz0o9IXcHFYai2itL9Mzi+X1GiCx1I8smbY5OFvoDz4csdftiXyMXUPNiw FRf2TIBIhLDyekQM9qZSmTzysRvBTUkV3gYPzoDpN4VDabTwJegiZ6LGSRV37sUkao7eT5M35 KD+UFbt8gCvGKpx/yaS8ChaxdjkNBjYE5uHCM+rvu8fw6Skslyhh3bMPr5oLW+bkqsLp815g5 7QXlp22GJIfCrLvIHkxE/Kpvq77K3icoV0D5vp1v96kVgM+hzeKyq5KWdMcBARj7ttGJrEsW+ O3C7NWmAeqOZYOHuRvW7iZvCi7jHCJgRWh0cgvgh7BpO+yzfCIVJgdiBbE1qeuUxOCFMJMZDt 5KqC23Yft0Ag2pPD8uADEgc/S823kWTgdryiFhsfNstEbGhvRjMozm7p0NpRuQhM3hSe2sQqG akJXhd7wBl2ciqoii8fX2eibd7z7A0kpXrtvYjwCukwQoMD31CSlNZky8E7fJP04n4inPJlsK gmaT8WHerihM1wPg8y526FeVN5x8/6bnollzQA2ZEaAJanQlEasBo400NdtgCjyzzstEkDdoA ydrfGwCzK/mliYE8iCzIKkaPAdFw5zXFMCZ9FWIMNiKoMSUisVdSqaWLqbU4GTQcJaa/IhwfA Xyu30HMHUusyR0rXDrAw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210109_130340_470019_1F23C9DE X-CRM114-Status: GOOD ( 20.45 ) 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 v7: - Adjust the RTC patch to a change in the RTC API: rtc_register_device is now devm_rtc_register_device. - Add a #define for the known firmware version (0xd726). Lee Jones suggested doing this in a follow-up patch, but since I'm respinning the series anyway, I'm doing it here. v6: - Additional cleanups in the PWM driver - Added Lee Jones' ACK to the MFD driver patch v5: - https://lore.kernel.org/lkml/20201201011513.1627028-1-j.neuschaefer@gmx.net/ - 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: - https://lore.kernel.org/lkml/20201122222739.1455132-1-j.neuschaefer@gmx.net/ - 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 | 182 +++++++++++++++ drivers/rtc/Kconfig | 8 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ntxec.c | 143 ++++++++++++ include/linux/mfd/ntxec.h | 37 +++ 14 files changed, 710 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