All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Irina Tirdea <irina.tirdea@intel.com>, linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Octavian Purdila <octavian.purdila@intel.com>,
	Markus Pargmann <mpa@pengutronix.de>,
	Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Subject: Re: [PATCH 1/6] iio: accel: bmc150: use available_scan_masks
Date: Mon, 28 Mar 2016 10:51:20 +0100	[thread overview]
Message-ID: <56F8FE98.8000203@kernel.org> (raw)
In-Reply-To: <1458811771-25217-2-git-send-email-irina.tirdea@intel.com>

On 24/03/16 09:29, Irina Tirdea wrote:
> Use available_scan_masks to allow the iio core to select
> the data to send to userspace depending on which axes are
> enabled, instead of doing this in the driver's interrupt
> handler.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Applied to the togreg branch of iio.git.

Thanks,
> ---
>  drivers/iio/accel/bmc150-accel-core.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
> index c73331f7..cc52366 100644
> --- a/drivers/iio/accel/bmc150-accel-core.c
> +++ b/drivers/iio/accel/bmc150-accel-core.c
> @@ -138,6 +138,7 @@ enum bmc150_accel_axis {
>  	AXIS_X,
>  	AXIS_Y,
>  	AXIS_Z,
> +	AXIS_MAX,
>  };
>  
>  enum bmc150_power_modes {
> @@ -1104,6 +1105,10 @@ static const struct iio_info bmc150_accel_info_fifo = {
>  	.driver_module		= THIS_MODULE,
>  };
>  
> +static const unsigned long bmc150_accel_scan_masks[] = {
> +					BIT(AXIS_X) | BIT(AXIS_Y) | BIT(AXIS_Z),
> +					0};
> +
>  static irqreturn_t bmc150_accel_trigger_handler(int irq, void *p)
>  {
>  	struct iio_poll_func *pf = p;
> @@ -1113,8 +1118,7 @@ static irqreturn_t bmc150_accel_trigger_handler(int irq, void *p)
>  	unsigned int raw_val;
>  
>  	mutex_lock(&data->mutex);
> -	for_each_set_bit(bit, indio_dev->active_scan_mask,
> -			 indio_dev->masklength) {
> +	for (bit = 0; bit < AXIS_MAX; bit++) {
>  		ret = regmap_bulk_read(data->regmap,
>  				       BMC150_ACCEL_AXIS_TO_REG(bit), &raw_val,
>  				       2);
> @@ -1574,6 +1578,7 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
>  	indio_dev->channels = data->chip_info->channels;
>  	indio_dev->num_channels = data->chip_info->num_channels;
>  	indio_dev->name = name ? name : data->chip_info->name;
> +	indio_dev->available_scan_masks = bmc150_accel_scan_masks;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->info = &bmc150_accel_info;
>  
> 


  reply	other threads:[~2016-03-28  9:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24  9:29 [PATCH 0/6] Driver optimizations in trigger handler Irina Tirdea
2016-03-24  9:29 ` [PATCH 1/6] iio: accel: bmc150: use available_scan_masks Irina Tirdea
2016-03-28  9:51   ` Jonathan Cameron [this message]
2016-03-24  9:29 ` [PATCH 2/6] iio: accel: bmc150: optimize transfers in trigger handler Irina Tirdea
2016-03-28  9:53   ` Jonathan Cameron
2016-03-24  9:29 ` [PATCH 3/6] iio: gyro: bmg160: use available_scan_masks Irina Tirdea
2016-03-28  9:54   ` Jonathan Cameron
2016-03-24  9:29 ` [PATCH 4/6] iio: accel: bmg160: optimize transfers in trigger handler Irina Tirdea
2016-03-28  9:57   ` Jonathan Cameron
2016-03-28 10:09     ` Peter Meerwald-Stadler
2016-03-28 14:14       ` Jonathan Cameron
2016-03-28 16:03         ` Tirdea, Irina
2016-03-28 16:10           ` Jonathan Cameron
2016-03-28 16:05       ` Tirdea, Irina
2016-03-28 16:05         ` Tirdea, Irina
2016-03-24  9:29 ` [PATCH 5/6] iio: accel: kxcjk-1013: use available_scan_masks Irina Tirdea
2016-03-28  9:58   ` Jonathan Cameron
2016-03-24  9:29 ` [PATCH 6/6] iio: accel: kxcjk-1013: optimize i2c transfers in trigger handler Irina Tirdea
2016-03-28  9:59   ` 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=56F8FE98.8000203@kernel.org \
    --to=jic23@kernel.org \
    --cc=irina.tirdea@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    --cc=octavian.purdila@intel.com \
    --cc=pmeerw@pmeerw.net \
    --cc=srinivas.pandruvada@intel.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 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.