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]
Date:   Mon, 6 Mar 2023 15:10:26 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Esteban Blanc <eblanc@...libre.com>
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 Esteban,

thanks for your patch!

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.

> +       select PINMUX
> +       select GPIOLIB
> +       help
> +         This driver supports the GPIO for the TPS6594 PMICs.
> +         chip family.

(...)
> +#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

> +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?

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