From: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: [IIO] Proposal for sysfs attributes
Date: Mon, 06 Sep 2010 10:41:31 +0200 [thread overview]
Message-ID: <4C84A93B.2050507@iis.fraunhofer.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2288 bytes --]
Hi all,
there were some sysfs userspace questions on linux-iio where we would
like to get some more comments on.
First thing, there are some attributes describing the layout of a ring
buffer that can be read out via a char device. The buffer contains
several entries with each containing so called scan elements. All
entries have the same layout. It is described in a directory
scan_elements (see below) that contains three attributes per scan element.
> OK, no packed buffers for now, but we should implement variable
> sample sizes for standard types. Indeed we already have this for
> the timestamp, which is always 64 bit.
>
> To be compatible with future extensions we could have:
> |- /sys/bus/iio/device0/buffer0/scan_elements/
> |- accel_x_en (0 or 1)
> |- accel_x_type (i.e. s14/16, see *)
> |- accel_x_index (position inside the buffer entry)
>
> * s14/16 means signed 14 bits, stored in 16 bits, right aligned.
> If it's left aligned we can just modify the scale attribute and
> give the 16 bit interpretation in <channel>_raw.
Is the 's14/16' self explaining or should we use some other format?
Is 'type' a good postfix for the attribute?
Next question: how strictly we want to resamble the hwmon ABI?
To sum up the discussion:
Hwmon has files with the postfix _input to read values scaled to
reasonable units for fixed point representation. So the units are
sometimes scaled down to 'millis' e.g. millivolt, millidegree Celsius.
We agreed that we want to keep this, whenever we use the _input postfix.
For IIO there is also the postfix triple _raw, _scale and _offset,
where the final value is calculated by (_raw + _offset) * _scale.
Floating point values are allowed for any of these files.
The question in place was:
Do we want to resamble the 'milli' units or should we stick to
standard SI units (radians, kelvin, etc.) as floating point math is
necessary anyway.
Regards,
--
Dipl.-Inf. Manuel Stahl
Fraunhofer-Institut für Integrierte Schaltungen IIS
- Leistungsoptimierte Systeme -
Nordostpark 93 Telefon +49 (0)911/58061-6419
90411 Nürnberg Fax +49 (0)911/58061-6398
http://www.iis.fraunhofer.de manuel.stahl@iis.fraunhofer.de
[-- Attachment #1.2: manuel_stahl.vcf --]
[-- Type: text/x-vcard, Size: 170 bytes --]
begin:vcard
fn:Manuel Stahl
n:Stahl;Manuel
email;internet:manuel.stahl@iis.fraunhofer.de
tel;work:+49 911 58061-6419
x-mozilla-html:FALSE
version:2.1
end:vcard
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 6148 bytes --]
next reply other threads:[~2010-09-06 8:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 8:41 Manuel Stahl [this message]
2010-09-06 13:02 ` Jonathan Cameron
2010-09-06 13:32 ` Alan Cox
2010-09-06 14:17 ` Jonathan Cameron
2010-09-06 14:48 ` Alan Cox
2010-09-06 15:03 ` Jonathan Cameron
2010-09-18 12:25 ` Jonathan Cameron
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=4C84A93B.2050507@iis.fraunhofer.de \
--to=manuel.stahl@iis.fraunhofer.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®