lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/4] gpio-f7188x: Add GPIO support for Nuvoton NCT6116
On Thu, Jul 28, 2022 at 5:57 PM Henning Schild
<henning.schild@siemens.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).

...

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

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

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-07-28 23:35    [W:0.098 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site