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: <CR6A9IIIMSIY.G13N1XGBQG2M@burritosblues>
Date:   Tue, 14 Mar 2023 18:30:40 +0100
From:   "Esteban Blanc" <eblanc@...libre.com>
To:     "Linus Walleij" <linus.walleij@...aro.org>
Cc:     <lgirdwood@...il.com>, <broonie@...nel.org>,
        <a.zummo@...ertech.it>, <alexandre.belloni@...tlin.com>,
        <linux-kernel@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
        <linux-rtc@...r.kernel.org>, <jpanis@...libre.com>,
        <jneanne@...libre.com>
Subject: Re: [PATCH INTERNAL v1 2/3] pinctrl: tps6594: add for TPS6594 PMIC

Hi Linus,

On Mon Mar 6, 2023 at 3:10 PM CET, Linus Walleij wrote:
> On Fri, Feb 24, 2023 at 2:31 PM Esteban Blanc <eblanc@...libre.com> wrote:

> > TI TPS6594 PMIC has 11 GPIOs which can be used for different
> > functions
> >
> > This add a pinctrl and pinmux drivers in order to use those functions
> >
> > Signed-off-by: Esteban Blanc <eblanc@...libre.com>
>
> > +config PINCTRL_TPS6594
> > +       tristate "Pinctrl and GPIO driver for TI TPS6594 PMIC"
> > +       depends on MFD_TPS6594
>
> I would add:
>
> default MFD_TPS6594
>
> so you always get this as module or built in along with the MFD.
> Otherwise Kconfig gets complicated and tedious for users.

I did not know this, thanks. I will add this to V2.

(...)

> > +#define DEBUG
>
> Don't put this in production code.
>
> Look in drivers/pinctrl/Kconfig.
>
> config DEBUG_PINCTRL
>         bool "Debug PINCTRL calls"
>         depends on DEBUG_KERNEL
>         help
>           Say Y here to add some extra checks and diagnostics to PINCTRL calls.
>
> Look in drivers/pinctrl/Makefile:
>
> subdir-ccflags-$(CONFIG_DEBUG_PINCTRL)  += -DDEBUG
>
> Nifty eh? :D

Nifty indeed :D. #define DEBUG will be removed for V2, I should have
noticed it for V1...

> > +static const struct tps6594_pinctrl_function pinctrl_functions[] = {
> (...)
> > +       { "scl_i2c2-cs_spi", TPS6594_PINCTRL_SCL_I2C2_CS_SPI_FUNCTION,
> > +         (const char *[]){ "GPIO0", "GPIO1" }, 2 },
>
> Ow this is starting to look hairy.
>
> Is there some better way to get here?

I tried with a macro but I was not able to pass an array directly to
avoid both the cast and the hard coded length. I saw on other drivers
that I could generate the table dynamically but I'm not a huge fan of that
and I feel like it would look even more clunky...

>
> Other than this the code looks very nice.
>
> Yours,
> Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ