All of lore.kernel.org
 help / color / mirror / Atom feed
* iio: adis16400 scan mask question
@ 2013-09-17 21:29 Peter Meerwald
  2013-09-18  7:22 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Meerwald @ 2013-09-17 21:29 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

Hello,

why the following code in drivers/iio/imu/adis16400_core.c?

static const unsigned long adis16400_burst_scan_mask[] = {
	~0UL,
	0,
};

[...]

if (!(st->variant->flags & ADIS16400_NO_BURST))
		indio_dev->available_scan_masks = adis16400_burst_scan_mask;


isn't the all-1 scan mask the same as not applying any scan mask?

thanks, regards, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: iio: adis16400 scan mask question
  2013-09-17 21:29 iio: adis16400 scan mask question Peter Meerwald
@ 2013-09-18  7:22 ` Lars-Peter Clausen
  2013-09-18  7:41   ` Peter Meerwald
  0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2013-09-18  7:22 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio

On 09/17/2013 11:29 PM, Peter Meerwald wrote:
> Hello,
> 
> why the following code in drivers/iio/imu/adis16400_core.c?
> 
> static const unsigned long adis16400_burst_scan_mask[] = {
> 	~0UL,
> 	0,
> };
> 
> [...]
> 
> if (!(st->variant->flags & ADIS16400_NO_BURST))
> 		indio_dev->available_scan_masks = adis16400_burst_scan_mask;
> 
> 
> isn't the all-1 scan mask the same as not applying any scan mask?

A scan mask where all bits are set means that sampling can only be done with
all channels enabled at once. Userspace can still only select a subset of
these channels and the kernel will take care of properly demuxing the stream.

- Lars

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: iio: adis16400 scan mask question
  2013-09-18  7:22 ` Lars-Peter Clausen
@ 2013-09-18  7:41   ` Peter Meerwald
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Meerwald @ 2013-09-18  7:41 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

> > if (!(st->variant->flags & ADIS16400_NO_BURST))
> > 		indio_dev->available_scan_masks = adis16400_burst_scan_mask;
> > 
> > isn't the all-1 scan mask the same as not applying any scan mask?

> A scan mask where all bits are set means that sampling can only be done with
> all channels enabled at once. Userspace can still only select a subset of
> these channels and the kernel will take care of properly demuxing the stream.

ah, that's a pretty good reason
I discovered the demuxing code later-on

thanks, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-18  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 21:29 iio: adis16400 scan mask question Peter Meerwald
2013-09-18  7:22 ` Lars-Peter Clausen
2013-09-18  7:41   ` Peter Meerwald

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.