On Tue, Apr 23, 2024 at 7:32 PM Marek Behún <kabel@xxxxxxxxxx> wrote: > On Tue, 23 Apr 2024 18:58:19 +0300 > Andy Shevchenko <andy@xxxxxxxxxx> wrote: > > On Thu, Apr 18, 2024 at 02:11:12PM +0200, Marek Behún wrote: ... > > > + irq_idx = omnia_int_to_gpio_idx[__bf_shf(INT_TRNG)]; > > > + irq = devm_irq_create_mapping(dev, mcu->gc.irq.domain, irq_idx); > > > + if (irq < 0) > > > + return dev_err_probe(dev, irq, "Cannot map TRNG IRQ\n"); > > > > This looks like some workaround against existing gpiod_to_irq(). Why do you > > need this? > > Hmmm, I thought that would not work because that line is only valid > as an IRQ, not as a GPIO (this is enforced via the valid_mask member of > gpio_chip and gpio_irq_chip). > > But looking at the code of gpiolib, if I do > irq = gpiod_to_irq(gpiochip_get_desc(gc, irq_idx)); > the valid_mask is not enforced anywhere. Which one? GPIO has two: one per GPIO realm and one for IRQ domain. > Is this semantically right to do even in spite of the fact that the > line is not a valid GPIO line? Yes. It's orthogonal to that. -- With Best Regards, Andy Shevchenko