lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 07/10] drivers: pinctrl: msm: setup GPIO irqchip hierarchy
On Wed, Apr 17, 2019 at 6:08 PM Lina Iyer <ilina@codeaurora.org> wrote:

> I am thinking of something like this. Would there be any issue in
> setting the type to IRQ_TYPE_SENSE_MASK instead of any one particular
> type?
>
> ---8<-----
> static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
> {
> #ifdef CONFIG_OF_GPIO
> struct irq_fwspec fwspec;
>
> if (chip->of_node) {
> fwspec.fwnode = of_node_to_fwnode(chip->of_node);
> fwspec.param[0] = offset;
> fwspec.param[1] = IRQ_TYPE_SENSE_MASK;
> fwspec.param_count = 2;
> return irq_create_fwspec_mapping(&fwspec);
> }
> #endif
>
> if (!gpiochip_irqchip_irq_valid(chip, offset))
> return -ENXIO;
>
> return irq_create_mapping(chip->irq.domain, offset);

Isn't the real problem that irq_create_mapping() isn't already doing this
for you?

chip->irq.domain is created with irq_domain_add_simple() and after
Thierrys patch with irq_domain_add_hierarchy(), so I think it is simply
that the hierarchical irqdomain helper code needs to go deeper here.

gpiolib needs struct irq_domain_ops for the hierarchical irqdomain
which implements generic versions of .translate(), .alloc() and .free().
I am working on this... albeit slowly :/

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2019-04-17 19:38    [W:0.086 / U:6.028 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site