[Letux-kernel] [PATCH v2 2/5] mfd: rn5t618: add irq support

Andreas Kemnade andreas at kemnade.info
Wed Nov 20 09:13:39 CET 2019


On Wed, 20 Nov 2019 08:54:44 +0100
Pierre-Hugues Husson <phh at phh.me> 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


More information about the Letux-kernel mailing list