From patchwork Sat Jun 20 22:39:04 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: 11617681 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 F1EB513A0 for ; Mon, 22 Jun 2020 13:15:15 +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 C89982068F for ; Mon, 22 Jun 2020 13:15:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u38YdjA2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="GJKPSaTT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="kH7Ei4ie" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C89982068F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YI8yEEEbZzPy918YvgJqxSL/cipTFQ0cff4CIE4yEdQ=; b=u38YdjA2EnV3CjLE41TG664h30 /WYY4olvOJi8a2AUxfFIuu+gax22PNBNIcfFxYJ8BvnnJbC2JgUQ8D0WdfSLtMpXf6njhKblmy76j 8Z5WpkxqhSutAeTZzoIxJ9U50P9XKEMkSXB67wok4MxCDxsnt5MqThiygGNZNsgcFqsgnk+fWn3Wl Vj6JOPI4lJCq8OF94Qajdf9ifl/bFmfAQqON17Cdi4T4DuMWB5VUnYsBGNzhbdLiPgbUY71yqDtBP 4kU6MZUNu4H6VAXDiFbaSv0QdgcDF1E1fxB4mgeR7KVUK2aNmF7z/vV57g8VTJ5Hf8oq5bnuOZ12k e/1SxFTg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMFC-0003Hd-9s; Mon, 22 Jun 2020 13:12:17 +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 1jnLvR-000427-E7 for linux-arm-kernel@merlin.infradead.org; Mon, 22 Jun 2020 12:51:50 +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=IYYyHvNEv2QRuxHtV61fRlP/PnXBjwbRHXsYKGz/Dlg=; b=GJKPSaTTwtjcXUhBBafuA3fedZ 7GSkNrtznNLPx6SX4B7lgjTlCJ+3jkJkxWa5Z4nacCGZaj3Yy31gSFmnzw7qa1SU7ihhoqWgpqFqx 0C15AoebQhHKHx6WARDI/RUFLJqMwu4fgPYdUDye2XDv3NKctIHW/vwGva45N2itdzjloI+tPNGkY CiXV6kh8qrK1nx4N3IN7qh819+nZPFGFO6Qzoc3raHe1dmwsbReiTH8t89qY+ZKA2crOmqgEasAxK v0wzEWvdVuM2Kce+avnje63LImJhX9/Op7oeyh5TxIAmDUNXPcu744ObiG6LMKJA5Q9bjFczZXnmu PJQ/C/eA==; Received: from mout.gmx.net ([212.227.15.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmmAC-0008DI-Fo for linux-arm-kernel@lists.infradead.org; Sat, 20 Jun 2020 22:40:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592692778; bh=RAGt25AVvKDJqw+9yrZ6l9R/dNd3yaSsWc/0KCEdEok=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=kH7Ei4ieh2JUrr/ROU7TdjAoSKb+n28ITwkBr9SAprIfWshyAfYhOJNu6oYRcAngU 40sLYvte81TXLuxXRbH3mLQM7TObUZdEM9VF4h9jg5ctm424S4ime1otN9Nh0Phs0v cAHzgEHuGLfDyaPRSYvJdUdLaF1XR7EnaHDlRpJk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N79yQ-1ioF2D3RyW-017Qzr; Sun, 21 Jun 2020 00:39:37 +0200 From: =?utf-8?q?Jonathan_Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 00/10] Netronix embedded controller driver for Kobo and Tolino ebook readers Date: Sun, 21 Jun 2020 00:39:04 +0200 Message-Id: <20200620223915.1311485-1-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:dB3zkFm6Dp37mtCsRvQnO4dmzEkVo0+p+QNR4wonzzE+gE8OPo7 a/51mlxEjTz9/maj1H88yYo34qY3L1M/CIyNDHBBzdIb/9rkmSm1TdnWS2/gK3n6uLuM9xj vcykaFX5b7WmGtn4RyPj7JEtQyzIkf7LfRByhtJc1hj2ux0ztZimykMSIrlkanH0q3MZm/V L6WuF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kd5JghBHjdtlFNm/0QRMrZwQaUWnR66ZUXBBl9kfFNFZ4YAi/uwqW J6Cup1je6gVahK5xbtHWOIYeDWFe5AGt0IiefzW4tGEkDBmn7Qb4SBG4ZANfZoctXwHut81Zv /7rc6sdWkEJYcbXVpWqeXG7Uv3zdq0TRRjKZtepINKWOXz0PIsW872W67v8rWhD7I9rJePT3L C/lnyDVWj8vLZdfbXlRN0zYlukiaJYGd7X+ynCeNzWOkT52sZgaP4V8KALz4KijDNdt2EA2Ft Mnhcu4IDQHqEPh8Hi X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200620_234040_686365_CAC649DD X-CRM114-Status: GOOD ( 17.77 ) X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.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] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [j.neuschaefer[at]gmx.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Mauro Carvalho Chehab , Sam Ravnborg , Andreas Kemnade , NXP Linux Team , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , devicetree@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi, 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 the vendor kernel sources, but in order to all information in a single place, I documented the register interface of the EC on GitHub[4]. A few things still needs to be ironed out, hence the RFC tag: - The reboot/reset handler in patch 3/10 calls into I2C code, which may sleep, but reboot handlers are apparently not allowed to sleep. - I'm not sure I got the YAML DT bindings right. I have also included the plain text DT bindings for reference. Jonathan [1]: http://www.netronixinc.com/products.aspx?ID=1 [2]: https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-controller Jonathan Neuschäfer (10): DT bindings in plain text format dt-bindings: Add vendor prefix for Netronix, Inc. dt-bindings: mfd: Add binding for Netronix's embedded controller mfd: Add base driver for Netronix embedded controller dt-bindings: pwm: Add bindings for PWM function in Netronix EC pwm: ntxec: Add driver for PWM function in Netronix EC dt-bindings: rtc: Add bindings for Netronix embedded controller RTC 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.txt | 58 ++++++ .../bindings/mfd/netronix,ntxec.yaml | 77 +++++++ .../bindings/pwm/netronix,ntxec-pwm.txt | 27 +++ .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++ .../bindings/rtc/netronix,ntxec-rtc.txt | 17 ++ .../bindings/rtc/netronix,ntxec-rtc.yaml | 27 +++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 11 + arch/arm/boot/dts/imx50-kobo-aura.dts | 27 ++- drivers/mfd/Kconfig | 7 + drivers/mfd/Makefile | 1 + drivers/mfd/ntxec.c | 188 ++++++++++++++++++ drivers/pwm/Kconfig | 4 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ntxec.c | 148 ++++++++++++++ drivers/rtc/Kconfig | 4 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ntxec.c | 115 +++++++++++ include/linux/mfd/ntxec.h | 30 +++ 19 files changed, 777 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.txt create mode 100644 Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.txt create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml create mode 100644 Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.txt create mode 100644 Documentation/devicetree/bindings/rtc/netronix,ntxec-rtc.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.27.0