All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, Michael.Hennerich@analog.com,
	manuel.stahl@iis.fraunhofer.de,
	Jonathan Cameron <jic23@cam.ac.uk>
Subject: Re: [PATCH 04/16] staging:iio: scrap scan_count and ensure all drivers use active_scan_mask
Date: Mon, 28 Nov 2011 17:15:01 +0100	[thread overview]
Message-ID: <4ED3B385.1000002@metafoo.de> (raw)
In-Reply-To: <4ED3584B.3040603@metafoo.de>

On 11/28/2011 10:45 AM, Lars-Peter Clausen wrote:
> On 11/27/2011 02:33 PM, Jonathan Cameron wrote:
>> From: Jonathan Cameron <jic23@cam.ac.uk>
>>
>> Obviously drivers should only use this for pushing to buffers.
>> They need buffer->scan_mask for pulling from them post demux.
>>
>> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
>> ---
>>  drivers/staging/iio/accel/adis16201_ring.c      |   10 +++++-----
>>  drivers/staging/iio/accel/adis16203_ring.c      |   10 +++++-----
>>  drivers/staging/iio/accel/adis16204_ring.c      |   10 +++++-----
>>  drivers/staging/iio/accel/adis16209_ring.c      |    5 +++--
>>  drivers/staging/iio/accel/adis16240_ring.c      |    5 +++--
>>  drivers/staging/iio/accel/lis3l02dq_ring.c      |   23 +++++++++++++----------
>>  drivers/staging/iio/adc/ad7192.c                |   10 ++++++----
>>  drivers/staging/iio/adc/ad7298_ring.c           |   12 +++++++-----
>>  drivers/staging/iio/adc/ad7476_ring.c           |    3 ++-
>>  drivers/staging/iio/adc/ad7793.c                |   11 ++++++-----
>>  drivers/staging/iio/adc/ad7887_ring.c           |    8 +++++---
>>  drivers/staging/iio/adc/ad799x_ring.c           |   13 ++++++++-----
>>  drivers/staging/iio/buffer.h                    |    2 --
>>  drivers/staging/iio/gyro/adis16260_ring.c       |    5 +++--
>>  drivers/staging/iio/iio_simple_dummy_buffer.c   |    7 +++++--
>>  drivers/staging/iio/impedance-analyzer/ad5933.c |   14 ++++++++------
>>  drivers/staging/iio/imu/adis16400_ring.c        |   19 +++++++++++--------
>>  drivers/staging/iio/industrialio-buffer.c       |    2 --
>>  drivers/staging/iio/meter/ade7758_ring.c        |    7 ++++---
>>  19 files changed, 99 insertions(+), 77 deletions(-)
>>
>> diff --git a/drivers/staging/iio/accel/adis16201_ring.c b/drivers/staging/iio/accel/adis16201_ring.c
>> index 936e8cb..68d4b38 100644
>> --- a/drivers/staging/iio/accel/adis16201_ring.c
>> +++ b/drivers/staging/iio/accel/adis16201_ring.c
>> @@ -74,11 +74,11 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
>>  		return -ENOMEM;
>>  	}
>>  
>> -	if (ring->scan_count)
>> -		if (adis16201_read_ring_data(indio_dev, st->rx) >= 0)
>> -			for (; i < ring->scan_count; i++)
>> -				data[i] = be16_to_cpup(
>> -					(__be16 *)&(st->rx[i*2]));
>> +	if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)
>> +	    && adis16201_read_ring_data(indio_dev, st->rx) >= 0)
>> +		for (; i < bitmap_weight(indio_dev->active_scan_mask,
>> +					 indio_dev->masklength); i++)
>> +			data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2]));
>>  
> 
> Does it really make sense to recompute bitmap_weight for each transfer?
> Can't we update scan_count once, when we update the scan_mask?

Also: for chips where we can only read all values at once, should we set
available_scan_masks to ~0 and just let the demuxer handle everything else?

- Lars


  reply	other threads:[~2011-11-28 16:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 13:33 [PATCH 00/16] staging:iio: buffer cleanup series Jonathan Cameron
2011-11-27 13:33 ` [PATCH 01/16] staging:iio:buffer drop bpe field Jonathan Cameron
2011-11-27 13:33 ` [PATCH 02/16] staging:iio: remove userspace access to bytes per datum Jonathan Cameron
2011-11-27 13:33 ` [PATCH 03/16] staging:iio:buffer move setup ops from buffer instance to iio_dev Jonathan Cameron
2011-11-27 13:33 ` [PATCH 04/16] staging:iio: scrap scan_count and ensure all drivers use active_scan_mask Jonathan Cameron
2011-11-28  9:45   ` Lars-Peter Clausen
2011-11-28 16:15     ` Lars-Peter Clausen [this message]
2011-11-28 21:02       ` Jonathan Cameron
2011-11-28 21:19         ` Lars-Peter Clausen
2011-11-28 21:31           ` Jonathan Cameron
2011-11-27 13:33 ` [PATCH 05/16] staging:iio:buffer remove unused owner field from struct iio_buffer Jonathan Cameron
2011-11-27 13:33 ` [PATCH 06/16] staging:iio:accel:lis3l02dq scrap reading from buffer for sysfs access Jonathan Cameron
2011-11-27 13:33 ` [PATCH 10/16] staging:iio:adc:ad7606 remove buffer access to data from sysfs read Jonathan Cameron
2011-11-27 13:33 ` [PATCH 11/16] staging:iio:adc:ad7993 stop reading from buffer for sysfs raw read Jonathan Cameron
2011-11-27 13:33 ` [PATCH 12/16] staging:iio:adc:ad7887 stop reading from buffer for sysfs access Jonathan Cameron
2011-11-27 13:33 ` [PATCH 13/16] staging:iio:adc:ad799x stop reading from buffer for sysfs accesses Jonathan Cameron
2011-11-27 13:33 ` [PATCH 14/16] staging:iio:adc:max1363 stop reading from buffer for sysfs access Jonathan Cameron
2011-11-27 13:33 ` [PATCH 15/16] staging:iio:ring_sw don't provide read last function Jonathan Cameron
2011-11-27 13:33 ` [PATCH 16/16] staging:iio:buffer stop allowing for read_last callback Jonathan Cameron
2011-12-04 21:44 ` [PATCH 00/16] staging:iio: buffer cleanup series Lars-Peter Clausen

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=4ED3B385.1000002@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@cam.ac.uk \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=manuel.stahl@iis.fraunhofer.de \
    /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.