lkml.org 
[lkml]   [2023]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 3/3] gpio: nuvoton: Add Nuvoton NPCM sgpio driver
On Thu, Dec 21, 2023 at 02:27:13PM +0800, Jim Liu wrote:

...

> > > + in_port = GPIO_BANK(gpio->nin_sgpio);
> > > + if (GPIO_BIT(gpio->nin_sgpio) > 0)
> > > + in_port += 1;
> >
> > This is strange... So, you are telling that offsets start from 1 and not 0?
> >
> > > + out_port = GPIO_BANK(gpio->nout_sgpio);
> > > + if (GPIO_BIT(gpio->nout_sgpio) > 0)
> > > + out_port += 1;
> >
> > Ditto.
> >
> Yes, if the customer has defined the in/out pins the offsets start from 1.

Why?

> The NPCM_IOXCFG2_PORT register is the set number of in/out ports.
> NPCM_IOXCFG2_PORT register define as below:
> 0~3 bit is the number of input ports
> 4~7 bit is the number of output ports
> Each module can support 8 input ports and 8 output ports.

Right, this doesn't answer why.

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2023-12-21 17:29    [W:0.042 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site