lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181026071744.GH4870@dell>
Date:   Fri, 26 Oct 2018 08:17:44 +0100
From:   Lee Jones <lee.jones@...aro.org>
To:     Benjamin Gaignard <benjamin.gaignard@...aro.org>
Cc:     pascal paillet <p.paillet@...com>, dmitry.torokhov@...il.com,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, wim@...ux-watchdog.org,
        Guenter Roeck <linux@...ck-us.net>,
        linux-input@...r.kernel.org, devicetree@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-watchdog@...r.kernel.org, eballetbo@...il.com
Subject: Re: [PATCH v4 2/8] mfd: stpmic1: add stpmic1 driver

On Thu, 25 Oct 2018, Benjamin Gaignard wrote:

> Le jeu. 25 oct. 2018 à 13:21, Lee Jones <lee.jones@...aro.org> a écrit :
> >
> > On Thu, 18 Oct 2018, Pascal PAILLET-LME wrote:
> >
> > > From: pascal paillet <p.paillet@...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@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ