Re: [PATCH v1 4/4] gpiolib: Reuse device's fwnode to create IRQ domain

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

 



On Wed, Mar 03, 2021 at 10:22:02AM +0100, Linus Walleij wrote:
> On Tue, Mar 2, 2021 at 4:35 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> 
> > When IRQ domain is created for an ACPI case, the name of it becomes unknown-%d
> > since for now it utilizes of_node member only and doesn't consider fwnode case.
> > Convert IRQ domain creation code to utilize fwnode instead.
> >
> > Before/After the change on Intel Galileo Gen 2 with two GPIO (IRQ) controllers:
> >
> >   unknown-1     ==>     \_SB.PCI0.GIP0.GPO
> >   unknown-2     ==>     \_SB.NIO3
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> 
> This first part seems to do what you want,

...

> But this:
> 
> > @@ -1504,15 +1497,14 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc,
> >                         return ret;
> >         } else {
> >                 /* Some drivers provide custom irqdomain ops */
> > -               if (gc->irq.domain_ops)
> > -                       ops = gc->irq.domain_ops;
> > -
> > -               if (!ops)
> > -                       ops = &gpiochip_domain_ops;
> > -               gc->irq.domain = irq_domain_add_simple(np,
> > -                       gc->ngpio,
> > -                       gc->irq.first,
> > -                       ops, gc);
> > +               ops = gc->irq.domain_ops ?: &gpiochip_domain_ops;
> > +               if (gc->irq.first)
> > +                       gc->irq.domain = irq_domain_create_legacy(fwnode, gc->ngpio,
> > +                                                                 gc->irq.first, 0,
> > +                                                                 ops, gc);
> > +               else
> > +                       gc->irq.domain = irq_domain_create_linear(fwnode, gc->ngpio,
> > +                                                                 ops, gc);
> 
> This looks like a refactoring and reimplementation of irq_domain_add_simple()?

If you named it as irq_domain_create_simple(), then yes, but the problem is
that we don't have irq_domain_create_simple() API right now.

> Why, and should it rather be a separate patch?

Nope.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux