From patchwork Fri Mar 23 09:15:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 10303061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB5CE60385 for ; Fri, 23 Mar 2018 09:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C32528D27 for ; Fri, 23 Mar 2018 09:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A16928D40; Fri, 23 Mar 2018 09:20:32 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 7C9BC28D27 for ; Fri, 23 Mar 2018 09:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbeCWJUI (ORCPT ); Fri, 23 Mar 2018 05:20:08 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:46348 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752003AbeCWJPa (ORCPT ); Fri, 23 Mar 2018 05:15:30 -0400 X-UUID: d30cda85e63346e1a9ec81b26bd15002-20180323 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 883052452; Fri, 23 Mar 2018 17:15:25 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 23 Mar 2018 17:15:24 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 23 Mar 2018 17:15:24 +0800 From: To: , , , , , , CC: , , , , , Sean Wang Subject: [PATCH v1 04/16] mfd: mt6397: add MT6323 RTC support into MT6397 driver Date: Fri, 23 Mar 2018 17:15:01 +0800 Message-ID: <90320622cb491b9d3251e2ce9d0501422f47660f.1521794177.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.5042-8.2.9001-23736.004 X-TM-AS-Result: No-4.555200-8.000000-10 X-TMASE-MatchedRID: yFGXaP8bkQMxFdXyW/P+XWMGiV639iF0moKXVHfiMM9cU0dNErOD+opb wG9fIuIT5IXjmeRXhnCJEz4Y6DI4oJsYdIGP6PlZndu3heVAxaNzd7C7BtJobgqiCYa6w8tv8tM WbtVzWkjt4ariHb3sbHv+mmMQs+2yHxPMjOKY7A+6vVBUUydJCsRB0bsfrpPInxMyeYT53RkbSW 746/XYMKCgeSTuE21HV901T3m/1GcuA5kq+A5t08V4uyloxhpwLZhSe8r+c9RWpF6VpTLhEY2q0 akcUk4Qw99bu/x2/ZGTdSRXlCnjBIjjlF305EnAWUm8SESyzd+8353hqEyjk1Zca9RSYo/b X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.555200-8.000000 X-TMASE-Version: SMEX-12.5.0.5042-8.2.9001-23736.004 X-TMASE-POSTMAN: 2-d; X-MTK: N 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: Sean Wang Add compatible string as "mt6323-rtc" that will make the OF core spawn child devices for the RTC subnode of that MT6323 MFD node. Signed-off-by: Sean Wang --- drivers/mfd/mt6397-core.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 77b64bd..f71874a 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 MediaTek Inc. + * Copyright (c) 2014-2018 MediaTek Inc. * Author: Flora Fu, MediaTek * * This program is free software; you can redistribute it and/or modify @@ -23,6 +23,9 @@ #include #include +#define MT6323_RTC_BASE 0x8000 +#define MT6323_RTC_SIZE 0x3e + #define MT6397_RTC_BASE 0xe000 #define MT6397_RTC_SIZE 0x3e @@ -30,6 +33,19 @@ #define MT6391_CID_CODE 0x91 #define MT6397_CID_CODE 0x97 +static const struct resource mt6323_rtc_resources[] = { + { + .start = MT6323_RTC_BASE, + .end = MT6323_RTC_BASE + MT6323_RTC_SIZE, + .flags = IORESOURCE_MEM, + }, + { + .start = MT6323_IRQ_STATUS_RTC, + .end = MT6323_IRQ_STATUS_RTC, + .flags = IORESOURCE_IRQ, + }, +}; + static const struct resource mt6397_rtc_resources[] = { { .start = MT6397_RTC_BASE, @@ -55,6 +71,11 @@ static const struct resource mt6397_keys_resources[] = { 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" }, {