-
Notifications
You must be signed in to change notification settings - Fork 332
[RFC PATCH v4] iio: repeat channel support and dummy client example #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Lucas Magasweran <[email protected]>
Linux struct iio_chan_spec supports a 'repeat' scan_type attribute that represents the number of times the element repeats. A value of 0 and 1 signifies no repeat. In order maintain backwards and forwards compatibility, the repeat field was added to the end of the struct. This means applications compiled against an older version will work fine with the newer dynamically linked library. Applications compiled against a newer version will work fine with the older dynamically linked library so long as they don't access this new feature. Applications using this new feature should ensure the libiio version is compatible by using iio_library_get_version() to avoid undefined behavior. Signed-off-by: Lucas Magasweran <[email protected]>
…-hrtimer Signed-off-by: Lucas Magasweran <[email protected]>
This matches the optional X%u repeat count in sysfs _type scan element format attribute. Signed-off-by: Lucas Magasweran <[email protected]>
Signed-off-by: Lucas Magasweran <[email protected]>
@@ -1232,6 +1233,9 @@ struct iio_data_format { | |||
|
|||
/** @brief Contains the scale to apply if with_scale is set */ | |||
double scale; | |||
|
|||
/** @brief Number of times length repeats (added in v0.8) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming this will be merged and released with v0.8.
printf("Library version: %u.%u (git tag: %s)\n", major, minor, git_tag); | ||
|
||
/* check for struct iio_data_format.repeat support */ | ||
has_repeat = major >= 0 && minor >= 8 ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming this will be merged and released with v0.8.
I don't like how you use "(chn->format.repeat ? chn->format.repeat : 1)" everywhere. |
I did that so that the libiio repeat field matched the value in the kernel, Thanks for the feedback! On Tue, Sep 20, 2016, 05:52 Paul Cercueil [email protected] wrote:
|
Thanks :) |
Changed the initial value of repeat in pull request #43. |
iio_chan_type
IIO_ROT
uses the repeat channeliio_chan_spec.scan_type.repeat
to store repeated elements in a channel without modifiers.This patch series adds support to
libiio
and creates a new example tool that exercises theiio_dummy
driver. For testing this series theiio_dummy
can be patched to include theIIO_ROT
channel. See lucasrangit/linux-iio#1 .Signed-off-by: Lucas Magasweran [email protected]
Changes since v1:
format->repeat > 1
for consistent output and avoid duplicatedprintf
and squashed commits since this is a new sample tool
Changes since v2:
struct iio_data_format
memberrepeat
to the end of the struct to maintain forward ABI compatibility.iio_library_get_version()
.