linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Wang <sean.wang@kernel.org>
To: Light Hsieh <light.hsieh@mediatek.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	kuohong.wang@mediatek.com
Subject: Re: [PATCH v4 1/2] pinctrl: make MediaTek pinctrl v2 driver ready for buidling loadable module
Date: Tue, 17 Mar 2020 12:57:52 -0700	[thread overview]
Message-ID: <CAGp9LzoQoWyrMSYQaqH=OL9iCeakBvosZO5T3c757x3pBwwMJw@mail.gmail.com> (raw)
In-Reply-To: <1584437292.12211.9.camel@mtkswgap22>

Hi, Light

On Tue, Mar 17, 2020 at 2:28 AM Light Hsieh <light.hsieh@mediatek.com> wrote:
>
> On Sun, 2020-03-15 at 14:35 -0700, Sean Wang wrote:
> > Hi, Light
> >
> > On Tue, Mar 10, 2020 at 12:39 AM <light.hsieh@mediatek.com> wrote:
> > >
> > > From: Light Hsieh <light.hsieh@mediatek.com>
> > >
> >
> > 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 <light.hsieh@mediatek.com>
> > > Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> > > ---
> > >  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

  reply	other threads:[~2020-03-17 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10  7:39 [PATCH v4 0/2] pinctrl: make MediaTek pinctrl v2 driver and MT6765 pinctrl driver ready for building loadable module light.hsieh
2020-03-10  7:39 ` [PATCH v4 1/2] pinctrl: make MediaTek pinctrl v2 driver ready for buidling " light.hsieh
2020-03-15 21:35   ` Sean Wang
2020-03-17  9:28     ` Light Hsieh
2020-03-17 19:57       ` Sean Wang [this message]
2020-03-10  7:39 ` [PATCH v4 2/2] pinctrl: make MediaTek MT6765 pinctrl " light.hsieh
2020-03-15 21:15   ` Sean Wang
2020-03-17  9:28     ` Light Hsieh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGp9LzoQoWyrMSYQaqH=OL9iCeakBvosZO5T3c757x3pBwwMJw@mail.gmail.com' \
    --to=sean.wang@kernel.org \
    --cc=kuohong.wang@mediatek.com \
    --cc=light.hsieh@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).