linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: pascal paillet <p.paillet@st.com>,
	dmitry.torokhov@gmail.com, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	wim@linux-watchdog.org, Guenter Roeck <linux@roeck-us.net>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-watchdog@vger.kernel.org, eballetbo@gmail.com
Subject: Re: [PATCH v4 2/8] mfd: stpmic1: add stpmic1 driver
Date: Fri, 26 Oct 2018 08:17:44 +0100	[thread overview]
Message-ID: <20181026071744.GH4870@dell> (raw)
In-Reply-To: <CA+M3ks6s=mhLr0Hzcym_vmPVKjsuk8AFnQQe0qj-doVaXo9VcA@mail.gmail.com>

On Thu, 25 Oct 2018, Benjamin Gaignard wrote:

> Le jeu. 25 oct. 2018 à 13:21, Lee Jones <lee.jones@linaro.org> a écrit :
> >
> > On Thu, 18 Oct 2018, Pascal PAILLET-LME wrote:
> >
> > > From: pascal paillet <p.paillet@st.com>
> > >
> > > stpmic1 is a pmic from STMicroelectronics. The STPMIC1 integrates 10
> > > regulators , 3 switches, a watchdog and an input for a power on key.
> >
> > Same comments as for the DT binding patch.
> >
> > > Signed-off-by: pascal paillet <p.paillet@st.com>
> > > ---
> > > changes in v4:
> > > * rename PONKEY_PU_ACTIVE to PONKEY_PU_INACTIVE
> > >
> > >  drivers/mfd/Kconfig         |  13 ++
> > >  drivers/mfd/Makefile        |   1 +
> > >  drivers/mfd/stpmic1.c       | 401 ++++++++++++++++++++++++++++++++++++++++++++
> > >  include/linux/mfd/stpmic1.h | 212 +++++++++++++++++++++++
> > >  4 files changed, 627 insertions(+)
> > >  create mode 100644 drivers/mfd/stpmic1.c
> > >  create mode 100644 include/linux/mfd/stpmic1.h

[...]

> > > +static const struct regmap_irq stpmic1_irqs[] = {
> > > +     [IT_PONKEY_F]           = { .mask = 0x01 },
> > > +     [IT_PONKEY_R]           = { .mask = 0x02 },
> > > +     [IT_WAKEUP_F]           = { .mask = 0x04 },
> > > +     [IT_WAKEUP_R]           = { .mask = 0x08 },
> > > +     [IT_VBUS_OTG_F]         = { .mask = 0x10 },
> > > +     [IT_VBUS_OTG_R]         = { .mask = 0x20 },
> > > +     [IT_SWOUT_F]            = { .mask = 0x40 },
> > > +     [IT_SWOUT_R]            = { .mask = 0x80 },
> > > +
> > > +     [IT_CURLIM_BUCK1]       = { .reg_offset = 1, .mask = 0x01 },
> > > +     [IT_CURLIM_BUCK2]       = { .reg_offset = 1, .mask = 0x02 },
> > > +     [IT_CURLIM_BUCK3]       = { .reg_offset = 1, .mask = 0x04 },
> > > +     [IT_CURLIM_BUCK4]       = { .reg_offset = 1, .mask = 0x08 },
> > > +     [IT_OCP_OTG]            = { .reg_offset = 1, .mask = 0x10 },
> > > +     [IT_OCP_SWOUT]          = { .reg_offset = 1, .mask = 0x20 },
> > > +     [IT_OCP_BOOST]          = { .reg_offset = 1, .mask = 0x40 },
> > > +     [IT_OVP_BOOST]          = { .reg_offset = 1, .mask = 0x80 },
> > > +
> > > +     [IT_CURLIM_LDO1]        = { .reg_offset = 2, .mask = 0x01 },
> > > +     [IT_CURLIM_LDO2]        = { .reg_offset = 2, .mask = 0x02 },
> > > +     [IT_CURLIM_LDO3]        = { .reg_offset = 2, .mask = 0x04 },
> > > +     [IT_CURLIM_LDO4]        = { .reg_offset = 2, .mask = 0x08 },
> > > +     [IT_CURLIM_LDO5]        = { .reg_offset = 2, .mask = 0x10 },
> > > +     [IT_CURLIM_LDO6]        = { .reg_offset = 2, .mask = 0x20 },
> > > +     [IT_SHORT_SWOTG]        = { .reg_offset = 2, .mask = 0x40 },
> > > +     [IT_SHORT_SWOUT]        = { .reg_offset = 2, .mask = 0x80 },
> > > +
> > > +     [IT_TWARN_F]            = { .reg_offset = 3, .mask = 0x01 },
> > > +     [IT_TWARN_R]            = { .reg_offset = 3, .mask = 0x02 },
> > > +     [IT_VINLOW_F]           = { .reg_offset = 3, .mask = 0x04 },
> > > +     [IT_VINLOW_R]           = { .reg_offset = 3, .mask = 0x08 },
> > > +     [IT_SWIN_F]             = { .reg_offset = 3, .mask = 0x40 },
> > > +     [IT_SWIN_R]             = { .reg_offset = 3, .mask = 0x80 },
> > > +};
> >
> > There should be a MACRO for doing this.
> >
> > If there isn't, you should author one and put it in the Regmap header.

> I don't understand why you want to put this MACRO in regmap header.

REGMAP_IRQ_REG()

> Offsets and masks are custom from this hardware block.
> How can this become generic enough to be put in regmap ?

When replying to only a small section of driver/review like this,
would you mind trimming any unrelated quoting (as I have now done),
please?

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2018-10-26 15:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  9:02 [PATCH v4 0/8] Introduce STPMIC1 PMIC Driver Pascal PAILLET-LME
2018-10-18  9:02 ` [PATCH v4 2/8] mfd: stpmic1: add stpmic1 driver Pascal PAILLET-LME
2018-10-25 11:21   ` Lee Jones
2018-10-25 12:40     ` Benjamin Gaignard
2018-10-26  7:17       ` Lee Jones [this message]
2018-10-18  9:02 ` [PATCH v4 1/8] dt-bindings: mfd: document stpmic1 Pascal PAILLET-LME
2018-10-18 18:47   ` Rob Herring
2018-10-25  9:44   ` Lee Jones
2018-10-25 12:57     ` Rob Herring
2018-10-26  6:46       ` Lee Jones
2018-10-26  9:48         ` Pascal PAILLET-LME
2018-10-26 11:46           ` Lee Jones
2018-10-18  9:02 ` [PATCH v4 3/8] dt-bindings: regulator: document stpmic1 pmic regulators Pascal PAILLET-LME
2018-10-18  9:02 ` [PATCH v4 4/8] regulator: stpmic1: add stpmic1 regulator driver Pascal PAILLET-LME
2018-10-19 11:50   ` Mark Brown
2018-10-24 12:54     ` Pascal PAILLET-LME
2018-10-24 13:17       ` Mark Brown
2018-10-25 13:23         ` Pascal PAILLET-LME
2018-10-26 20:33           ` Mark Brown
2018-10-18  9:02 ` [PATCH v4 6/8] input: stpmic1: add stpmic1 onkey driver Pascal PAILLET-LME
2018-10-18 18:12   ` dmitry.torokhov
2018-10-18  9:02 ` [PATCH v4 7/8] dt-bindings: watchdog: document stpmic1 pmic watchdog Pascal PAILLET-LME
2018-10-18  9:02 ` [PATCH v4 5/8] dt-bindings: input: document stpmic1 pmic onkey Pascal PAILLET-LME
2018-10-18  9:02 ` [PATCH v4 8/8] watchdog: stpmic1: add stpmic1 watchdog driver Pascal PAILLET-LME
2018-10-18 13:34   ` Guenter Roeck

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=20181026071744.GH4870@dell \
    --to=lee.jones@linaro.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eballetbo@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=p.paillet@st.com \
    --cc=robh+dt@kernel.org \
    --cc=wim@linux-watchdog.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).