From patchwork Tue Dec 8 01:09:53 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: 11957339 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 03E65C433FE for ; Tue, 8 Dec 2020 01:12:46 +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 9FEBA23A31 for ; Tue, 8 Dec 2020 01:12:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FEBA23A31 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=sHHqSQEIvLqDcoTbKJqz3ee2U5+jtjVk+UATsQm8qK0=; b=DsJArvPs1dHpIEWScSyv9EwrIb Tme46BfBrt3SpvvtK2FW1eqngEYSH6Clyg0l/h1iiS9XoV2zOLOm5GwzU185Shqkqf6swhDhZHPlc /f4znvjv13fAnwBKyRZ2pfGtIDztZciIyN2UHXo7DhEmfh8rDxDXbaeDENa3JaHrVIR6DsNM28gM9 NMeeiAycOYwSxmMASARxEDJmANKiFy3hiqa8hF7SwR7REvuWL8oRae8qacmY1N5okLD8OXcn+2VpD JEGC8w6bjuAC0ejNGdRLKcU+Z3IO+MiU6b0BDb7Q5R8siUkEAd6o1TvCdLfwmzL1/csU7eQpNGJEt YeV7xYzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmRXJ-0002DL-AW; Tue, 08 Dec 2020 01:11:25 +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 1kmRXF-0002Ca-9K for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 01:11:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607389833; bh=c2lCCBVoa7NqW2IXm0ep6Gr7hxzbV7nLmo8Osur1zL8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=HaXbRuvjOW0L6G8c17mgTHyugFAiyKMteYoXCU7xVLNEbTfrLlIMw1Ex1DZ4YH9yr pG3H4ZnAF/U2ZZYt/Jo6g7C2XfvBXK/+PMo7NbcY+1zI8u3fNb3RWl/HQbWTr3e0hJ C+bmRWU+ERWjAKzWJTmV7uzFptLyPdvh6piP1rNo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([37.201.214.162]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MRmjw-1karlC3K94-00TE92; Tue, 08 Dec 2020 02:10:32 +0100 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [PATCH v6 0/7] Netronix embedded controller driver for Kobo and Tolino ebook readers Date: Tue, 8 Dec 2020 02:09:53 +0100 Message-Id: <20201208011000.3060239-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:ENIIn/3dWWFC0mU8QABx04IqRQNtlQplYarvQi2oFDUQAt2m2ut BJGgQaypc6cxCjKxNuwva0m90bI6EZAvWEn0p4LkHYlTjEUEah60A/UlKndmgs/NIgtPNMg 0vVEbVt7wOHQ5Z3IS2UNoDCFTGbRc1zM/TT/0eYLCUir7UlL+Upmzu9f7McK8Tx7X1uo99r A8TceVMKBDLGVPsW+KhaA== X-UI-Out-Filterresults: notjunk:1;V03:K0:sNemWzqW2uc=:Su5D5oQVYl1XOWjq4lg79i JRvqY/9eBBz6VaKAj5XhhOb/hjNgfuSPJm0iM9/fULHe5iZO1D3oC3He/95RhSR7CCgrZgx/s JiP6wNXHZ/yGWBKC1Fe4Mh4L0PRM/WO6Ev7+PfFjzdWR5PkaST+ioJAq8BdL5UasoOh60c64Z MKtOi7IiMwR0UrK1A+3oOkZNbXEYhZR5uWwtD9do6+3Z1uD/fTjWDKvYGuxgGxQb6aNhKx1a3 Od9ZuN+LWWiz0ZAurkxl9lOjEka8bAQR9ejXkQcNrtVkwF1XmEDnTDZSiafTOWGWuYGGYMQJM 9c+aZq2TtTOZwHGn/1bO84LjNryA/xWiSfI2bTkDYeDzG078Q6BhQdvsdHtG5CUBfcfhCoNL2 xOgObxJR/fjXPNt88JdBnaoS2iw1g+Im0BLOyaihw+koTjIaDedBFzorC0+zEcKxl7KqUaFtM 5izSk1Y5n+dasZ9s27FFSBuxo8MfOrElYrkKEIRkgfm2hZYrfaL3LIFrSB94uJ5CHxeMGpgg0 EcfM9FOXB/852eew3IsAM2xJCHF/6egla00scF5qTMqyHT8pe6mRQjLp32t7UBT+g+zuFyOti MwQggpF+iJ6+cLQuBchQwgL1R50bEkzhZ3oQNHaRznDbnksqkdhDu96RFh0Dfq2doS+Zn36hh CNXHLUfvJuINuVOn0FCvLmAyK71rdU8wZTs/QdcoU3M4WAEYf9Pj+4fiM59LT882/PL/MlsO2 W544ZtmqqgGkbxzz8N4JXshfNe8YBtrfCdseHYAeaPZWNcDjpHqc2z/jJZLRQHnLGDLU5wcJ+ EI7Shf32413Bd9tLUjnWeTlnAkS+szoyy/ALrbcyq5XuTSKAdnWGypl6c9Lf4+0FenAAucfCw MCLehzvyJ9rWmsOHa5jg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201207_201121_633195_1C7EA55D X-CRM114-Status: GOOD ( 20.53 ) 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 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 | 34 +++ 14 files changed, 707 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