From patchwork Sun Aug 18 13:55:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099583 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 C356114F7 for ; Sun, 18 Aug 2019 14:04:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B08B128516 for ; Sun, 18 Aug 2019 14:04:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A111828769; Sun, 18 Aug 2019 14:04:37 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CDD728516 for ; Sun, 18 Aug 2019 14:04:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43036 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 75F1E96DF0; Sun, 18 Aug 2019 13:56:24 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id E9D6843D5A; Sun, 18 Aug 2019 13:56:23 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 493E536008B; Sun, 18 Aug 2019 15:56:21 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 01/13] dt-bindings: mfd: mediatek: mt6397: change to relative paths Date: Sun, 18 Aug 2019 15:55:59 +0200 Message-Id: <20190818135611.7776-2-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP paths in dt-bindings should be relative as suggested by Lee Johnes Suggested-By: Lee Jones Signed-off-by: Frank Wunderlich Reviewed-by: Rob Herring --- changes since v5: splitted from dt-bindings: add powercontroller --- Documentation/devicetree/bindings/mfd/mt6397.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 0ebd08af777d..ab3163a60929 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -12,7 +12,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules: 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. See the following for pwarp node definitions: -Documentation/devicetree/bindings/soc/mediatek/pwrap.txt +../soc/mediatek/pwrap.txt This document describes the binding for MFD device and its sub module. @@ -27,9 +27,9 @@ Optional subnodes: - regulators Required properties: - compatible: "mediatek,mt6397-regulator" - see Documentation/devicetree/bindings/regulator/mt6397-regulator.txt + see ../regulator/mt6397-regulator.txt - compatible: "mediatek,mt6323-regulator" - see Documentation/devicetree/bindings/regulator/mt6323-regulator.txt + see ../regulator/mt6323-regulator.txt - codec Required properties: - compatible: "mediatek,mt6397-codec" @@ -39,12 +39,12 @@ Optional subnodes: - led Required properties: - compatible: "mediatek,mt6323-led" - see Documentation/devicetree/bindings/leds/leds-mt6323.txt + see ../leds/leds-mt6323.txt - keys Required properties: - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" - see Documentation/devicetree/bindings/input/mtk-pmic-keys.txt + see ../input/mtk-pmic-keys.txt Example: pwrap: pwrap@1000f000 { From patchwork Sun Aug 18 13:56:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099601 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 0D12F17E2 for ; Sun, 18 Aug 2019 14:05:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1F5728516 for ; Sun, 18 Aug 2019 14:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5FEB28769; Sun, 18 Aug 2019 14:05:15 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C7D428516 for ; Sun, 18 Aug 2019 14:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbfHROER (ORCPT ); Sun, 18 Aug 2019 10:04:17 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:42954 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbfHROER (ORCPT ); Sun, 18 Aug 2019 10:04:17 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 9115496DF1; Sun, 18 Aug 2019 13:56:24 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id E4AB243CE1; Sun, 18 Aug 2019 13:56:24 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id E229A36043A; Sun, 18 Aug 2019 15:56:23 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 02/13] dt-bindings: mfd: mediatek: update rtc to include mt6323 Date: Sun, 18 Aug 2019 15:56:00 +0200 Message-Id: <20190818135611.7776-3-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add mt6323 to rtc-bindings Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich Reviewed-by: Rob Herring --- changes since v5: splitted from "dt-bindings: add powercontroller" --- Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index ab3163a60929..5fccf987865b 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -22,8 +22,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 ../rtc/rtc-mt6397.txt - regulators Required properties: - compatible: "mediatek,mt6397-regulator" From patchwork Sun Aug 18 13:56:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099585 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 42C8313A0 for ; Sun, 18 Aug 2019 14:04:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31C0E28516 for ; Sun, 18 Aug 2019 14:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24C2928770; Sun, 18 Aug 2019 14:04: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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C186228516 for ; Sun, 18 Aug 2019 14:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726956AbfHROEi (ORCPT ); Sun, 18 Aug 2019 10:04:38 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43026 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout2.routing.net (unknown [192.168.10.82]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 2897096DF2; Sun, 18 Aug 2019 13:56:25 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout2.routing.net (Postfix) with ESMTP id 738156207B; Sun, 18 Aug 2019 13:56:25 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id AA8F336008B; Sun, 18 Aug 2019 15:56:24 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 03/13] dt-bindings: mfd: mediatek: add mt6323 power-controller Date: Sun, 18 Aug 2019 15:56:01 +0200 Message-Id: <20190818135611.7776-4-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl - add powercontroller-section to existing binding-document - add mt6323-pwrc bindings-document with example Suggested-by: Frank Wunderlich Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich Acked-for-MFD-by: Lee Jones Reviewed-by: Rob Herring --- changes since v5: split out non-pwrc related changes changes since v4: none changes since v3: none changes since v2: none (=v2 part 7) --- .../devicetree/bindings/mfd/mt6397.txt | 6 ++++++ .../bindings/power/reset/mt6323-poweroff.txt | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 5fccf987865b..a9b105ac00a8 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. @@ -48,6 +49,11 @@ Optional subnodes: - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" see ../input/mtk-pmic-keys.txt +- power-controller + Required properties: + - compatible: "mediatek,mt6323-pwrc" + For details, see ../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 Sun Aug 18 13:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099591 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 668B714F7 for ; Sun, 18 Aug 2019 14:05:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54B6128516 for ; Sun, 18 Aug 2019 14:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48E4628770; Sun, 18 Aug 2019 14:05:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D273828769 for ; Sun, 18 Aug 2019 14:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726807AbfHROEh (ORCPT ); Sun, 18 Aug 2019 10:04:37 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43038 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726818AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout2.routing.net (unknown [192.168.10.82]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id D27A496DF7; Sun, 18 Aug 2019 13:56:25 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout2.routing.net (Postfix) with ESMTP id 333C96207B; Sun, 18 Aug 2019 13:56:26 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 6C84136043A; Sun, 18 Aug 2019 15:56:25 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 04/13] dt-bindings: rtc: mediatek: add missing mt6397 rtc Date: Sun, 18 Aug 2019 15:56:02 +0200 Message-Id: <20190818135611.7776-5-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Reviewed-by: Rob Herring --- changes since v5: none changes since v4: use relative path 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 diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt new file mode 100644 index 000000000000..55a0c8874c03 --- /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: +../mfd/mt6397.txt + +For MediaTek PMIC wrapper bus bindings, see: +../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 Sun Aug 18 13:56:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099603 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 DCE5513A0 for ; Sun, 18 Aug 2019 14:05:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD17228516 for ; Sun, 18 Aug 2019 14:05:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C04F328769; Sun, 18 Aug 2019 14:05:22 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 463A628516 for ; Sun, 18 Aug 2019 14:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726806AbfHROFQ (ORCPT ); Sun, 18 Aug 2019 10:05:16 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:42948 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726759AbfHROER (ORCPT ); Sun, 18 Aug 2019 10:04:17 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 9FEE696DF4; Sun, 18 Aug 2019 13:56:26 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id F208243CE1; Sun, 18 Aug 2019 13:56:26 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 2DA223605A8; Sun, 18 Aug 2019 15:56:26 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 05/13] rtc: mt6397: move some common definitions into rtc.h Date: Sun, 18 Aug 2019 15:56:03 +0200 Message-Id: <20190818135611.7776-6-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Alexandre Belloni --- changes since v5: none changes since v4: none 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 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 Sun Aug 18 13:56:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099589 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 28B0E13A0 for ; Sun, 18 Aug 2019 14:05:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14F8128516 for ; Sun, 18 Aug 2019 14:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 046582877F; Sun, 18 Aug 2019 14:05:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D649C28516 for ; Sun, 18 Aug 2019 14:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbfHROEi (ORCPT ); Sun, 18 Aug 2019 10:04:38 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43042 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout2.routing.net (unknown [192.168.10.82]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 5A0DC96DF9; Sun, 18 Aug 2019 13:56:27 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout2.routing.net (Postfix) with ESMTP id AB4D46207B; Sun, 18 Aug 2019 13:56:27 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id ED0C536043A; Sun, 18 Aug 2019 15:56:26 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 06/13] mfd: mt6397: add mutex include Date: Sun, 18 Aug 2019 15:56:04 +0200 Message-Id: <20190818135611.7776-7-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Friedl add missing mutex.h Signed-off-by: Josef Friedl Signed-off-by: Frank Wunderlich --- changes since v5: separated from "power: reset: add driver for mt6323 poweroff" --- include/linux/mfd/mt6397/core.h | 2 ++ 1 file changed, 2 insertions(+) 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 Sun Aug 18 13:56:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099581 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 30EA614F7 for ; Sun, 18 Aug 2019 14:04:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0732928516 for ; Sun, 18 Aug 2019 14:04:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D54F728769; Sun, 18 Aug 2019 14:04:35 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1764128516 for ; Sun, 18 Aug 2019 14:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbfHROE1 (ORCPT ); Sun, 18 Aug 2019 10:04:27 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43024 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 27B7B96DFA; Sun, 18 Aug 2019 13:56:28 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id 7B91D43CE1; Sun, 18 Aug 2019 13:56:28 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id A53193605A8; Sun, 18 Aug 2019 15:56:27 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 07/13] rtc: mt6397: improvements of rtc driver Date: Sun, 18 Aug 2019 15:56:05 +0200 Message-Id: <20190818135611.7776-8-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Alexandre Belloni --- changes since v5: none changes since v4: none 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(-) 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 Sun Aug 18 13:56:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099593 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 434F713A0 for ; Sun, 18 Aug 2019 14:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3380C28516 for ; Sun, 18 Aug 2019 14:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2771E28769; Sun, 18 Aug 2019 14:05:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 299CC2859E for ; Sun, 18 Aug 2019 14:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbfHROEi (ORCPT ); Sun, 18 Aug 2019 10:04:38 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43040 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id EB2EC96DFC; Sun, 18 Aug 2019 13:56:28 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id 46D0F43CE1; Sun, 18 Aug 2019 13:56:29 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 7662136043A; Sun, 18 Aug 2019 15:56:28 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 08/13] mfd: mt6323: some improvements of mt6397-core Date: Sun, 18 Aug 2019 15:56:06 +0200 Message-Id: <20190818135611.7776-9-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-for-MFD-by: Lee Jones --- changes since v5: none changes since v4: do not touch year of copyright 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 | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 337bcccdb914..c9a81087fa55 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -5,6 +5,7 @@ */ #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 Sun Aug 18 13:56:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099607 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 1694514F7 for ; Sun, 18 Aug 2019 14:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 069A528516 for ; Sun, 18 Aug 2019 14:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE1A728769; Sun, 18 Aug 2019 14:05:26 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBE1428516 for ; Sun, 18 Aug 2019 14:05:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbfHROEQ (ORCPT ); Sun, 18 Aug 2019 10:04:16 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:42940 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfHROEQ (ORCPT ); Sun, 18 Aug 2019 10:04:16 -0400 Received: from mxout2.routing.net (unknown [192.168.10.82]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 9D96F96DFD; Sun, 18 Aug 2019 13:56:29 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout2.routing.net (Postfix) with ESMTP id F32AE6207B; Sun, 18 Aug 2019 13:56:29 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 3C00336066A; Sun, 18 Aug 2019 15:56:29 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 09/13] rtc: mt6397: add compatible for mt6323 Date: Sun, 18 Aug 2019 15:56:07 +0200 Message-Id: <20190818135611.7776-10-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Alexandre Belloni --- changes since v5: none changes since v4: none 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(+) 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 Sun Aug 18 13:56:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099587 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 64E8114F7 for ; Sun, 18 Aug 2019 14:04:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 543D22859E for ; Sun, 18 Aug 2019 14:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4895D28516; Sun, 18 Aug 2019 14:04: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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7E3B2859E for ; Sun, 18 Aug 2019 14:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbfHROEi (ORCPT ); Sun, 18 Aug 2019 10:04:38 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43034 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfHROE0 (ORCPT ); Sun, 18 Aug 2019 10:04:26 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 7FA6696DFB; Sun, 18 Aug 2019 13:56:30 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id BF88743D5A; Sun, 18 Aug 2019 13:56:30 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id EAAAC36043A; Sun, 18 Aug 2019 15:56:29 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 10/13] mfd: mt6323: add mt6323 rtc+pwrc Date: Sun, 18 Aug 2019 15:56:08 +0200 Message-Id: <20190818135611.7776-11-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-for-MFD-by: Lee Jones --- changes since v5: none changes since v4: none 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(+) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index c9a81087fa55..5916978a8feb 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 Sun Aug 18 13:56:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099597 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 0FC5813A0 for ; Sun, 18 Aug 2019 14:05:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0000228516 for ; Sun, 18 Aug 2019 14:05:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E78AF28769; Sun, 18 Aug 2019 14:05:11 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B4328516 for ; Sun, 18 Aug 2019 14:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbfHROEW (ORCPT ); Sun, 18 Aug 2019 10:04:22 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43028 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfHROEV (ORCPT ); Sun, 18 Aug 2019 10:04:21 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 260E396DFE; Sun, 18 Aug 2019 13:56:31 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id 804FB43D5A; Sun, 18 Aug 2019 13:56:31 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id B03453605A8; Sun, 18 Aug 2019 15:56:30 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 11/13] power: reset: add driver for mt6323 poweroff Date: Sun, 18 Aug 2019 15:56:09 +0200 Message-Id: <20190818135611.7776-12-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Sebastian Reichel --- changes since v5: split out mfd/mt6397/core.h changes since v4: none 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 +++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 drivers/power/reset/mt6323-poweroff.c 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"); From patchwork Sun Aug 18 13:56:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099605 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 EFC9F14F7 for ; Sun, 18 Aug 2019 14:05:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEAB028516 for ; Sun, 18 Aug 2019 14:05:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D30FB28769; Sun, 18 Aug 2019 14:05:24 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77E5828516 for ; Sun, 18 Aug 2019 14:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfHROEQ (ORCPT ); Sun, 18 Aug 2019 10:04:16 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:42944 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbfHROEQ (ORCPT ); Sun, 18 Aug 2019 10:04:16 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 93D1696DFF; Sun, 18 Aug 2019 13:56:33 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id EB2E443D5A; Sun, 18 Aug 2019 13:56:33 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 7949C36008B; Sun, 18 Aug 2019 15:56:31 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 12/13] MAINTAINERS: add Mediatek shutdown drivers Date: Sun, 18 Aug 2019 15:56:10 +0200 Message-Id: <20190818135611.7776-13-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Sebastian Reichel --- changes since v5: none changes since v4: none 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 Sun Aug 18 13:56:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11099595 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 DE61F13A0 for ; Sun, 18 Aug 2019 14:05:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF0D428516 for ; Sun, 18 Aug 2019 14:05:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2B3428769; Sun, 18 Aug 2019 14:05:10 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7150A28516 for ; Sun, 18 Aug 2019 14:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbfHROFF (ORCPT ); Sun, 18 Aug 2019 10:05:05 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:43030 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbfHROEZ (ORCPT ); Sun, 18 Aug 2019 10:04:25 -0400 Received: from mxout1.routing.net (unknown [192.168.10.81]) by new.mxwww.masterlogin.de (Postfix) with ESMTPS id 7913896E01; Sun, 18 Aug 2019 13:56:34 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.253]) by mxout1.routing.net (Postfix) with ESMTP id AFF4243D5A; Sun, 18 Aug 2019 13:56:34 +0000 (UTC) Received: from localhost.localdomain (fttx-pool-185.53.43.183.bambit.de [185.53.43.183]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id E24203605A8; Sun, 18 Aug 2019 15:56:33 +0200 (CEST) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , devicetree@vger.kernel.org, "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , Alexandre Belloni , Eddie Huang , Josef Friedl , Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Mark Rutland , Matthias Brugger , Rob Herring , Sean Wang , Sebastian Reichel , "Tianping Fang" Subject: [PATCH v6 13/13] arm: dts: mt6323: add keys, power-controller, rtc and codec Date: Sun, 18 Aug 2019 15:56:11 +0200 Message-Id: <20190818135611.7776-14-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818135611.7776-1-frank-w@public-files.de> References: <20190818135611.7776-1-frank-w@public-files.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 v5: none changes since v4: none 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"; + }; }; };