On Wed, Aug 18, 2021 at 12:29 PM Sean Nyekjaer <sean@xxxxxxxxxx> wrote: > > This add ways for the SoC to wake from accelerometer wake events. adds > In the suspend function we skip disabling the sensor if wakeup-source > and events are activated. > If the buffer is enabled it will be deactivated before suspend, as the > buffer is quite small. "..., because it is..." Or what are you saying here? ... > + if (dev_fwnode(dev) && device_property_read_bool(dev, "wakeup-source")) dev_fwnode() is redundant. > + device_init_wakeup(dev, true); ... > +static int __maybe_unused fxls8962af_suspend(struct device *dev) > +{ > + struct iio_dev *indio_dev = dev_get_drvdata(dev); > + struct fxls8962af_data *data = iio_priv(indio_dev); > + > + One blank line is enough. > + if (device_may_wakeup(dev) && data->enable_event) { > + enable_irq_wake(data->irq); > + > + /* > + * Disable buffer, as the buffer is so small the device will wake > + * almost immediately. > + */ > + if (iio_buffer_enabled(indio_dev)) > + fxls8962af_buffer_predisable(indio_dev); > + } else { > + fxls8962af_runtime_suspend(dev); > + } > + > + return 0; > +} -- With Best Regards, Andy Shevchenko