Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp4136900ybh; Tue, 17 Mar 2020 12:58:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vspm0IjRaAaXBj2lV2WXJbWyTry0WObwae0iTMgPPyVnSJQa/rkpBVduvRWPtS5nu4ugAJU X-Received: by 2002:a05:6830:118d:: with SMTP id u13mr794530otq.41.1584475120742; Tue, 17 Mar 2020 12:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584475120; cv=none; d=google.com; s=arc-20160816; b=V266XKWouI8k2eZhhOtYj24+ARlj3ksJhqcCPHqTX24T1YliCcxKxnlsLqvPbD0A05 6Z9HPsgpUyyJOU8I5gwZAA9YawO6Do5h9h/W2WzPTaidqmWxmg4MyY3/6QX3rfjWM0uy lM3LooFM6rIlejE/rhAtqaTauaGF5vX6cjCT9qhlBICWgkzguBGSUvshzamp09lRCo/h +tOc+YSxxbU0PkCnY5ha9mTOWepNX1h3xzcPXLdG6QDb8jH8tA3TGgxSf57vfkP7SO43 kiHzcNY/VP6yaHfRNQGkUt1GGsXo6NZffURx3U7g9vjGcbwtJfT2qbWMXwB1WjyrHKFg MJGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=l6tT22bx6aHz+MAGQbaHWYNOHqa+sDRynFmM7TluAjI=; b=0KHlWAEdeM7SojzDWCpwPV/430mBrqETBBnOTlMe351h/B/DwnBlmyEK5p/hzWOvFn iI0Rsw9QpzbREszCC4IBrSrUBdLxeSZTt72Ggyz+7Fm3a7i2pfWDeZ0H0w+6eOawut2H PgbwWzgrptVxY60M7RtIcII8WJJGMMUKyyONczHlmPl/OPv7OjOm3scE5VNo5y9B6fJN fDKV3grUpfMjxGgsQ2QLM9JLwc+X6Y6xUK6eqrHUZOtWDM8zaOQHJAhA/Jx0au4NNleP M+pvFAislGSeW4QHu4Y7b7NYYB4t92B2Dfg80v0Dbky+vQJd9wWeZmDiCvX3RGDphqA2 5dpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ErekzIio; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21si2303932otk.100.2020.03.17.12.58.27; Tue, 17 Mar 2020 12:58:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ErekzIio; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbgCQT6F (ORCPT + 99 others); Tue, 17 Mar 2020 15:58:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbgCQT6E (ORCPT ); Tue, 17 Mar 2020 15:58:04 -0400 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E51820753; Tue, 17 Mar 2020 19:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584475084; bh=4ktS7vkXbvWPqEkGLuhwSvTcermavdaiwrVzlyvDMTU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ErekzIionC/I7zFmUNqh7MxcljAySREdp8+XSrVaIt2HsegDI9CUw2Q9Ay+w0gLyW 6unmLPpaIgjirEHSIzlZ3SpkFSF/a26BjhaOk7/fNMrx1IW8zjF2uatw753SUDT8EN Q6W+2DCAe6qxa2Sggc+xveh3nGbdqzVHUNkvlC9g= Received: by mail-il1-f173.google.com with SMTP id p12so6714315ilm.7; Tue, 17 Mar 2020 12:58:04 -0700 (PDT) X-Gm-Message-State: ANhLgQ1M/FjSa47hg4/gTfzz43nNroPTohAYJv8y/u63lv+L+GF6P08d R6MrqQjkDJbdEx3raxqd2d6aWylF4auADMhLF4k= X-Received: by 2002:a92:4b0d:: with SMTP id m13mr514342ilg.43.1584475083400; Tue, 17 Mar 2020 12:58:03 -0700 (PDT) MIME-Version: 1.0 References: <1583825986-8189-1-git-send-email-light.hsieh@mediatek.com> <1583825986-8189-2-git-send-email-light.hsieh@mediatek.com> <1584437292.12211.9.camel@mtkswgap22> In-Reply-To: <1584437292.12211.9.camel@mtkswgap22> From: Sean Wang Date: Tue, 17 Mar 2020 12:57:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/2] pinctrl: make MediaTek pinctrl v2 driver ready for buidling loadable module To: Light Hsieh Cc: Linus Walleij , "moderated list:ARM/Mediatek SoC support" , "open list:GPIO SUBSYSTEM" , lkml , kuohong.wang@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Light On Tue, Mar 17, 2020 at 2:28 AM Light Hsieh wrote: > > On Sun, 2020-03-15 at 14:35 -0700, Sean Wang wrote: > > Hi, Light > > > > On Tue, Mar 10, 2020 at 12:39 AM wrote: > > > > > > From: Light Hsieh > > > > > > > Correct the prefix of the subject with "pinctrl: mediatek". > > > > > In the future we want to be able to build the MediaTek pinctrl driver, > > > based on paris, as kernel module. This patch allows pinctrl-paris.c, the > > > external interrupt controller mtk-eint.c, and pinctrl-mtk-common-v2.c to > > > be loadable as module. > > > > > > Signed-off-by: Light Hsieh > > > Reviewed-by: Matthias Brugger > > > --- > > > drivers/pinctrl/mediatek/Kconfig | 13 +++++++++++-- > > > drivers/pinctrl/mediatek/Makefile | 5 +++-- > > > drivers/pinctrl/mediatek/mtk-eint.c | 9 +++++++++ > > > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 24 ++++++++++++++++++++++++ > > > drivers/pinctrl/mediatek/pinctrl-paris.c | 6 ++++++ > > > drivers/pinctrl/pinconf-generic.c | 1 + > > > > Separate the patches for the device driver and for the core respectively. > > Since the patch for pinconf-generic.c had been done in b88d145191ad > ("pinctrl: Export some needed symbols at module load time"). > I will remove patch for pinconf-generic.c. > > > > 6 files changed, 54 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig > > > index 701f9af..4cd1109 100644 > > > --- a/drivers/pinctrl/mediatek/Kconfig > > > +++ b/drivers/pinctrl/mediatek/Kconfig > > > @@ -3,10 +3,12 @@ menu "MediaTek pinctrl drivers" > > > depends on ARCH_MEDIATEK || COMPILE_TEST > > > > > > config EINT_MTK > > > - bool "MediaTek External Interrupt Support" > > > + tristate "MediaTek External Interrupt Support" > > > depends on PINCTRL_MTK || PINCTRL_MTK_MOORE || PINCTRL_MTK_PARIS || COMPILE_TEST > > > select GPIOLIB > > > select IRQ_DOMAIN > > > + default y if PINCTRL_MTK || PINCTRL_MTK_MOORE > > > + default PINCTRL_MTK_PARIS > > > > > > config PINCTRL_MTK > > > bool > > > @@ -17,23 +19,30 @@ config PINCTRL_MTK > > > select EINT_MTK > > > select OF_GPIO > > > > > > +config PINCTRL_MTK_V2 > > > + tristate > > > + depends on PINCTRL_MTK_MOORE || PINCTRL_MTK_PARIS > > > > PINCTRL_MTK_V2 doesn't have to depend on PINCTRL_MTK_MOORE or > > PINCTRL_MTK_PARIS to work and it can build on it own so that lets us > > remove the dependency. > > > The usage of PINCTRL_MTK had been describe in cover letter: > > 1.4 PINCTRL_MTK_V2: add this tristate config which depends on > PINCTRL_MTK_PARIS and PINCTRL_MTK_MOORE. No need to specify in > defconfig file. > * PINCTRL_MTK_V2 will be y if either PINCTRL_MTK_PARIS or > PINCTRL_MTK_MOORE is y. > * PINCTRL_MTK_V2 will be n if both PINCTRL_MTK_PARIS and > PINCTRL_MTK_MOORE are n. > * PINCTRL_MTK_V2 will be m if PINCTRL_MTK_PARIS is m and > PINCTRL_MTK_MOORE is n. > > > Without PINCTRL_MTK_V2, we cannot specify whether > pinctrl-mtk-common-v2.c is built-in or loadable kernel module. > What I was actually meaning is config PINCTRL_MTK_V2 tristate with that should work for your case. > > > + > > > config PINCTRL_MTK_MOORE > > > bool > > > depends on OF > > > select GENERIC_PINCONF > > > select GENERIC_PINCTRL_GROUPS > > > select GENERIC_PINMUX_FUNCTIONS > > > + select EINT_MTK > > > > The original design of PINCTRL_MTK_MOORE doesn't have to work with > > EINT_MTK coupled tightly so that let us remove the reverse dependency. > > > > Actually, PINCTRL_MTK_MOORE use EINT_MTK in the following call flow: > mtk_moore_pinctrl_probe() -> mtk_build_eint() -> mtk_eint_do_init(). > mtk_eint_do_init() is defined in mtk-eint.c. CONFIG_EINT_MTK is actually an option to Moore pinctrl since Moore pinctrl has already carefully considered the condition with CONFIG_EINT_MTK=n in mtk_build_eint. > > > > select GPIOLIB > > > select OF_GPIO > > > + select PINCTRL_MTK_V2