Re: [PATCH] gpio: tqmx86: Add GPIO driver for this IO controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 9, 2018 at 9:54 PM Andrew Lunn <andrew@xxxxxxx> wrote:
> On Sun, Dec 09, 2018 at 12:01:52PM +0100, Linus Walleij wrote:
> > Hi Andrew! Thanks for your patch!
> >
> > On Sat, Dec 8, 2018 at 5:18 PM Andrew Lunn <andrew@xxxxxxx> wrote:
> >
> > > Some TQ-Systems ComExpress modules contain an IO controller with 8
> > > GPIO lines.
> > >
> > > Signed-off-by: Andrew Lunn <andrew@xxxxxxx>
> >
> > > +config GPIO_TQMX86
> > > +       tristate "TQ-Systems QTMX86 GPIO"
> > > +       depends on MFD_TQMX86
> > > +       select GENERIC_IRQ_CHIP
> >
> > I'd say probably remove that and add:
> >
> > select GPIO_GENERIC
>
> Hi Linus
>
> I've been looking at the generic code. As far as i can see, it does
> not work for this device. I see two problems:
>
> 1) This is not a mmio device, it is an ioport device. None of the
>    accessors available in bgpio_setup_accessors() will work.
>
> 2) There does not appear to support the concept of some pins being GPO
>    and some being GPI.
>
> If the problem was just 1), i could probably add the needed accessors,
> and add a new flag, to indicate ioport, not mmio. But handling the mix
> of GPI and GPO does not look too easy.
>
> Do you agree?

Hm how typical, I see. I wanted to add port-mapped I/O to the
gpio-mmio driver for some time but in this case it might not
be worth it. I was confused because gpio-mmio uses
some ioread/iowrite accessors which I guess simply
translates into inb/outb on intel but readb/writeb on other
architectures.

I guess keep with the custom code.

It'd be great if you could use GPIOLIB_IRQCHIP
with a .valid_mask masking off the out-only GPIOs though,
the centralized IRQ code is pretty helpful.

Yours,
Linus Walleij



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux