Re: [PATCH v2 7/9] input: pf1550: add onkey support

Samuel Kayode
2025-05-21T21:00:33Z

On Fri, May 16, 2025 at 03:55:02PM -0700, Dmitry Torokhov wrote:
> > + input->name = pdev->name;
> > + input->phys = "pf1550-onkey/input0";
> > + input->id.bustype = BUS_HOST;
> > +
> > + input_set_capability(input, EV_KEY, onkey->keycode);
> > +
> > + for (i = 0; i < ARRAY_SIZE(pf1550_onkey_irqs); i++) {
> > + struct pf1550_irq_info *onkey_irq =
> > + &pf1550_onkey_irqs[i];
> > + unsigned int virq = 0;
> > +
> > + virq = regmap_irq_get_virq(pf1550->irq_data_onkey,
> > + onkey_irq->irq);
> > + if (!virq)
> > + return -EINVAL;
> > +
> > + onkey_irq->virq = virq;
>
> I think this kind of mapping needs to be done in the core part of your
> driver.
>
Without doing the mapping in the MFD children, a list of all virqs for the PMIC
would have to be maintained in addition to the (regmap_irq) irqs. Perhaps,
there is a better way to implement this?
> > +
> > + error = devm_request_threaded_irq(&pdev->dev, virq, NULL,
> > + pf1550_onkey_irq_handler,
> > + IRQF_NO_SUSPEND,
> > + onkey_irq->name, onkey);
Thanks,
Sam