All of lore.kernel.org
 help / color / mirror / Atom feed
* libiio and unindexed channel
@ 2016-02-15 16:13 Gregor Boirie
  2016-02-15 16:51 ` Lars-Peter Clausen
  0 siblings, 1 reply; 2+ messages in thread
From: Gregor Boirie @ 2016-02-15 16:13 UTC (permalink / raw)
  To: linux-iio, paul.cercueil

Hi all,

I hope it is the right place to post for libiio related problems. Please,
forgive my mistakeif it is not.

I'm facing a rather odd problem with unindexed channel (as declared
in ms5611 pressure driver iio_chan_spec 's). libiio does not consider
pressure and temperature channels exposed by the driver as...
channels.

Trying to figure out why, I looked into libiio local backend and found
that:
* on tag v0.6, libiio simply consider unindexed driver channels as
   device attribute (see local.c:942) ;
* on actual master, libiio will promote unindexed driver channels to
   channels BUT without the scan_element ability (see local.c:1130)

I don't fully understand what real difference it makes but libiio manual
says:
</quote>
a channel that is a scan element is a channel that can generate samples
(for an input channel) or receive samples (for an output channel) after
being enabled.
<quote/>

I feel a bit lost here : I thought input channels were always able to
generate samples. What is this iio_channel_is_scan_element() here
for ? From userspace point of view, what channel indices should be used
for ?

Many thanks in advancefor sharing your time and knowledge.
Regards,
Gregor.

P.S.: by the way, setting the "indexed" field of iio_chan_spec's in
ms5611_core.c makes libiio see temperature and pressure as channels.


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

* Re: libiio and unindexed channel
  2016-02-15 16:13 libiio and unindexed channel Gregor Boirie
@ 2016-02-15 16:51 ` Lars-Peter Clausen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2016-02-15 16:51 UTC (permalink / raw)
  To: Gregor Boirie, linux-iio, paul.cercueil

On 02/15/2016 05:13 PM, Gregor Boirie wrote:
> Hi all,
> 
> I hope it is the right place to post for libiio related problems. Please,
> forgive my mistakeif it is not.
> 
> I'm facing a rather odd problem with unindexed channel (as declared
> in ms5611 pressure driver iio_chan_spec 's). libiio does not consider
> pressure and temperature channels exposed by the driver as...
> channels.
> 
> Trying to figure out why, I looked into libiio local backend and found
> that:
> * on tag v0.6, libiio simply consider unindexed driver channels as
>   device attribute (see local.c:942) ;
> * on actual master, libiio will promote unindexed driver channels to
>   channels BUT without the scan_element ability (see local.c:1130)
> 
> I don't fully understand what real difference it makes but libiio manual
> says:
> </quote>
> a channel that is a scan element is a channel that can generate samples
> (for an input channel) or receive samples (for an output channel) after
> being enabled.
> <quote/>
> 
> I feel a bit lost here : I thought input channels were always able to
> generate samples. What is this iio_channel_is_scan_element() here
> for ? From userspace point of view, what channel indices should be used
> for ?
> 
> Many thanks in advancefor sharing your time and knowledge.
> Regards,
> Gregor.
> 
> P.S.: by the way, setting the "indexed" field of iio_chan_spec's in
> ms5611_core.c makes libiio see temperature and pressure as channels.

Hi,

One of the major issues of the current IIO userspace ABI is that it is not
really machine readable friendly. libiio employs a couple of heuristics to
try to recover the original information. Your usecase is currently not
covered by the heuristics. But it should be fairly easy to add. If there is
a entry in scan_elements/ whether it has a index or not it should cause
libiio to infer a channel for it. Patches welcome.

- Lars


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

end of thread, other threads:[~2016-02-15 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-15 16:13 libiio and unindexed channel Gregor Boirie
2016-02-15 16:51 ` Lars-Peter Clausen

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.