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: <20220729091606.1205dcdf@md1za8fc.ad001.siemens.net>
Date:   Fri, 29 Jul 2022 09:16:06 +0200
From:   Henning Schild <henning.schild@...mens.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Linus Walleij <linus.walleij@...aro.org>,
        Tasanakorn Phaipool <tasanakorn@...il.com>,
        Sheng-Yuan Huang <syhuang3@...oton.com>,
        Pavel Machek <pavel@....cz>
Subject: Re: [PATCH 1/4] gpio-f7188x: Add GPIO support for Nuvoton NCT6116

Am Thu, 28 Jul 2022 23:33:36 +0200
schrieb Andy Shevchenko <andy.shevchenko@...il.com>:

> On Thu, Jul 28, 2022 at 5:57 PM Henning Schild
> <henning.schild@...mens.com> wrote:
> >
> > Add GPIO support for Nuvoton NCT6116 chip. Nuvoton SuperIO chips are
> > very similar to the ones from Fintek. In other subsystems they also
> > share drivers and are called a family of drivers.
> >
> > For the GPIO subsystem the only difference is that the direction
> > bit is reversed and that there is only one data bit per pin. On the
> > SuperIO level the logical device is another one.  
> 
> ...
> 
> > +#define SIO_GPIO_ENABLE                0x30    /* GPIO enable */  
> 
> I don't see how it's being utilized... (But okay, it might be good to
> have as a hint for a reader who has no access to the documentation).

Good catch. That is a leftover from code that turned out to be not
needed. Will drop.

> ...
> 
> > +       if (sio->device == SIO_LD_GPIO_NUVOTON) {  
> 
> Everywhere else you use `device == SIO_LD_GPIO_FINTEK`, perhaps here
> for consistency? However, I would rather see a field that clearly
> states that it's an inverted value. Then you can use
> 
>   if (sio->dir_inv)
>     ...do something...

Good idea, will look into that. Given we talk about a family of chips
there might be more vendor ids that should be mapped onto "inv" in the
future.

Henning

> > +               if (dir & BIT(offset))
> > +                       return GPIO_LINE_DIRECTION_IN;
> > +
> > +               return GPIO_LINE_DIRECTION_OUT;
> > +       }
> > +
> > +       if (dir & BIT(offset))
> >                 return GPIO_LINE_DIRECTION_OUT;
> >
> >         return GPIO_LINE_DIRECTION_IN;  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ