Re: [PATCH v2 2/5] mfd: rn5t618: add irq support

From: Andreas Kemnade
Date: Wed Nov 20 2019 - 03:13:51 EST


On Wed, 20 Nov 2019 08:54:44 +0100
Pierre-Hugues Husson <phh@xxxxxx> wrote:

[...]
> >
> > +static int __maybe_unused rn5t618_i2c_suspend(struct device *dev)
> > +{
> > + struct rn5t618 *priv = dev_get_drvdata(dev);
> > +
> > + if (priv->chip_irq)
> > + disable_irq(priv->chip_irq);
> > +
> > + return 0;
> > +}
> > +
> > +static int __maybe_unused rn5t618_i2c_resume(struct device *dev)
> > +{
> > + struct rn5t618 *priv = dev_get_drvdata(dev);
> > +
> > + if (priv->chip_irq)
> > + enable_irq(priv->chip_irq);
> > +
> > + return 0;
> > +}
>
> For what it's worth, the boards I have (Archos 101 Oxygen and Pipo P9)
> with rc5t619 use GPIO for power button.
> So IRQ would need to be enabled in suspend for this to work.
> Also, since you actually added alarm support, perhaps you want to
> wake-up from suspend using alarm as well?
>
Already tested that, that works, because device_init_wakeup() is used.
disable_irq() is needed because we cannot do i2c that early after resume.
Other mfd drivers do thas as well and waking up works.

Regards,
Andreas