From patchwork Tue Aug 6 16:27:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8B69746 for ; Tue, 6 Aug 2019 16:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D47222847B for ; Tue, 6 Aug 2019 16:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C64FF28538; Tue, 6 Aug 2019 16:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62A7F28387 for ; Tue, 6 Aug 2019 16:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=S76+PwjmvOwc/pgMLX9utYAm1suCt4bl3nj2Zx6ROiY=; b=J7JqbIMcbh8+2bIK2Cs0igK7d8 ++PX9I0RLWxHm6rPrSqJwoHAT5PwtDVZ2FxgNnitahnnQ2pZwqZE7SAR4YIuxC1LDlE83B1BqfqSx qdyQEctkxzOWKWkMfS6bvq50PUGsfrF8EINsut+SA4J3PtKxwYJL/QcdSL6ukcwd1fdbrRSyNL4jR Wrza4K1sz3oa7LYk7lyMPE08r+mHknEFQdvLeBV29Z9kESXc+ruHL2Ua7/3y/LUfWlLtWwohiNsu1 8T7gn+ix5ulkxBYnFLryuyK23WvkexjACAqe5aX2BpoMbUSHr53lbxlpCERsFdK3VncdWUQQJeN/8 es86QiYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2MQ-00041z-TI; Tue, 06 Aug 2019 16:30:54 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Ka-0000aM-Rx; Tue, 06 Aug 2019 16:29:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108884; bh=zpDHFZtFnB6jtb9Ty5VxV4oP5o3ljb0IMfQ1WZg0clY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Sm7iniuLTfio2K6K9jk23/qCkaDP0SaifhnYXC3l6DFmQe1/qob5bGW/zHV+CnEL7 NZmponM93e49n/3Aw8tLWhhxLX2qjpNnHfwUI2iNCqrxQtBqZKPkYywtnonxdAkOBV 4yr1wJQLYRrnURxW59FVRPs7gJwHVaLOrrVLUEX4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mg3h3-1hikmv1UOL-00NSmC; Tue, 06 Aug 2019 18:28:04 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 01/10] dt-bindings: add powercontroller Date: Tue, 6 Aug 2019 18:27:36 +0200 Message-Id: <20190806162745.8414-2-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:AIGOCby4oFv47YSJ9VFQ9scd8B6VnGGTMhIk5HuNYlF12fPSCco xKJUKT6QYOFGIKQ/z6NSePLt0CdsRa+wV9mqMkGua7Wffu3uHXZ5GOP+r81dHjoAOYNJDfu e/5lRA4Zr/gAapa68Gp9+4b7M1GCmMLNxEIvYHwHWvx9ONzS5qP8Hqyb3Nr1jYM+UxZbj2k paoqGOeO7rPQh33p9JYoQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:XWjw5J45VAM=:2dSZxUR1GbmeEjxNlusGLw bS/X4iPie7hRL4oNU0IhIawv8w7+UaAWS95KxFVjElYWEJvvWqTdn6Of+Z5s3pA5a9TSAtTMj CNctLTB1MuM/wZXB0BiCWE0l8i5SsBGBTEMa6FYysrIVH6UcYZQHj/oXM85L+Q/rYgzFwQ7t9 KrYKViVdYJ3Cj/HGncWtchT8zc6jf/VVEXyEgb8OzWklBRbUKLf8vXVajYu8EqaMY4HTEffiS ERCxOFFmDFBcBp2ziLwibJKhxV9qWOrsf3c0D0RFmsdiaINA4aO44zOnVKSg3odRwKzHFg+9y yvTBNPqvgqJn2UJVieb5Z5k+jE8MDkgk97ncG1an3Dp+/5LkmCmSS0agyHjVMOhoKkjB4uCH/ 4X3Ui7XOo1nSJrRZTJhyWDPVYlq+Muv3n8wnI4MxiZUQe6UMAX2oLXdHnHF/Ia8u/+WfUHoV2 tQdK+HuRiK+2xvrxaUgyhvU0esYsoGZdM6htmr03ZbflgROiJdJgqPghUdnnCz5dABD6VQjLr CRV2mgHbch0EACyFGdFBkc2EDfrKVHajslHZDqg+BNtjewwzgdoTAIXCswuNAAcRG3SHLY9Cr F7kRexbw9K0pwF4OTHNgMf25kgvRHEkDHvi16uh+BGahESYj4HBnribGQ2OUWnA+lbGgeZ28S 2F4GwZU08OlcbJRvneemznuruY3ibbR05hjE6AbcWWPgvyYpQXBYWnoFkRzrtSMiYstbt0kEX GgWQH78SAYaE5hTmH51YVSxQp/JvjCsfcWKDveoM0AtjrDNaaLFCmevOSssHo23ywjF3Jf0/e 0fTx4cJ9IIZ0X+Qfs+hC+xdW8Bj6UHsssu7G6UluKU/7SvzBiCY00JL6I0/B7lNzbXcL+HcVQ fm4NgU5Z6Z6jy8dzgVeUiFvzJOZQQGvTEr1VvSHkhT0susH89L9ZYOoORcRB1mV8DwF/nA7So 2h+msJBOwWROaNUIXy/NTGNiHq/VV352sSO1x86bfskFwlT/bLkEVE80aH9fOIKxq7TzxP1JJ 8wZu2uOSr4wwEKqJ64LTSYdq2OOiZsm1EgvhjeCav0HTs7diGxKHv7gDj/RM5/GREsfhgyVQg zjAqbidpbe8q32hMi7f5Z/Qb5OTiNuYD3oKEzkaLPWDUc54ZGLJ/s/5Og== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092901_354638_144FDE9D X-CRM114-Status: GOOD ( 13.72 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add mt6323-rtc and mt6323-pwrc to mt6397 mfd DT bindings an example is shown in mt6323-poweroff.txt Suggested-by: Frank Wunderlich Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: separated rtc-mt6397.txt to part 2 .../devicetree/bindings/mfd/mt6397.txt | 10 +++++++++- .../bindings/power/reset/mt6323-poweroff.txt | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt -- 2.17.1 diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 0ebd08af777d..44acb9827716 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -8,6 +8,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules: - Clock - LED - Keys +- Power controller It is interfaced to host controller using SPI interface by a proprietary hardware called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap. @@ -22,8 +23,10 @@ compatible: "mediatek,mt6397" or "mediatek,mt6323" Optional subnodes: - rtc - Required properties: + Required properties: Should be one of follows + - compatible: "mediatek,mt6323-rtc" - compatible: "mediatek,mt6397-rtc" + For details, see Documentation/devicetree/bindings/rtc/rtc-mt6397.txt - regulators Required properties: - compatible: "mediatek,mt6397-regulator" @@ -46,6 +49,11 @@ Optional subnodes: - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" see Documentation/devicetree/bindings/input/mtk-pmic-keys.txt +- power-controller + Required properties: + - compatible: "mediatek,mt6323-pwrc" + For details, see Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt + Example: pwrap: pwrap@1000f000 { compatible = "mediatek,mt8135-pwrap"; diff --git a/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt b/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt new file mode 100644 index 000000000000..933f0c48e887 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt @@ -0,0 +1,20 @@ +Device Tree Bindings for Power Controller on MediaTek PMIC + +The power controller which could be found on PMIC is responsible for externally +powering off or on the remote MediaTek SoC through the circuit BBPU. + +Required properties: +- compatible: Should be one of follows + "mediatek,mt6323-pwrc": for MT6323 PMIC + +Example: + + pmic { + compatible = "mediatek,mt6323"; + + ... + + power-controller { + compatible = "mediatek,mt6323-pwrc"; + }; + } From patchwork Tue Aug 6 16:27:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 612381709 for ; Tue, 6 Aug 2019 16:29:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F227288EA for ; Tue, 6 Aug 2019 16:29:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F3522887D; Tue, 6 Aug 2019 16:29:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBBE228861 for ; Tue, 6 Aug 2019 16:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=k1Fsg08Sp0xXsGkoVR1URAZ97hsjmF1srAaTVRISj0Y=; b=TYKK3Yi8jkh7Ji9/KbJnVmiQrq RCg3AL/HIsVUy2V5niOpMU3fwih0W9JyxlITDMkCSz4wPvt5asYQA0UTeM41rxVKA7dDpwgq9LD4H U2T27ipCK4g0TBO5ldf1FtMv7e6SIxKh6cg7j5TIcYVjUYjEHMbbwmandXXlRXHUdfUDgvtJK0NAs DcFTY94x7Rq5NILZKd9R/zsVn/erGUOdw5YXWwGJx11f2xhunmMIjI42aYHK57llAcsQeJ5/KWtqE glYGDLNy/pUTYrNlfqEUhIXEtdzAida+ZCKrNqTNyLsLiALapsTGaPj2OoQJ/RWL1q8ki1n1MLDet qLx8YSHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2LD-0001Qh-FM; Tue, 06 Aug 2019 16:29:39 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000TL-Lu; Tue, 06 Aug 2019 16:28:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108886; bh=VLX9HTUE+wmslMOMb17Tzc973mqiJr+Dnn3HZbMgnn0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=baKyKeljVeqoNyXI4cQXWi5NcbcAkx3TMg8CMSG1yOf6cTcuEoXalPAE0HoK0zvDy WsZ50oHWZ6u4YRHmZCmqc9hlRvbNtd19Kz41VKhvXSFPPIrtQJ79DsdiwLetjzv+WZ 67NnIQOm+A17LNiUKgFzbZhtnaIfh00sP4aBLunM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M6ioC-1iI5TO0Gpw-00wWc1; Tue, 06 Aug 2019 18:28:06 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 02/10] dt-bindings: add missing mt6397 rtc Date: Tue, 6 Aug 2019 18:27:37 +0200 Message-Id: <20190806162745.8414-3-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:D9CrS8W2Jt6EUrtYbAmTXR2EPFc9FV/KlELr/U3yFcQs96LMz2L 7wbIt7yjgZqE4q03I87LOvJLuxjjYHUx80fkTLla6PNa0RXVJyJCyvugHqnFm/NgggSb2Wv ckPxkPl9ss+Fpsqi4Nk7FYjeVqc5v/U0coLTIpl8FCvZWi4n+ZmhE9mQhVlviKt3S9tCyZV uYdR0WKJK8A4i+EhOM/Cg== X-UI-Out-Filterresults: notjunk:1;V03:K0:odKRs4cm06A=:4nolkJEMYxs1kTVI3ZyguN oBKZp+Kyium1XB72WISTc1o62MGS6+qLQhpeg/w0VTuWJbzyKtn6IqMaA2lQyZEDPBJSlRgjJ ZEn6vOQUH6ZFspPwXlsSJo/QMq7iXlgmz0M2s6y4NUsmPTstIukWJx8RFbJAOxbWVWM5OMyEH qCR+QcDVDeZBWJvJ4xXTD6dx0vOLNS0mq/wwamKnhPPOpEKZTGYVeQ9LpHQ0y4pH9UXpt9gbN nupqDjZRqxXSsOr/FiVGalcNVnQvWN34H9JeceERHzEfqhYuqHMXvMnZyWptIWEro093u9DBv 8a0PMCGVLWwwkGRzei/OfbeePTI9QnsuaIV3TRt3w+uj3GbYM3lmgQO7aMF4AvIJcULEwbiCD L50WhUvfdUEP/l7vHv8QawaTr6BVd5DiX6m5cwrKvossu/OfDnYlDvvjd8b42MACzxGLaxu6D ywl3+Hftge1v10vFfnafXQ7U9gG4mdBAJN51xPXQUCDQsOY1v+HKF+mMsFQhnnTncNsr1uNfr jhO7rqym3pY/TnGdxsTU4daaiArm9v7jH6riZVbwm0XIO+93iG67yfyHOL2M8mNhKb+otQ+JD gO1WkKDpD2dPCNaFQH8f+P+TGkGT1G4GJwVspD702YHCQ8GYT/J8QD8PoPKAc0t5wh/U1mT7+ 9+6R8zopzJAxccpdJBTzMV+AfRiqC4aCjVoPNlGjqvBUDfNzNU4KC5Saj3dxgnb9my58uBU0Z 7BUWoscMfQ53AhrPLmKCBzH5Pj4dAnNsdN8iixZkUP33BSe7p3k45ZJuSWHnmprJY6AUZ0gxi 2bWjhI9i856I4kYfnhJ6CwO67o9iWV3CPwbEir+wG+55ECNowJb4+8B0cqr81PlS/h+muwqgv T33f3d0+SPFEFfQ5fwlZSn++ToK+ijTgdcfKBC1dhzSQ6hLhZsHXLL3FZy52G4t1WT1rv7hHy s69kDK+npcHt+QKts32wYVM7nOSWkbQV4BqDEzx42tMwd2fgwl2/baE7YWffqDZrGwrWbzPF9 Qhzc6shkpkWJLkE+jLFRz7qgeAdz0EcI6jDHnw75qK0tQNfz/q6dlBL1lJh9pi2hAI8Eg7PJy r0sww1CjlcMBtvrfkzi3YlZyg8GqYc4P28vxVllKxXzgmt88up8bNPa8w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092854_027756_7776881C X-CRM114-Status: GOOD ( 11.67 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add missing devicetree-binding document for mt6397 rtc in later patch driver is extended with mt6323 chip Suggested-By: Alexandre Belloni Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: moved SOB changes since v2: splitted rtc-mt6397.txt from first patch .../devicetree/bindings/rtc/rtc-mt6397.txt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt -- 2.17.1 diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt new file mode 100644 index 000000000000..ebd1cf80dcc8 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt @@ -0,0 +1,29 @@ +Device-Tree bindings for MediaTek PMIC based RTC + +MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works +as a type of multi-function device (MFD). The RTC can be configured and set up +with PMIC wrapper bus which is a common resource shared with the other +functions found on the same PMIC. + +For MediaTek PMIC MFD bindings, see: +Documentation/devicetree/bindings/mfd/mt6397.txt + +For MediaTek PMIC wrapper bus bindings, see: +Documentation/devicetree/bindings/soc/mediatek/pwrap.txt + +Required properties: +- compatible: Should be one of follows + "mediatek,mt6323-rtc": for MT6323 PMIC + "mediatek,mt6397-rtc": for MT6397 PMIC + +Example: + + pmic { + compatible = "mediatek,mt6323"; + + ... + + rtc { + compatible = "mediatek,mt6323-rtc"; + }; + }; From patchwork Tue Aug 6 16:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A42DE14DB for ; Tue, 6 Aug 2019 16:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92817287EA for ; Tue, 6 Aug 2019 16:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85CDC288D7; Tue, 6 Aug 2019 16:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BAD8287EA for ; Tue, 6 Aug 2019 16:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=CrXztliKoLVcGH53KQqUImHMcsjikofGMWD2tXILub0=; b=W8yqz1545PU6DXN0JBpUSknSL5 /Kxtjsb0pSQy1/kViF01o3OByBaa44RXDPtic9wbCGxH0f1rd9fgAuEYGTtCBLHqpQ23KNnJHR0Ag dWUSXS4AWIhwwMW12DNHgMOFYfvL4AOx9sBxWuPCm6myDrv2DZshiBjVoJpgPcR+Vkx/umnjKXw1Q S5GEa1QGNGQZHTSUn7BIdGExqzXZe4vsOo93F/jAetcQtJyZ7xm6mMYD/NzIkRmy3bZ24sYpib0SC y5NgvUZq5Iw/WXQ+t4GJNj4aGwdJ4x2d5OllKuYajmkC9ntCe/o180NFI6pZ55h7KVYt7I5ErZLym +uu3FK2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Km-0000qX-6e; Tue, 06 Aug 2019 16:29:12 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000Ta-Ia; Tue, 06 Aug 2019 16:28:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108888; bh=HzEHIxIKYm6KPLL0JPFew9mFnKGyvVsgusVw6nRHTTw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=S+FiRh76N9kjTLJHbv400S0ijDXh2zkWxH5w5CLk030WIBkRI06GV8ukh3RO0ol64 YBYy/K7BYNGLXIk4f6J802F9eai4Y6/ikli5H8+0yxkUxmQTSWK2buGWhmUSEpVIU3 qb32jY7S6ebeUhWIXNfwOsWgIsO1m8GTapkJI3Ig= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MMkgl-1hycgK36Ct-008YWc; Tue, 06 Aug 2019 18:28:08 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 03/10] rtc: mt6397: move some common definitions into rtc.h Date: Tue, 6 Aug 2019 18:27:38 +0200 Message-Id: <20190806162745.8414-4-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:u9hdvNiTHJABtB4jUq16WoTMdaMAfx9o4ccbdvchDpyvkEG5xf/ RNkuAZBPOx/Ddf7gtrBUcv2FiFU+MmFN46QBEnpkNfei3idXzfMaDVp0L17g/wQdJuCx5ix hzU2kWnFpbiwgiDDa8F9HIgDKbxWWpB9nY0pDRoPPrfRo+EFiih5VPQ+LNxL96k8/AryIra BuE+fOnKU++LTNRtQfUtA== X-UI-Out-Filterresults: notjunk:1;V03:K0:cMUz6x+Gsec=:eEPPRAYpOPjYGPdy4lEqJg YKfxGrOEh+0c/i4LKTG6X3aiqybpgwtA1h7e9rp2uP3Wd3mK3XNAVmlzF0oqL2IVGBGfVCs41 /kEWgjmAyxaZbP+KCUP5NhsWhyMysyTdeTaRDRy3RrB/pCy4hUSeerb21H8wi2/8eLJCxD0Wd QKdi6P5YLA5E16EY3ReI3i3EJ7pffskC9iCnCUZCnHqqma20B/VgonSyLeEEEvBafKhw+U+OR +NPyg7YzrjXTN/5Xx8aL047QaUAlxwfbYsiXApyZEtqTuSRA6VJ8dA0a2OM97PJUdCEJ8mP1B NUdTJ7IdqAWHy/vdFpHE2Si0V885aHceu6R5edSHQ+FpqKuzR/Y4xbhTctTwOu1D6n5mnYpXx j+XoBqJGGLQfOzxns1nM8V+MYMtGjeq3yWn1rzXyACrqaMm3Eq0SYUvErsJbVfJfGmXzTifiz ueUB/HTsMzkOkfCYN5WJDuZhPl7WNg/bqQd2cxeR5w1bZSfBR1E4W6ZDfIKVsRvXWjH+8QtoN vaou6TupBywkEDMXGLg+46gOOniLxZBjCA+Y0g42D5sUcqb0XvOjvwkFKn4Z6o0T3mwmQhU6d 1fv4/SMxvmiTvQ6tPBa/TdX0sNsQtLGWRcmxm0GaQnGY/pGim/AtFVirjObFXPz007oNe9sqW UOSDDjACW5EMiiwLYyW3CnORQ3BfEhrlLAZDkf7DY9mhhjYspr1k4XvX4YGtzJMk9s4/gW4ro Ws5hWSMKYo+Ofj6mu1hMLjQrO6eA5DTGleh1N1PnpyiXXCwFvJEJ0Gs3uuPMlT6t6TBH1rZzQ UdYysD7xZ2jCE05v3oITyhxoFVxIByYsLWzWspKiu7x55BD+PBps65he/4nuB/1KBH04VDMGM xGJ5CcEGogagIse3Agzw7Cubv2TqY0c2LY38vX/0/bZrpRgaVEaE/7uYodsX3TLWo29XQukKo BxAe3FDp7ZW5OGjLDZhH5ROWMA5LSingpR/45TylfuA/R88cfv8HVSvx7Uh7Zd6rYyEuN2FXT FAlyO2Qymn/B51JAM8+byz6qN9xW6Ee8+eGc625/E0Cd8DejuinuSHwlonGTa1q9e0f5t/0dQ slNfV5m+FZL9gere6jpwZDdeCDuhrjjsT2G3mXfTJ2mGNp+EXOps1wYjQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092853_926071_90F73ADB X-CRM114-Status: GOOD ( 12.43 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl move code to separate header-file to reuse definitions later in poweroff-driver (drivers/power/reset/mt6323-poweroff.c) Suggested-by: Frank Wunderlich Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: add missing commit-message drivers/rtc/rtc-mt6397.c | 55 +------------------------- include/linux/mfd/mt6397/rtc.h | 71 ++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 54 deletions(-) create mode 100644 include/linux/mfd/mt6397/rtc.h -- 2.17.1 diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index b46ed4dc7015..c08ee5edf865 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -9,60 +9,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include - -#define RTC_BBPU 0x0000 -#define RTC_BBPU_CBUSY BIT(6) - -#define RTC_WRTGR 0x003c - -#define RTC_IRQ_STA 0x0002 -#define RTC_IRQ_STA_AL BIT(0) -#define RTC_IRQ_STA_LP BIT(3) - -#define RTC_IRQ_EN 0x0004 -#define RTC_IRQ_EN_AL BIT(0) -#define RTC_IRQ_EN_ONESHOT BIT(2) -#define RTC_IRQ_EN_LP BIT(3) -#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL) - -#define RTC_AL_MASK 0x0008 -#define RTC_AL_MASK_DOW BIT(4) - -#define RTC_TC_SEC 0x000a -/* Min, Hour, Dom... register offset to RTC_TC_SEC */ -#define RTC_OFFSET_SEC 0 -#define RTC_OFFSET_MIN 1 -#define RTC_OFFSET_HOUR 2 -#define RTC_OFFSET_DOM 3 -#define RTC_OFFSET_DOW 4 -#define RTC_OFFSET_MTH 5 -#define RTC_OFFSET_YEAR 6 -#define RTC_OFFSET_COUNT 7 - -#define RTC_AL_SEC 0x0018 - -#define RTC_PDN2 0x002e -#define RTC_PDN2_PWRON_ALARM BIT(4) - -#define RTC_MIN_YEAR 1968 -#define RTC_BASE_YEAR 1900 -#define RTC_NUM_YEARS 128 -#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR) - -struct mt6397_rtc { - struct device *dev; - struct rtc_device *rtc_dev; - struct mutex lock; - struct regmap *regmap; - int irq; - u32 addr_base; -}; +#include static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc) { diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h new file mode 100644 index 000000000000..b702c29e8c74 --- /dev/null +++ b/include/linux/mfd/mt6397/rtc.h @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2014-2018 MediaTek Inc. + * + * Author: Tianping.Fang + * Sean Wang + */ + +#ifndef _LINUX_MFD_MT6397_RTC_H_ +#define _LINUX_MFD_MT6397_RTC_H_ + +#include +#include +#include +#include + +#define RTC_BBPU 0x0000 +#define RTC_BBPU_CBUSY BIT(6) +#define RTC_BBPU_KEY (0x43 << 8) + +#define RTC_WRTGR 0x003c + +#define RTC_IRQ_STA 0x0002 +#define RTC_IRQ_STA_AL BIT(0) +#define RTC_IRQ_STA_LP BIT(3) + +#define RTC_IRQ_EN 0x0004 +#define RTC_IRQ_EN_AL BIT(0) +#define RTC_IRQ_EN_ONESHOT BIT(2) +#define RTC_IRQ_EN_LP BIT(3) +#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL) + +#define RTC_AL_MASK 0x0008 +#define RTC_AL_MASK_DOW BIT(4) + +#define RTC_TC_SEC 0x000a +/* Min, Hour, Dom... register offset to RTC_TC_SEC */ +#define RTC_OFFSET_SEC 0 +#define RTC_OFFSET_MIN 1 +#define RTC_OFFSET_HOUR 2 +#define RTC_OFFSET_DOM 3 +#define RTC_OFFSET_DOW 4 +#define RTC_OFFSET_MTH 5 +#define RTC_OFFSET_YEAR 6 +#define RTC_OFFSET_COUNT 7 + +#define RTC_AL_SEC 0x0018 + +#define RTC_PDN2 0x002e +#define RTC_PDN2_PWRON_ALARM BIT(4) + +#define RTC_MIN_YEAR 1968 +#define RTC_BASE_YEAR 1900 +#define RTC_NUM_YEARS 128 +#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR) + +#define MTK_RTC_POLL_DELAY_US 10 +#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ)) + +struct mt6397_rtc { + struct device *dev; + struct rtc_device *rtc_dev; + + /* Protect register access from multiple tasks */ + struct mutex lock; + struct regmap *regmap; + int irq; + u32 addr_base; +}; + +#endif /* _LINUX_MFD_MT6397_RTC_H_ */ From patchwork Tue Aug 6 16:27:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3B21746 for ; Tue, 6 Aug 2019 16:30:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91C62287C1 for ; Tue, 6 Aug 2019 16:30:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 858A228866; Tue, 6 Aug 2019 16:30:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 24D85287C1 for ; Tue, 6 Aug 2019 16:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=JuGIgDn09AlXjofPibJAWRsHj3x29FR8EFI+DE4crIs=; b=g+ZlYMudtr14pj1pMk0OH2ph55 n6C0CixQyA6HFrd3KDFqEkcnmmdpF/Xf9tA99zSztlzt1lURGT0FfIicYq0NygcbewxYZvHgrKD8W VA4lOMF9v7FVTa/Z6a29AsYXDHzsBETmAlU/Dp9TwiMSUiRspNyWu/7MJIlLPToyA+PGV/aCQ5YL2 kFG+3es2uZisUW9rcfeuqMIztGTs8NWWqD+2a2lBZ0l5eR0EwOOyCFUFRXgCZ0FwaAGKKXM3HYNm0 omLin9TV++xKiGNJv4zFJ3jNz9e3Vx+7DpSONInkGK3mphSewaJv+gQefgVmBMziAdsIvQD+8mFQ3 7fBq8DTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Lk-000326-MI; Tue, 06 Aug 2019 16:30:12 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000TZ-IS; Tue, 06 Aug 2019 16:28:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108889; bh=JOUQ+oPDKcgPIIjUYlOez/IGFEXhWH3PKrXpZ/Nj0Pw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=iZL6rIKkgpSRvIyMJ7yrjA1AvAGWJeQUirgBbXGAm2djIScT7P1VbcGWwAYsyjJVX /Ou8ir8pEc6TsXU+9CPn+sk0JaVDzBPqENOVYqoCIbnYfvZQf5wXsmyEinlA5s75VD ux5tlFXELueinyIkBF7heHsH/HCMBOOJO52dfs1Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MS5jy-1hkbwp1SOo-00TGKh; Tue, 06 Aug 2019 18:28:09 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 04/10] rtc: mt6397: improvements of rtc driver Date: Tue, 6 Aug 2019 18:27:39 +0200 Message-Id: <20190806162745.8414-5-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:Fo7b1eCTmtbEceNwBLDjCvbnWHtd4rgJki9dQjNxSmpo7n+DzFO 6t+DoUaDcg1ZnqfqkptI6EYT1AkV9a+JcNZFDn6akif1zuOloZoIuqUcOEvJE+xc6IpmC69 yul5ZHuc/3dJYrkQyZHwfAIJg9NM/OdUBNNLJWh0anxKOOf3rT10idQ/mJD2y6zQOyAtMew egld+N2kVA/30bFa7BObg== X-UI-Out-Filterresults: notjunk:1;V03:K0:AbPc73zCr+k=:tTtvNHVMujzgME3Cq+L3Gt cQgc4Xk9AOFahoyHHEqmUkzRr2E2p91APx2A/Ib0UKADE0t1zG/dZZkH8WjQRtEszbQ49aX2u c6Jq3vI2g3FjnANQ/197dcqwTJ0oaU+0NGOsGuGeG45ClWTovd/Ju0QaUCiUinAraUJjk+6o2 lOm6PMIXslC3t9xqLhtOh8lRxKPfeixR4i3GLKkucXoToW6E2MJpwE2szKwB6rA+Ucl/JGsu4 VrsbmX5C/EfRnLGgYfSv4JR2itePj4WdKfNXQA0viVYYOLWkxs7z0YT6B3cZTAwJVm14ocbGC KSUUtLIVKQWqDQ/hBAqr3FguJ+pTlaZoabYrgslHBvbeytGaQJEngFhsZZqM+rZbCCOcUfzGi KGpGAyYgMlLyIhu+XX3lscrwRYuHW9yTotsHQA1W2nA7Vtlf0x9mOfcPtH8rYsFPfh+cDZ78E P3njoqHFBXaOm5jPEwkvtANw6Us2cTcHEMfSI4XSUv0IJTfaukLbunpItOEZr0IlYDwwgSWCn o66/NYiWQ9uUmMWUSurpaBnSkyHepr88eh54D9+YlcjElK4usnwDswjVxOjZVJzN6DKzrEe53 r6z2itizisGr7ZYQRgDd1KX7jo29ei7N03HSI5xpGm2n1x7EwNVycim2lpzAV+7z4gRiNuNx3 5GkrioMqExCxUDkDZMqapJXzcPriFEXU9KYA2pUHB1TKbQJAlpDS8oeBeYHHggpH5qYoDxJU6 slzQZOPoWLmG60y9lFklbWjDfNgsBH/iTN9ymDgkhegRyYIOvDRsXshnbo++c3OIoBh0aYdrh NubfVq5LGHFue4fQL9Ys8RxwdnNYIC5GsXe199Mp/NkmZMVuMhv7cR3pVoVR8dVCFreyWFiAq qplgDMZ24R+uovA37Rm0YWABHLWz3pH84P86liMg5nh+/TQXpVTw9OJ5S8wlT3tF1cfaFJZAG epEPr6kykVOLm3dgy4d8wWRXDC5/X7W17XRZ9UDMY28fPyt6v64FHSwA4V2puBnpQvC0XmoPG UE07pbFu2E+vfMQyz94yIWdI0MPY9U8Q1BqAozNN5ubluhZCjWc55K+ZE4A32ayDCb0V2STln 9VagosHuyciUb65sEFfPOgLKGw1HMFX3xXQ94VcYcBH2nDsXOxVm3/pNA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092853_930019_10A5383A X-CRM114-Status: GOOD ( 14.38 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl - use regmap_read_poll_timeout to drop while-loop - use devm-api to drop remove-callback Suggested-by: Alexandre Belloni Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: - fix allocation after irq-request - compatible for mt6323 in separate commit => part 5 drivers/rtc/rtc-mt6397.c | 51 +++++++++++++++------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) -- 2.17.1 diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index c08ee5edf865..9370b7fc9f81 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -4,16 +4,19 @@ * Author: Tianping.Fang */ -#include -#include +#include +#include +#include #include +#include +#include #include #include #include +#include static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc) { - unsigned long timeout = jiffies + HZ; int ret; u32 data; @@ -21,19 +24,13 @@ static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc) if (ret < 0) return ret; - while (1) { - ret = regmap_read(rtc->regmap, rtc->addr_base + RTC_BBPU, - &data); - if (ret < 0) - break; - if (!(data & RTC_BBPU_CBUSY)) - break; - if (time_after(jiffies, timeout)) { - ret = -ETIMEDOUT; - break; - } - cpu_relax(); - } + ret = regmap_read_poll_timeout(rtc->regmap, + rtc->addr_base + RTC_BBPU, data, + !(data & RTC_BBPU_CBUSY), + MTK_RTC_POLL_DELAY_US, + MTK_RTC_POLL_TIMEOUT); + if (ret < 0) + dev_err(rtc->dev, "failed to write WRTGE: %d\n", ret); return ret; } @@ -266,19 +263,19 @@ static int mtk_rtc_probe(struct platform_device *pdev) return rtc->irq; rtc->regmap = mt6397_chip->regmap; - rtc->dev = &pdev->dev; mutex_init(&rtc->lock); platform_set_drvdata(pdev, rtc); - rtc->rtc_dev = devm_rtc_allocate_device(rtc->dev); + rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc->rtc_dev)) return PTR_ERR(rtc->rtc_dev); - ret = request_threaded_irq(rtc->irq, NULL, - mtk_rtc_irq_handler_thread, - IRQF_ONESHOT | IRQF_TRIGGER_HIGH, - "mt6397-rtc", rtc); + ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL, + mtk_rtc_irq_handler_thread, + IRQF_ONESHOT | IRQF_TRIGGER_HIGH, + "mt6397-rtc", rtc); + if (ret) { dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", rtc->irq, ret); @@ -302,15 +299,6 @@ static int mtk_rtc_probe(struct platform_device *pdev) return ret; } -static int mtk_rtc_remove(struct platform_device *pdev) -{ - struct mt6397_rtc *rtc = platform_get_drvdata(pdev); - - free_irq(rtc->irq, rtc); - - return 0; -} - #ifdef CONFIG_PM_SLEEP static int mt6397_rtc_suspend(struct device *dev) { @@ -349,7 +337,6 @@ static struct platform_driver mtk_rtc_driver = { .pm = &mt6397_pm_ops, }, .probe = mtk_rtc_probe, - .remove = mtk_rtc_remove, }; module_platform_driver(mtk_rtc_driver); From patchwork Tue Aug 6 16:27:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21FAF1395 for ; Tue, 6 Aug 2019 16:30:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10D6F287C1 for ; Tue, 6 Aug 2019 16:30:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03A1E28866; Tue, 6 Aug 2019 16:30:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E4A2287C1 for ; Tue, 6 Aug 2019 16:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=nIhAp9liQeOaVhlRUnnwS89bEflPTLyycPUExhvWnrc=; b=Kgg+R83D2ngx6osa4OVDKXEI1B F5Lqp5hUw/FpoXJRZDc+SdMzSW0pBrqT7mzz1kbwZcKDgFvsILTZOiHI9kqKDhJadz13Tx0EceHnK GGA5Ad+gOabIYBqN1eCB3/x03P/SyGqwOInaaq7DBNyjJ72IHsHg4u0q2OkvufOIz7EiaYhxq66IE URQP9Xy53NdJ5Lut5F7SufjZiXFRsWyjTuj7ycDfwlfvNBrTBrnOrW3Epdk9wTD6rtq5ME+NWVizW gTR3SZCkqHX6Nu5Kvnu600LQj92QjvdGaWVwimYspTYFIJDHjxTfqhsojtaM/itf2CrGcRecy6BSh E67zpygg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Ly-0003To-BR; Tue, 06 Aug 2019 16:30:26 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000Td-Mf; Tue, 06 Aug 2019 16:28:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108891; bh=8gcB2Y1P8SSH9aDUi/qMuaH1abxfVQO9b3fZW4tMYTQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=U7td5nPFbcCHuXvafAlc/iOM2+O7JofTOjmK7Lu3GcH5PehobU8I8GkjyFaAKjJYM AdWrQBGOOqYwlze+ynLrPHD4RusRIpT/zlPpQ2+StLkihSn3H1RkqHq3e355+3XKT5 fgp15x6ygO+0/qNZodycQOhQ9qCQxV+x6NFgTApI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0ML6XF-1hulKt3KJl-000H3o; Tue, 06 Aug 2019 18:28:11 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 05/10] mfd: mt6323: some improvements of mt6397-core Date: Tue, 6 Aug 2019 18:27:40 +0200 Message-Id: <20190806162745.8414-6-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:+iJfjBRFYOn5WAoXepUrh13Q4VN8x0Pn6CZbVyyfzp1nlJk7Eaa fM00X5uVPvHuR4yEfqQDwItl0Vq6mGkZ8HXTDNzO1DxpZ5TOmjBS68h2tdCVMzWB0rCamWd GZu1q2wvYM8TWMa6FA0QC1GxIrP05tZ9Q2bfZM0goxn8B7BbrS6Na9xJiZQ8JaV4QodItIZ jLT+LxQppzWiatoHlqbwA== X-UI-Out-Filterresults: notjunk:1;V03:K0:MJvW8qc5hm4=:lAYxn4cfPwTASX+zg1i74R qpKmfVTZRA8Cp/vTqoiid//1VOohTVi7PgWw7HLPBit/6gKWLq1zewIgVi8PvbhlNqXksEeRF kR0PDqn90h1UyJ8Ddvzrr24cvOKg/yzDctRdyCKRTf3/cNBriT3qlTHSeWE1oCYHa3IsTvEwL EHkMM3lKR99zdE7Cg2Afg8aqiFb1diaNlnWYN9CasXGfZ9xQZGGSHlFoyWyzBy1D9dE5MpEFO MUXXa0L+nbx4Tl3A2r2RBSTKuIm/t+frimTBgXAkD+5G/bHncXcCOouuZs3l5NKlOVzq9usFn hhYF6PayadlaA05xSx4PXxN72Abu5JgcA725vIvFffHaHPkdV9u1chCJfDh2Gg8jlQeCLOKCD iIooGX5qwY2Y3cVnfcSmUiD+YFQWvmvSnUx81SHQqvgQ7jC0XIIeMRHpUYicB5ErmKOiD/2f2 j50kiQ4ikevgIM9tLZnnL1zdg7cdEl+uhFxeWJE9VfWHnIuglf3pb6eZ2ELWhTfID0j5WFa2+ ukBjvv4u0VoNGZPC/UV1WrI0i7Qdv8ScSZL14H48UC0EbjpPjcDCTLoVPzzTPS+aYpxvXW0sf GxIStdBGfyG4Tp6R9wOynwuqCKWYbhZJNswvd+Q0aQXQzEvQKoXRosYWpfi1Nbrh3/ny0L7uZ G9hhbydgP12VvugoCG37qKWFysRCuMKxSuVrUw/sb3Ny9mWF5FA9f2/TNerVjRcyhoKsH0uBx kwlx8HzY47m6iCjHSO9Bx2Ic0ANI58L89kCGcWuY+XQYTP3nSzpksAPumhUvftf8dfdfigfQU W/9b353G9V1xiBXSJSA8mj2zhdYIUbsjEyGRLdYuYjm+2wINq2tkHhUqoI/NMhZ+ypH5dGU2R Yy1ewQQcnul2tpZkYThqdfjp3quPWbB1ORvud6PDCO6xtCmXnF4/HcAMYkdtRRRQYv+jguOtV tRksqUX2O0SfcM666SL4SP8slFKtCvkwyg5N+rCR9n/Ad/GSOGSdfnbpcJT12k6KeX8tWkbPa 3XMuY6/sc/tWVgC8vNV1dUCJm1SBviIx1WHp9XQCZhMmU/KtwT/l0imJf3t7tQxUip5O2xJ1c FKBF2n1uI8v7ObMTJH9SxLsWYnF7YgMMF6koDCcbY0+/obmf/Tbk3CArw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092854_044535_A04C7435 X-CRM114-Status: GOOD ( 11.23 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl simplyfications (resource definitions my DEFINE_RES_* macros) Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: moved part 6 forward to let compatible and driver be together changes since v2: splitted v2 part 4 into 6+7 drivers/mfd/mt6397-core.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 337bcccdb914..5f7070267c9a 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2014 MediaTek Inc. + * Copyright (c) 2014-2018 MediaTek Inc. * Author: Flora Fu, MediaTek */ #include +#include #include #include #include @@ -23,16 +24,8 @@ #define MT6397_CID_CODE 0x97 static const struct resource mt6397_rtc_resources[] = { - { - .start = MT6397_RTC_BASE, - .end = MT6397_RTC_BASE + MT6397_RTC_SIZE, - .flags = IORESOURCE_MEM, - }, - { - .start = MT6397_IRQ_RTC, - .end = MT6397_IRQ_RTC, - .flags = IORESOURCE_IRQ, - }, + DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE), + DEFINE_RES_IRQ(MT6397_IRQ_RTC), }; static const struct resource mt6323_keys_resources[] = { From patchwork Tue Aug 6 16:27:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD78C1709 for ; Tue, 6 Aug 2019 16:29:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB6C3287EA for ; Tue, 6 Aug 2019 16:29:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F40D288D7; Tue, 6 Aug 2019 16:29:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E45A2887D for ; Tue, 6 Aug 2019 16:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=YtEfnyT/RXRBiUNBpRrYMoNRl2wjUfGfuAiZe4L9qSI=; b=E4CGcd3HA5G5HPzMJpDSqUc9uj 6v/jJq3Pcdhccncg4rou7YElXb5oxgAtRQzBMCgAt59bjDcULe3qKO6ozJiJXF3GiZ+4pElhdYziz 4o0tYwF0q3RTf1fXJi+e2eN5xiplwm81TjRIK9M4AEcwVyk79CBgnAdqNOgrnrHYPb6YK2IwfQaYJ SJROxLwjANzFDq6/P8tSrFz7w0wdJUUWl8Psb72z7H/CWueBJegrqbR1p5Ojv4uWjbLzsn7esgdzU zCC/hwt8oDQpCMP5VcFeY9TIo4Gv/AXF2uve1qZGes9icGAWLdaiOFiAdToGS0j21IzXLu6Iy82T6 AFYM2J2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2L0-00016v-7d; Tue, 06 Aug 2019 16:29:26 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000TN-IS; Tue, 06 Aug 2019 16:28:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108892; bh=3PISsFhP2p4tj5ULA7y6xFGMEsiPJROECIygBRA4/zw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=T0iVRuoT39ebTrgaB4OPmg8iKCMVi7occ3T/FDP4lznR919TIUhhex3qNkfFO/XJD JB6x5QXGcc2Z6dMM/2LvbOOXTTMb4Cf/Dt0uU3pTZBAWBzxa2c+kwIn/aHF02ERY+i RXrbehwbzB2PTGqqOMRELCEwuNmrVkUTeHdIiz1s= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M1nOg-1iAuD01Mxm-00tlSl; Tue, 06 Aug 2019 18:28:12 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 06/10] rtc: mt6397: add compatible for mt6323 Date: Tue, 6 Aug 2019 18:27:41 +0200 Message-Id: <20190806162745.8414-7-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:DIhRHK2hht0aS3gGjUBdMit/fe5lr9+ny2VtU0f6VLpF4RgJt8C Ny5zDjYzK3kf7a1hq2zGlC6rBLjIORmId4UnzIKKaj3aDh+S033M7zD5wxBBv7c9usz0me8 lAPNLVND/HByjaQNmrq7dlxPC/nk3seTF7rC6T4zZWTZoX3Myf0SkR6QS/2uCrRC8FqNBIj RpFLUf40mm8Ixb9lHkRaA== X-UI-Out-Filterresults: notjunk:1;V03:K0:E2LKdkfghHA=:FNem/ARHXV0uE2yKyiYHq5 gY2PBWiTOl70HXT2nYwno+ily3sUA4zF6RH2X6jPdcezoNtDW0fpVgTll1zlwPeq6Tw2ub8Rh 2DLriMUfIv4XlI/ncDzyEsiBAjtRLwzGfzPsHMwUj/Wl9ZfBUgZHNcwMGRrKMWpEBZDMQe3MA 40RANSqPGoLq8gRDOILBjzXQ/2BuDR9gCOEuupkUc2lXuDRHXHbD4ThS6RYnu5Z0cn+Gi1KFD LYMHR+GzdSqPtFAy+XhcGSA/I5KpbH6J8GLn/LOJNfWQz9SyQDrY5PmNbYwWthglBYrE9hiBM 2dyibsQZIos8kXbtwoYjpC6xQ6zuaoOc+LNJtSELPkyn0a6YoHAvapE+enMJ13xzXqFry9Sm+ jaIWjOOJwJX5oBn9vmD8xD16S9Vdpo5TF1uWeDcgLFnF5nqrqPKksW/Br+h6/AC/8T3k7LwnV DPspmn7LgPYxWTYu5gm7BGQcz2xh0/CIi0I9rRMC/QwJUBsPv1NOpINrzBQ5cscHM1/JeX4yg UddkmfaCEOZK5J64UCYbahuJVmvyr0GJL9eYhVMaYgH6U8sBnr2ffYzBRLTTafV5mBqhO3dy+ Bx2Rs8b3QG44khaV9pZ7wcGjl7cGKUHzsS/3tF6MD54cRvPBGrlzTPMOG/L7QsoVqhJwJjxyK 1bcmddHtIQEVPdd0UbPJz7Rb9dQqwd509SQEE9EHOob1v4Lc75sXYIF5Dy+s+7PTvEg9ExrTU oUknbl01i9Ro0FT+8HcYIWXwFBfOPRxq+TPqkl7RE+dKTAkYt9J2dqt4Ti3jTxyspfevS2dVi wAVKFf+bEijKxm4qvqTNLNz6iZUYVETBgVCFh1pry7t7Xl4t+muKh+YdDmFBEKUJB5QzVN9nL 2KXBIRoKtZONJ5pFopJyRjfPjLnrqICzU5ZD2Th8JDqeVjJOWddlHsNtYyT2jbr6sGshe/Ak/ fnRiizWw3kUvQ6xUX/Mit6facC85cft/l/ziBX6Ozlhz9dND526CTsRN4Ym56T5SAjC7O9/LM zqpKrMeRZNwABkCelzWUxfKrTOI/7YumvfaTL55UMibw9pwOMmkMo7HI24Mxb5UJZHgVCCFn4 JukOcDmXXHQvKfHc4/TxuTbdyIKcKMo8Xcg/uHjyZE9VlfLbTbE66IFDw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092853_927718_1960C6B7 X-CRM114-Status: GOOD ( 10.40 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl use mt6397 rtc driver also for mt6323 but with different base/size see "mfd: mt6323: add mt6323 rtc+pwrc" Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: moved (was part 5) changes since v2: splitted this from v2.3 suggested-by Alexandre Belloni drivers/rtc/rtc-mt6397.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index 9370b7fc9f81..21cd9cc8b4c7 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -325,6 +325,7 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend, mt6397_rtc_resume); static const struct of_device_id mt6397_rtc_of_match[] = { + { .compatible = "mediatek,mt6323-rtc", }, { .compatible = "mediatek,mt6397-rtc", }, { } }; From patchwork Tue Aug 6 16:27:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61F4F14DB for ; Tue, 6 Aug 2019 16:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50802287EA for ; Tue, 6 Aug 2019 16:28:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4408728876; Tue, 6 Aug 2019 16:28:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89FD4288D7 for ; Tue, 6 Aug 2019 16:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=DU0mOBvphSoHWEdDWwARA+hdxLQJzozrj11A1N8S2IM=; b=IzmXGVcloXwsRXVE9X6EHhT38R EOPG7Mo3hdUWGT0DGgstepUFtLHfJOnS0e4Mw3ul38eGL0UkGAWNxUww0XDmzhF45yErUGderTzC8 43xGSBt+DTNvAyqIbpmAhgVemUkQKd1dVdTsVPn6dd6mo2IImaab7fXLRPyAbIOBOAewTioJYaS9z lpcAqDWob4dnjMzjb8eFb6/szV2CFN3jgR/FVSRbqV2TimsA/GSRPl2vMVYFxhXTVmInagv0lojpi JxGQEH/PxDWtOgXWWsSP9tLLLLLRs5gs6A1f9WP7fYTHFafhbn9CjUrdABw91RFVhUbkXhNRT3UwS Kr9dTwJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KW-0000W7-5h; Tue, 06 Aug 2019 16:28:56 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KT-0000TM-Hz; Tue, 06 Aug 2019 16:28:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108894; bh=pEU670PIz00v8crp3rxuN1fi0Dt458xswIDV8ulcPJg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Qvg07LNJbzW/kNS1rCrgTigz45K9KSekRUIrJZT/LhvYe5xQw0lW292FTSqXDwwg5 /9aPnhc29E7nDm1+hHt2p0ysX9GzXsm9xbcfo+bcl7jtqbR8pjHT+MsgycEgJUVAMg ibW4whT79YFw/WvpMUVO3G/9cKlkTV+JLqFHMBgI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOOJl-1i0Hdo3EOb-005nMq; Tue, 06 Aug 2019 18:28:13 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 07/10] mfd: mt6323: add mt6323 rtc+pwrc Date: Tue, 6 Aug 2019 18:27:42 +0200 Message-Id: <20190806162745.8414-8-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:Os+hN2QnhF0iBkyzWFfYWOZ/foZamI6qBMXAngptIHU47UjTWnb 1G1VH82f39MDlQhnXgpKOJyjBNr3cmU78rclGXnwKIQW6g7a/ZGORHUDbkwut3VEwAkyDS1 uV87Tw7Hnynpa0Sztv2ReCtXOGa8S/mpUC4N9+MD+X2YDUYCNig/7weu4o7bM/c5/hLlE6g PmlrRq4wKlyzdd1A/QpeA== X-UI-Out-Filterresults: notjunk:1;V03:K0:C6S9T1mcc3w=:wZ1vAXXk0wjMf9cSlhYbKL NAT6kDU7oL1dS5Z/3WjhBBNyLifPnUCO6R5/hQAdVopCn+1nZdUgXx+GHFpE5xtl0SVTXyhKa /NfE2QUAVHG1Yy4Esi346cZuXmbAFkfb03du+dXFaahSC7ntJonyQd790/ok/3nWRG2e+P+n+ 5BaCS0BUZzVZpcKxhW0WjWIz7Y7EPWUZF9e9pVZaf0hiMapyY8eMqOOVtcB7J0Ftsmk58aQRa vQBsevAAy9CRWLPg/yKAK6CPABax5v7Cj4Nkcx6z+2BKYPCVFrAQQ0x4HWGsgnMKskDnm+Wwy y44We2ws06/rAm0H+XJ/4kuAaOPVZr8C7q9ySoBA6M5I/zUvrxgdM1z5EciDQVKo6DaRgYFqd e/e7hO6ccVCElb/lZ7py/AfU5W8FkMylsVEfiGQEcNeNeQGwM5Yeum+cJ+974CB23klw1QG3B FXP6+FRuBCwRfF4LGOIO1PCZW7jNsuYQBfcs2Rt9yE9YuZzhZkMZAKmGP9WZ7RQqG3EcYjaM4 fjD0zqDHHan3o24UxtnSe+imJvpAGvxgV8TV8zkMN4xbwK3VOE0ls0oUWfyadOSH7bTjL/uyb 9+F4Wud/AigsDiMeOUq6EAwMoms+YdPqblkFgY0k3ZBRba1QupT/pk/Q8AsS6E0Er+ikndnRR 4uxym6L+7cIXNGCQwNnJcNpz4xxvUzD1fAL6gFMt1CakxzQEHZkEsdj6IUWs18c2jdrEX+jXa dN1QXX2nvNjmNEAvT6vjuclfLxNkbIovRiKiPS/Dh0bp/gEhhmp5iZlRADg3iHs/o+J0POcfW 8qPAswbIzLBF0n8lVBKTprR81QGg2TK6aUNAps1v9vSRl+d/8P/2EFy59JwxhX75IDfXjp/EW rlMMwLCVgWQQxaACdI1ISu1IgW3C/RPCiZIOtlDx3KaKYck4rZnaE+L0Eto4dWxMS/tJ5wr2z rT7jySsXH4dnrEkjEfIv65kvyFisdXJt+3uS9s5gwr5pNUFD7hCf+eliNXTrg8zGvVaPTzJW7 x/YUosrZYVV8Om1+GCPpLXGOkjs9kVZZ99+RgeSj7Tq4IbNBHIjfG2XQqQadAnBSA8UjfUP/w neKBKOtEKcYHct6EEqov/GkxFRABtX7S0a+/SreowZxEpB+tFqOOcWrOA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092853_926401_1EFB6E14 X-CRM114-Status: GOOD ( 10.81 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add entry for rtc and power-controller to mt6323 Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: only splitting, second part of v2 part 4 drivers/mfd/mt6397-core.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.17.1 diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 5f7070267c9a..a4abce00f156 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -16,13 +16,24 @@ #include #include +#define MT6323_RTC_BASE 0x8000 +#define MT6323_RTC_SIZE 0x40 + #define MT6397_RTC_BASE 0xe000 #define MT6397_RTC_SIZE 0x3e +#define MT6323_PWRC_BASE 0x8000 +#define MT6323_PWRC_SIZE 0x40 + #define MT6323_CID_CODE 0x23 #define MT6391_CID_CODE 0x91 #define MT6397_CID_CODE 0x97 +static const struct resource mt6323_rtc_resources[] = { + DEFINE_RES_MEM(MT6323_RTC_BASE, MT6323_RTC_SIZE), + DEFINE_RES_IRQ(MT6323_IRQ_STATUS_RTC), +}; + static const struct resource mt6397_rtc_resources[] = { DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE), DEFINE_RES_IRQ(MT6397_IRQ_RTC), @@ -38,8 +49,17 @@ static const struct resource mt6397_keys_resources[] = { DEFINE_RES_IRQ(MT6397_IRQ_HOMEKEY), }; +static const struct resource mt6323_pwrc_resources[] = { + DEFINE_RES_MEM(MT6323_PWRC_BASE, MT6323_PWRC_SIZE), +}; + static const struct mfd_cell mt6323_devs[] = { { + .name = "mt6323-rtc", + .num_resources = ARRAY_SIZE(mt6323_rtc_resources), + .resources = mt6323_rtc_resources, + .of_compatible = "mediatek,mt6323-rtc", + }, { .name = "mt6323-regulator", .of_compatible = "mediatek,mt6323-regulator" }, { @@ -50,6 +70,11 @@ static const struct mfd_cell mt6323_devs[] = { .num_resources = ARRAY_SIZE(mt6323_keys_resources), .resources = mt6323_keys_resources, .of_compatible = "mediatek,mt6323-keys" + }, { + .name = "mt6323-pwrc", + .num_resources = ARRAY_SIZE(mt6323_pwrc_resources), + .resources = mt6323_pwrc_resources, + .of_compatible = "mediatek,mt6323-pwrc" }, }; From patchwork Tue Aug 6 16:27:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4DCF746 for ; Tue, 6 Aug 2019 16:30:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9391F28385 for ; Tue, 6 Aug 2019 16:30:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85DC12847B; Tue, 6 Aug 2019 16:30:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 031F128385 for ; Tue, 6 Aug 2019 16:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=aZtuGl8fzn8W3HZiYRx+rH7p9huSaOqyQ8cLy1V3RGM=; b=En/70urItAWFclBv6vbOE9JnN/ urojju4TFlnfHUBeALMrF5YlEgZ+ofL+yxmhMJEbnO7kCc+zDEr4Gn8auSSKcNlcFssnObkFQeXSX D1EhDfAs/4gcgx9dGN5T47E8tQ/hyM+P4HG0AApvnvt5+XMXMyGs01Ox3jqKQwb5l+OdQ4YpD654D xptLdaOoZDszZOL/e3devWC7e5H5DRj3k7HeUGrqMkO2SY1zMZbNdyPp4QwCAgCxqHlJjlkQNMMXp 8rD8PhBZSn+XOeGr6T6eGYpW/BPJx2bCKg48hg9ZWZuXnqNJgiOpCDXhedUyBBASKXBvr19lBGFLD 6jiXPoRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2MC-0003jr-NJ; Tue, 06 Aug 2019 16:30:40 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2KW-0000Vs-FP; Tue, 06 Aug 2019 16:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565108895; bh=YYhqVadKi9Ny0MQd5nYruiuZfLEPo+Mk45x6ClJf9vs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=X83wdvbqiQWov+vx/Y7tRkRKeHEWDZQ1V/OIOhPqZlZSuEcGdBa4PjJbohz7I98bI kpRE8qR2VzutyxDD5oiXHioiI6NxRZLqdNA0XjD8jx0dd2lRidR2r7HmYlTU8nWnH+ +39FXC15ccBpn7mmYUc0x9YgDRFEt0sx2RhailYY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.153.94]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MUHbK-1hmosH0fqc-00R3PH; Tue, 06 Aug 2019 18:28:15 +0200 From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 08/10] power: reset: add driver for mt6323 poweroff Date: Tue, 6 Aug 2019 18:27:43 +0200 Message-Id: <20190806162745.8414-9-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806162745.8414-1-frank-w@public-files.de> References: <20190806162745.8414-1-frank-w@public-files.de> X-Provags-ID: V03:K1:6Nvk99cZ4lkB9xXKbFHJNhLkUhjDQqkoO6Kw5xHbaPS4bfFc+ZK L++rabZ5AN/jHCYnXxRJEEEXCxbcwkN3wdiog2qdFNtuUogjRNuCBaI50Gid9dje9t8G9Ao XfOOXB5l6M9HypzOxjicoJ0X/YIhinGJNdqjLmUq+3F/8ZQ+MFu9X9pqnL+dGseaYJZdVSI EUo9BMQ7NVolRdr5SMKGQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:/OknRzOgVBc=:EcfajLlIrF9zRC/n3HTFb+ 4yz6pWy+aN60wl1VmTNhazBOCARSZwKmxZ2PMpKC21LrUxLZ9o5Em1RpeGQbnK6iBLjubbK4c fC2vf7M4Hrb2nYBfjMCVLEwZmOPnl5KWE61t63ZvHk8KnlRZUcxcFRhEM+MILP2OUYF/Zi2L1 KkB2AF2UI+ubXds6y5z2pKY+AjtpIbKKHjiLFemGEGPgxH6TN3M+ArnR0aeZE5m7Ugv1xP43w 3h3DJrkuWwkDwVjWL2M1+bWspLdbAHLFe7pmKrXD/bgglFmoBhhXYLI3JVsx1i+XW5CSSCqyd gxy6YH1gqhc6RBtKcHcVarA22FY8q9TQyNebXjBpef282yLjs8OiD6gIQtDhXefx1vBeaPAZ7 U36lgM11tpAOP6kXC9adcQ+qHDwslgyJBVRSoOBnHfuv8cswa1jvfqCLQKPHj4UpfL3YPJfxI KyXVmyEOFr8+KRwJXphi/hs3xCXEQ74IZkwZiLATb8kG6KyGFKfelBbgCAPsLhGCNAqcbexFC gvkZeY0xSyt+5J/ykRy7j5UzpAhLo6qvzLaiJI3ijdQR3eviUUWrnWmY7MNiAt6AiVMdodE0i Wc6QhioBqWdYqycJfeHwo5udxp+PpzqdyVy3ze9dvgAvrWIXgq0clm81tP7McLvsVolYk/rsG GaOroiN2ekc0IZKsSoNZ3FsEYUFFd30fwzqI0hoURTHxY/+ScX41KP2yke2Td4X7U7BKQLB9Z rXyq7HgweWoBL0n6J92dJh0e7WeOVJGC8cCbGhPOK2qlAb71dFp7qEZ9unWNPw7JfF353kpXm AOrY/r5HufLyl5kJPuWU4X4o0h3NR/IAOHQzqb8NssupaY8y0GTawVSMPEgOPeK3yVFRVQxoQ eBhFeRuEp9LVNZ82hdTKbJzv0TTbyZozfXKppITdlFgvlqViyhO8z/PweR5I3iAYogQmMxb8g JPcE5U/PoV/l1iP0ElUAOoQdIdSwPCqcRyWc9Mk+S/yfAN0Q3jt0vO8W0JRAnojPe5A/Ic4L0 jkw+Haz2mgKJolIB/7Pc+O3j8aQxwjFgVzzC2J4A0Z5LnYyRKe1sXC1lY4ALrSM6XOrxSRNv0 Fs606no9/swNQA04yKiBtfe5YgGxyxo1PePptaJedEQt9Q93MtXCIA6LQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_092856_822693_74665B59 X-CRM114-Status: GOOD ( 16.96 ) 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add poweroff driver for mt6323 and make Makefile and Kconfig-Entries Suggested-by: Frank Wunderlich Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: none (=v2 part 5) drivers/power/reset/Kconfig | 10 +++ drivers/power/reset/Makefile | 1 + drivers/power/reset/mt6323-poweroff.c | 97 +++++++++++++++++++++++++++ include/linux/mfd/mt6397/core.h | 2 + 4 files changed, 110 insertions(+) create mode 100644 drivers/power/reset/mt6323-poweroff.c -- 2.17.1 diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index a564237278ff..c721939767eb 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -140,6 +140,16 @@ config POWER_RESET_LTC2952 This driver supports an external powerdown trigger and board power down via the LTC2952. Bindings are made in the device tree. +config POWER_RESET_MT6323 + bool "MediaTek MT6323 power-off driver" + depends on MFD_MT6397 + help + The power-off driver is responsible for externally shutdown down + the power of a remote MediaTek SoC MT6323 is connected to through + controlling a tiny circuit BBPU inside MT6323 RTC. + + Say Y if you have a board where MT6323 could be found. + config POWER_RESET_QNAP bool "QNAP power-off driver" depends on OF_GPIO && PLAT_ORION diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile index 85da3198e4e0..da37f8b851dc 100644 --- a/drivers/power/reset/Makefile +++ b/drivers/power/reset/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o +obj-$(CONFIG_POWER_RESET_MT6323) += mt6323-poweroff.o obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o diff --git a/drivers/power/reset/mt6323-poweroff.c b/drivers/power/reset/mt6323-poweroff.c new file mode 100644 index 000000000000..1caf43d9e46d --- /dev/null +++ b/drivers/power/reset/mt6323-poweroff.c @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Power off through MediaTek PMIC + * + * Copyright (C) 2018 MediaTek Inc. + * + * Author: Sean Wang + * + */ + +#include +#include +#include +#include +#include +#include + +struct mt6323_pwrc { + struct device *dev; + struct regmap *regmap; + u32 base; +}; + +static struct mt6323_pwrc *mt_pwrc; + +static void mt6323_do_pwroff(void) +{ + struct mt6323_pwrc *pwrc = mt_pwrc; + unsigned int val; + int ret; + + regmap_write(pwrc->regmap, pwrc->base + RTC_BBPU, RTC_BBPU_KEY); + regmap_write(pwrc->regmap, pwrc->base + RTC_WRTGR, 1); + + ret = regmap_read_poll_timeout(pwrc->regmap, + pwrc->base + RTC_BBPU, val, + !(val & RTC_BBPU_CBUSY), + MTK_RTC_POLL_DELAY_US, + MTK_RTC_POLL_TIMEOUT); + if (ret) + dev_err(pwrc->dev, "failed to write BBPU: %d\n", ret); + + /* Wait some time until system down, otherwise, notice with a warn */ + mdelay(1000); + + WARN_ONCE(1, "Unable to power off system\n"); +} + +static int mt6323_pwrc_probe(struct platform_device *pdev) +{ + struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent); + struct mt6323_pwrc *pwrc; + struct resource *res; + + pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL); + if (!pwrc) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + pwrc->base = res->start; + pwrc->regmap = mt6397_chip->regmap; + pwrc->dev = &pdev->dev; + mt_pwrc = pwrc; + + pm_power_off = &mt6323_do_pwroff; + + return 0; +} + +static int mt6323_pwrc_remove(struct platform_device *pdev) +{ + if (pm_power_off == &mt6323_do_pwroff) + pm_power_off = NULL; + + return 0; +} + +static const struct of_device_id mt6323_pwrc_dt_match[] = { + { .compatible = "mediatek,mt6323-pwrc" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mt6323_pwrc_dt_match); + +static struct platform_driver mt6323_pwrc_driver = { + .probe = mt6323_pwrc_probe, + .remove = mt6323_pwrc_remove, + .driver = { + .name = "mt6323-pwrc", + .of_match_table = mt6323_pwrc_dt_match, + }, +}; + +module_platform_driver(mt6323_pwrc_driver); + +MODULE_DESCRIPTION("Poweroff driver for MT6323 PMIC"); +MODULE_AUTHOR("Sean Wang "); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h index 25a95e72179b..652da61e3711 100644 --- a/include/linux/mfd/mt6397/core.h +++ b/include/linux/mfd/mt6397/core.h @@ -7,6 +7,8 @@ #ifndef __MFD_MT6397_CORE_H__ #define __MFD_MT6397_CORE_H__ +#include + enum mt6397_irq_numbers { MT6397_IRQ_SPKL_AB = 0, MT6397_IRQ_SPKR_AB, From patchwork Tue Aug 6 16:30:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 754451395 for ; Tue, 6 Aug 2019 16:31:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63E732842D for ; Tue, 6 Aug 2019 16:31:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5779B28866; Tue, 6 Aug 2019 16:31:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 646432842D for ; Tue, 6 Aug 2019 16:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=opjrcVxtKro2m6/d0K0clebWB5ND6rskmzE37F+qC3M=; b=MiC elAL4NcHxpGwbS7AAIMY3kb2YG2h8NQQAxVnBV2z7H3UOk/gSvx6puw4xSKgOQ6YfnKQen/1Xa4fT CSC1m3fxsuzR9Uq7/cPx6chlSTfYU6axaCEZD1ptpC4lQ2CzypwiFCBRNOs8aMOWp7UFgRN8bhGJl w5D42v90j/l1qMFFUDBxKIPU/fczzc142xdy4ndr0+Wlm4pmiDC5hfsADUbyLqxxjAs1AtSQ+IWse iDpmRjox/SegjfiGy/D+n0Cgvb6eJ7UE0JDX9WVqEC6ErUY5SDuqcD2O7PTzm7F4ZKEpXplzy6MN2 Xo3GWtRxPvFhxu9x9wcvvtT4mbbQLHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Ml-0004RH-Qn; Tue, 06 Aug 2019 16:31:15 +0000 Received: from mxwww.masterlogin.de ([95.129.51.220]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2ME-0003gj-Ju; Tue, 06 Aug 2019 16:30:44 +0000 Received: from mxout2.routing.net (unknown [192.168.10.82]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id D344996CD2; Tue, 6 Aug 2019 16:30:34 +0000 (UTC) Received: from mxbox1.masterlogin.de (unknown [192.168.10.253]) by mxout2.routing.net (Postfix) with ESMTP id 0A2DC6203B; Tue, 6 Aug 2019 16:30:35 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-217.61.153.94.bambit.de [217.61.153.94]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id A2882403C7; Tue, 6 Aug 2019 18:30:33 +0200 (CEST) From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 09/10] MAINTAINERS: add Mediatek shutdown drivers Date: Tue, 6 Aug 2019 18:30:25 +0200 Message-Id: <20190806163026.8530-1-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_093042_838427_89183CEA X-CRM114-Status: UNSURE ( 7.61 ) X-CRM114-Notice: Please train this message. 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add Section in MAINTAINERS file for poweroff driver Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: moved SOB changes since v2: none (=v2 part 6) MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6426db5198f0..4172a3177633 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10128,6 +10128,13 @@ S: Maintained F: drivers/net/dsa/mt7530.* F: net/dsa/tag_mtk.c +MEDIATEK BOARD LEVEL SHUTDOWN DRIVERS +M: Sean Wang +L: linux-pm@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt +F: drivers/power/reset/mt6323-poweroff.c + MEDIATEK JPEG DRIVER M: Rick Chang M: Bin Liu From patchwork Tue Aug 6 16:30:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11079399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72222746 for ; Tue, 6 Aug 2019 16:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F4882842D for ; Tue, 6 Aug 2019 16:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51C85285D1; Tue, 6 Aug 2019 16:31:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F05682842D for ; Tue, 6 Aug 2019 16:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=dMtDK6VXwtQ8dkbOp4iXtn2tjYQA1BjGwPYZDlAHaS0=; b=TzdQK2VHbC9UwHzmLNOKEIun+f OCIGdLgvD3rVXlOq4iYFhukll8C0vYIe3YdCpBFQRKt4rmPoKVddPG9fhXnjrmrn9LO75oUaXGEMJ 22d332jLxm4SdJeKf11mOQR2agVwxy9zC21uTrFZKh+M7tYAgEdC7Y44pPimjERwvHoGAoOPKwo7H xNkovt5AqKUBjYTeGnX1zJA0iHnEwRC5CW1RQvUrNH0Qk/nRmmhaMzWWTexFHG/CVm4fXy7KOJEy6 lUo9BMy/+LD7tNYDduvHo5MPX5nBD+lQaY7GwiB4YZB0dxswoMNg+0ET8wPw9gtYwAdtKazD6hjzW r9QsIWpA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv2Mz-0004fo-SM; Tue, 06 Aug 2019 16:31:29 +0000 Received: from mxwww.masterlogin.de ([95.129.51.220]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv2ME-0003l4-6l; Tue, 06 Aug 2019 16:30:44 +0000 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id E164A96CDE; Tue, 6 Aug 2019 16:30:38 +0000 (UTC) Received: from mxbox1.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id 1E41143C54; Tue, 6 Aug 2019 16:30:39 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-217.61.153.94.bambit.de [217.61.153.94]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id DF773403C7; Tue, 6 Aug 2019 18:30:37 +0200 (CEST) From: Frank Wunderlich To: Alessandro Zummo , Alexandre Belloni , Allison Randal , "David S. Miller" , devicetree@vger.kernel.org, Eddie Huang , Greg Kroah-Hartman , Jonathan Cameron , Kate Stewart , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Ferre , Richard Fontana , Rob Herring , Sean Wang , Sebastian Reichel , Thomas Gleixner , "Tianping . Fang" Subject: [PATCH v4 10/10] arm: dts: mt6323: add keys, power-controller, rtc and codec Date: Tue, 6 Aug 2019 18:30:26 +0200 Message-Id: <20190806163026.8530-2-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806163026.8530-1-frank-w@public-files.de> References: <20190806163026.8530-1-frank-w@public-files.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_093042_589490_F10B1DE0 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. 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: Josef Friedl , Frank Wunderlich MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl support poweroff and power-related keys on bpi-r2 Suggested-by: Frank Wunderlich Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v3: none changes since v2: none (=v2 part 7) arch/arm/boot/dts/mt6323.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/mt6323.dtsi b/arch/arm/boot/dts/mt6323.dtsi index ba397407c1dd..7fda40ab5fe8 100644 --- a/arch/arm/boot/dts/mt6323.dtsi +++ b/arch/arm/boot/dts/mt6323.dtsi @@ -238,5 +238,32 @@ regulator-enable-ramp-delay = <216>; }; }; + + mt6323keys: mt6323keys { + compatible = "mediatek,mt6323-keys"; + mediatek,long-press-mode = <1>; + power-off-time-sec = <0>; + + power { + linux,keycodes = <116>; + wakeup-source; + }; + + home { + linux,keycodes = <114>; + }; + }; + + codec: mt6397codec { + compatible = "mediatek,mt6397-codec"; + }; + + power-controller { + compatible = "mediatek,mt6323-pwrc"; + }; + + rtc { + compatible = "mediatek,mt6323-rtc"; + }; }; };