Re: [PATCH] i2c: allow specifying separate wakeup interrupt in device tree

From: Wolfram Sang
Date: Mon Aug 10 2015 - 02:16:42 EST



> > I think it is a useful addition. Can someone add a paragraph describing
> > this handling on top of the new generic i2c binding docs?
> >
> > http://patchwork.ozlabs.org/patch/505368/
>
> Yes, I will.

Great, thanks!

>
> >
> > > @@ -659,20 +662,47 @@ static int i2c_device_probe(struct device *dev)
> > > if (!device_can_wakeup(&client->dev))
> > > device_init_wakeup(&client->dev,
> > > client->flags & I2C_CLIENT_WAKE);
> >
> > I was about to ask if we couldn't combine this and the later if-blocks
> > with an if-else combination. But now I stumble over the above block in
> > general: If the device cannot cause wake ups, then we might initialize
> > it as a wakeup-device depending on client->flags??
>
> I believe it is done so that we do not try to re-add wakeup source after
> unbinding/rebinding the device. With my patch we clearing wakeup flag on
> unbind, so it is OK, but there is still error path where we might want
> to reset the wakeup flag as well.

I was wondering if it wants to achieve that, why does it not
unconditionally use 0 instead of the WAKE flag.

Attachment: signature.asc
Description: Digital signature