All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, Denis CIOCCA <denis.ciocca@st.com>
Cc: Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 02/10] iio: st_sensors: make interrupt optional
Date: Mon, 04 May 2015 17:20:59 +0100	[thread overview]
Message-ID: <55479C6B.1090205@kernel.org> (raw)
In-Reply-To: <1430399755-26475-2-git-send-email-linus.walleij@linaro.org>

On 30/04/15 14:15, Linus Walleij wrote:
> Some sensors such as magnetometers and pressure sensors doesn't
> have interrupts at all, and thus no DRDY setting applies. Make
> the assignment of an interrupt optional, and do not call
> st_sensors_set_drdy_int_pin() if there is no drdy (data ready)
> pin specified.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Applied to the togreg branch of iio.git.

thanks,

Jonathan
> ---
>  drivers/iio/common/st_sensors/st_sensors_core.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index edd13d2b4121..5a01093b29a2 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -245,6 +245,16 @@ static int st_sensors_set_drdy_int_pin(struct iio_dev *indio_dev,
>  {
>  	struct st_sensor_data *sdata = iio_priv(indio_dev);
>  
> +	/* Sensor does not support interrupts */
> +	if (sdata->sensor_settings->drdy_irq.addr == 0) {
> +		if (pdata->drdy_int_pin)
> +			dev_info(&indio_dev->dev,
> +				 "DRDY on pin INT%d specified, but sensor "
> +				 "does not support interrupts\n",
> +				 pdata->drdy_int_pin);
> +		return 0;
> +	}
> +
>  	switch (pdata->drdy_int_pin) {
>  	case 1:
>  		if (sdata->sensor_settings->drdy_irq.mask_int1 == 0) {
> @@ -285,7 +295,7 @@ static struct st_sensors_platform_data *st_sensors_of_probe(struct device *dev,
>  	if (!of_property_read_u32(np, "st,drdy-int-pin", &val) && (val <= 2))
>  		pdata->drdy_int_pin = (u8) val;
>  	else
> -		pdata->drdy_int_pin = defdata ? defdata->drdy_int_pin : 1;
> +		pdata->drdy_int_pin = defdata ? defdata->drdy_int_pin : 0;
>  
>  	return pdata;
>  }
> 


  reply	other threads:[~2015-05-04 16:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 13:15 [PATCH 01/10] iio: st_sensors: print error when failing to get IRQ Linus Walleij
2015-04-30 13:15 ` [PATCH 02/10] iio: st_sensors: make interrupt optional Linus Walleij
2015-05-04 16:20   ` Jonathan Cameron [this message]
2015-04-30 13:15 ` [PATCH 04/10] iio: st_sensors: make detection more helpful Linus Walleij
2015-05-04 16:24   ` Jonathan Cameron
2015-04-30 13:15 ` [PATCH 05/10] iio: magnetometer: support for lsm303dlh Linus Walleij
2015-05-04 16:26   ` Jonathan Cameron
2015-04-30 13:15 ` [PATCH 06/10] iio: st_accel: support 8bit channel data Linus Walleij
2015-04-30 14:56   ` Peter Meerwald
2015-05-04 12:11     ` Linus Walleij
2015-05-04 16:39       ` Jonathan Cameron
2015-05-05 12:22         ` Linus Walleij
2015-05-05 12:41           ` Linus Walleij
2015-04-30 13:15 ` [PATCH 07/10] iio: st_accel: support the LIS331DL sensor Linus Walleij
2015-04-30 13:15 ` [PATCH 08/10] ARM: ux500: fix lsm303dlh magnetometer compat string Linus Walleij
2015-05-04 16:33   ` Jonathan Cameron
2015-04-30 13:15 ` [PATCH 09/10] ARM: ux500: assign the sensor trigger IRQs Linus Walleij
2015-04-30 13:15 ` [PATCH 10/10] ARM: ux500: add the sensors to the STUIB board Linus Walleij
2015-05-04 16:17 ` [PATCH 01/10] iio: st_sensors: print error when failing to get IRQ Jonathan Cameron

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=55479C6B.1090205@kernel.org \
    --to=jic23@kernel.org \
    --cc=denis.ciocca@st.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.