From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Sean Nyekjaer <sean@geanix.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 2/2] iio: accel: fxls8962af: add wake on event
Date: Wed, 18 Aug 2021 13:18:46 +0300 [thread overview]
Message-ID: <CAHp75VfymQu1dP6ku027B0psAHzWcfPcaGmJjJukCrafw91ihg@mail.gmail.com> (raw)
In-Reply-To: <20210818092741.2114155-2-sean@geanix.com>
On Wed, Aug 18, 2021 at 12:29 PM Sean Nyekjaer <sean@geanix.com> 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
next prev parent reply other threads:[~2021-08-18 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 9:27 [PATCH 1/2] iio: accel: fxls8962af: add threshold event handling Sean Nyekjaer
2021-08-18 9:27 ` [PATCH 2/2] iio: accel: fxls8962af: add wake on event Sean Nyekjaer
2021-08-18 10:18 ` Andy Shevchenko [this message]
2021-08-19 6:53 ` Sean Nyekjaer
2021-08-18 10:09 ` [PATCH 1/2] iio: accel: fxls8962af: add threshold event handling Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHp75VfymQu1dP6ku027B0psAHzWcfPcaGmJjJukCrafw91ihg@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=sean@geanix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).