* RFC How to handle device with different _scale values depending on how you access them.
@ 2011-04-09 18:23 Jonathan Cameron
2011-04-11 14:55 ` Hennerich, Michael
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2011-04-09 18:23 UTC (permalink / raw)
To: linux-iio@vger.kernel.org
Dear All,
I'm messing with my favourite 'special' device, the sca3000.
It has a hardware ring buffer and direct read abilities.
Direct reads of current value are 13bit signed, the buffer
is either 11 bit or 8 bit.
So ultimately the scale on the buffer can change which is
nasty enough, however direct reads are 13bits whatever
the buffer is set to.
Hence we need to export two scale's at a time.
Would anyone mind if I add the option to have both
/device0/accel_scale (applies to _raw files in the same dir).
and
/device0/device0:buffer0/accel_scale (or maybe put it
in the 'scan_elements' directory?
This means we will have to define a precedence for these
attributes when reading from buffers which isn't nice, but
such is life...
Jonathan
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: RFC How to handle device with different _scale values depending on how you access them.
2011-04-09 18:23 RFC How to handle device with different _scale values depending on how you access them Jonathan Cameron
@ 2011-04-11 14:55 ` Hennerich, Michael
0 siblings, 0 replies; 2+ messages in thread
From: Hennerich, Michael @ 2011-04-11 14:55 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org
Jonathan Cameron wrote on 2011-04-09:
> Dear All,
>
> I'm messing with my favourite 'special' device, the sca3000.
>
> It has a hardware ring buffer and direct read abilities.
>
> Direct reads of current value are 13bit signed, the buffer is either
> 11 bit or 8 bit.
>
> So ultimately the scale on the buffer can change which is nasty
> enough, however direct reads are 13bits whatever the buffer is set to.
>
> Hence we need to export two scale's at a time.
>
> Would anyone mind if I add the option to have both
>
> /device0/accel_scale (applies to _raw files in the same dir). and
> /device0/device0:buffer0/accel_scale (or maybe put it in the
> 'scan_elements' directory?
>
> This means we will have to define a precedence for these attributes
> when reading from buffers which isn't nice, but such is life...
>
> Jonathan
If scaling the values in the buffer to 13-bit is not an alternative, that s=
ounds like the way to go.
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Gesch=
aeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret=
Seif
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-11 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-09 18:23 RFC How to handle device with different _scale values depending on how you access them Jonathan Cameron
2011-04-11 14:55 ` Hennerich, Michael
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.