Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* Problem about Read Multiple Raw Function
@ 2019-11-26 12:56 Oezguen Guenyeli
  2019-11-26 15:16 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Oezguen Guenyeli @ 2019-11-26 12:56 UTC (permalink / raw)
  To: linux-iio

Hi, 
I am developing Linux iio driver for one sensor and sensor provides 15 measurement samples that have to been sent the user-space for high level algorithm. 
I can read data from dev/iio:device and I can apply high-level algorithm. However, I have problem about read_raw_multi function. Max_len pass value as INDIO_MAX_RAW_ELEMENTS in iio_read_channel_info function that locates in industrialio-core.c file and INDIO_MAX_RAW_ELEMENTS is defined 4 in iio.h file.
Is there any specific reason to define 4 ? Because in that way I cannot pass 15 values to user space with read_raw_multi function. 

Thanks, 

Özgün Kemal Günyeli


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

* Re: Problem about Read Multiple Raw Function
  2019-11-26 12:56 Problem about Read Multiple Raw Function Oezguen Guenyeli
@ 2019-11-26 15:16 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-11-26 15:16 UTC (permalink / raw)
  To: Oezguen Guenyeli; +Cc: linux-iio

On Tue, 26 Nov 2019 12:56:11 +0000
Oezguen Guenyeli <oezguen.guenyeli.wg@renesas.com> wrote:

> Hi, 
> I am developing Linux iio driver for one sensor and sensor provides 15 measurement samples that have to been sent the user-space for high level algorithm. 
> I can read data from dev/iio:device and I can apply high-level algorithm. However, I have problem about read_raw_multi function. Max_len pass value as INDIO_MAX_RAW_ELEMENTS in iio_read_channel_info function that locates in industrialio-core.c file and INDIO_MAX_RAW_ELEMENTS is defined 4 in iio.h file.
> Is there any specific reason to define 4 ? Because in that way I cannot pass 15 values to user space with read_raw_multi function. 

Yes.

The intent is that read_raw multi is used for well defined types.  The
largest of those that has been defined in the IIO ABI is quaternions, which
have 4 elements, hence the limit.

There is little point in using IIO for a device such as the one you describe as
no generic userspace code is ever going to work with it.

If you have a series of values that are separate well defined channels, but need
to sample them in one go, then use the buffered interface and read them via
a chardev.  If not and there is a good reason why these 15 numbers represent
one 'thing' then pitch the new userspace ABI and we can consider changing
that limit.

Thanks,

Jonathan

> 
> Thanks, 
> 
> Özgün Kemal Günyeli
> 



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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 12:56 Problem about Read Multiple Raw Function Oezguen Guenyeli
2019-11-26 15:16 ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git