From patchwork Wed Jul 3 16:48:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11029931 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 D8855138B for ; Wed, 3 Jul 2019 16:50:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C75961FE84 for ; Wed, 3 Jul 2019 16:50:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB546289C2; Wed, 3 Jul 2019 16:50: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,DKIM_SIGNED, DKIM_VALID,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 41CDC1FE84 for ; Wed, 3 Jul 2019 16:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbfGCQtn (ORCPT ); Wed, 3 Jul 2019 12:49:43 -0400 Received: from mout.gmx.net ([212.227.15.19]:57979 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727119AbfGCQtl (ORCPT ); Wed, 3 Jul 2019 12:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1562172516; bh=M6PWi+AqvzIHnI2kv34DphxxV8F7xx3ycFGzciNTHis=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=bTC6pznWnKuM2Q7ikYhEDEtVB6XrMQF7C4D3fmIQN5OPnhNjXYqhISarRoFWzzyJr nEO4RH6SMtjdWb90eSUniAUT6Qeagsf/SPn8grFddGBfDgaXgriQOZrTPjf9Hw4bno SHQ16P83037cSeXYO0ANMgqtI/zfdFvKIAs3c42I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([217.61.158.204]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N9MpS-1iccR545rg-015Lm9; Wed, 03 Jul 2019 18:48:36 +0200 From: Frank Wunderlich To: Lee Jones , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang , Sebastian Reichel , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Eddie Huang , Thomas Gleixner , Richard Fontana , Allison Randal , "David S . Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Rob Herring , Linus Walleij , Nicolas Ferre , "Paul E . McKenney" Cc: Josef Friedl , Frank Wunderlich Subject: [PATCH v2 4/7] mfd: mt6323: some improvements of mt6397-core Date: Wed, 3 Jul 2019 18:48:19 +0200 Message-Id: <20190703164822.17924-5-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190703164822.17924-1-frank-w@public-files.de> References: <20190703164822.17924-1-frank-w@public-files.de> X-Provags-ID: V03:K1:kuKrBJnTtq4b2/NjZPE2sfV/tuwmiaGxoDx1uz7jDmUZFdXJVqu E4J9a9ArB0XhOnjqVPn9Cu6pWThn9Rc4Ycy9O/xTrDtTUbdjiP6n3jveMUnYXxd/LZoUaHC icVc9kVck5MVdwiejAlltqlLU4JXl/0y71LTFKNGIBY6HUo8mbA+IAYxC0dnEYrwYWuCT0G jeD99AauMluP8+kc1Xv8Q== X-UI-Out-Filterresults: notjunk:1;V03:K0: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34aUQRfIqnyrsUERQdU9Mm3g8ttDbgeJSdm20NHgT0FzXuZ6Qi5sPqikl0L6hVga FEsTdQsGIxFBs0= 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) - add mt6323 rtc+pwrc Signed-off-by: Frank Wunderlich --- drivers/mfd/mt6397-core.c | 40 ++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 337bcccdb914..a4abce00f156 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 @@ -15,24 +16,27 @@ #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[] = { - { - .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[] = { @@ -45,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" }, { @@ -57,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" }, };