linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Sean Nyekjaer <sean@geanix.com>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org,
	lorenzo.bianconi83@gmail.com, martin@geanix.com
Subject: Re: [PATCH v2 4/6] iio: imu: st_lsm6dsx: add wakeup-source option
Date: Tue, 16 Jul 2019 10:04:53 +0200	[thread overview]
Message-ID: <20190716080453.GA13440@localhost.localdomain> (raw)
In-Reply-To: <20190715081514.81129-4-sean@geanix.com>

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

> This add ways for the SoC to wake from accelerometer wake events.
> 
> In the suspend function we skip disabling the sensor if wakeup-source
> and events are activated.
> 

[...]

>  EXPORT_SYMBOL(st_lsm6dsx_probe);
> @@ -1372,6 +1376,12 @@ static int __maybe_unused st_lsm6dsx_suspend(struct device *dev)
>  		if (!hw->iio_devs[i])
>  			continue;
>  
> +		if (device_may_wakeup(dev) && (i == ST_LSM6DSX_ID_ACC)) {

unnecessary brackets

> +			/* Enable wake from IRQ */
> +			enable_irq_wake(hw->irq);
> +			continue;
> +		}

I think we need to move this after enable_mask check, dont' we?

> +
>  		sensor = iio_priv(hw->iio_devs[i]);
>  		if (!(hw->enable_mask & BIT(sensor->id)))
>  			continue;
> @@ -1404,6 +1414,11 @@ static int __maybe_unused st_lsm6dsx_resume(struct device *dev)
>  		if (!hw->iio_devs[i])
>  			continue;
>  
> +		if (device_may_wakeup(dev) && (i == ST_LSM6DSX_ID_ACC)) {

unnecessary brackets

> +			disable_irq_wake(hw->irq);
> +			continue;
> +		}
> +
>  		sensor = iio_priv(hw->iio_devs[i]);
>  		if (!(hw->suspend_mask & BIT(sensor->id)))
>  			continue;
> -- 
> 2.22.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2019-07-16  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15  8:15 [PATCH v2 1/6] iio: imu: st_lsm6dsx: move interrupt thread to core Sean Nyekjaer
2019-07-15  8:15 ` [PATCH v2 2/6] iio: imu: st_lsm6dsx: save drdy_pin in device struct Sean Nyekjaer
2019-07-15  8:15 ` [PATCH v2 3/6] iio: imu: st_lsm6dsx: add motion events Sean Nyekjaer
2019-07-16  8:29   ` Lorenzo Bianconi
2019-07-27 21:11     ` Jonathan Cameron
2019-08-09 11:05     ` Sean Nyekjaer
2019-08-21 11:11     ` Sean Nyekjaer
2019-07-15  8:15 ` [PATCH v2 4/6] iio: imu: st_lsm6dsx: add wakeup-source option Sean Nyekjaer
2019-07-16  8:04   ` Lorenzo Bianconi [this message]
2019-07-15  8:15 ` [PATCH v2 5/6] iio: imu: st_lsm6dsx: always enter interrupt thread Sean Nyekjaer
2019-07-16  6:14   ` Lorenzo Bianconi
2019-07-15  8:15 ` [PATCH v2 6/6] iio: imu: st_lsm6dsx: add motion report function and call from interrupt Sean Nyekjaer
2019-07-16  6:11   ` Lorenzo Bianconi
2019-07-16  5:57 ` [PATCH v2 1/6] iio: imu: st_lsm6dsx: move interrupt thread to core Lorenzo Bianconi

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=20190716080453.GA13440@localhost.localdomain \
    --to=lorenzo@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=martin@geanix.com \
    --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).