20 Apr, 2016
1 commit
-
If no channels are enabled when we run generic_buffer on a
device, add a command-line option to just enable all of them,
run the sampling and disable them all again afterwards.This is extremely useful when I'm low-level testing my
sensors with interrupts and triggers, sample session:root@Ux500:/ lsiio
Device 000: lsm303dlh_accel
Device 001: lis331dl_accel
Device 002: l3g4200d
Device 003: lsm303dlh_magn
Device 004: lps001wp
Trigger 000: lsm303dlh_accel-trigger
Trigger 001: lis331dl_accel-trigger
Trigger 002: l3g4200d-triggerroot@Ux500:/ generic_buffer -a -c 10 -n l3g4200d
iio device number being used is 2
iio trigger number being used is 2
No channels are enabled, enabling all channels
Enabling: in_anglvel_x_en
Enabling: in_anglvel_y_en
Enabling: in_anglvel_z_en
Enabling: in_timestamp_en
/sys/bus/iio/devices/iio:device2 l3g4200d-trigger
-3.593664 -0.713133 4.870143 946684863662292480
3.225546 0.867357 -4.945878 946684863671875000
-0.676413 0.127296 0.106641 946684863681488037
-0.661113 0.110160 0.128826 946684863690673828
-0.664173 0.113067 0.123471 946684863700683593
-0.664938 0.109395 0.124848 946684863710144042
-0.664173 0.110619 0.130203 946684863719512939
-0.666162 0.111231 0.132651 946684863729125976
-0.668610 0.111690 0.130662 946684863738739013
-0.660501 0.110466 0.131733 946684863748565673
Disabling: in_anglvel_x_en
Disabling: in_anglvel_y_en
Disabling: in_anglvel_z_en
Disabling: in_timestamp_enPure awesomeness. If some channels have been enabled through
scripts or manual interaction, nothing happens.Cc: Peter Meerwald-Stadler
Acked-by: Daniel Baluta
Signed-off-by: Linus Walleij
Signed-off-by: Jonathan Cameron
03 Apr, 2016
3 commits
-
UV index indicating strength of sunburn-producing ultraviolet (UV) radiation
Signed-off-by: Peter Meerwald-Stadler
Signed-off-by: Jonathan Cameron -
Signed-off-by: Peter Meerwald-Stadler
Signed-off-by: Jonathan Cameron -
All the ST Sensors use the old "-trigger" rather than the
standard "-devN" new standard suffix for triggers. Now much
to do about it since it is ABI, but make the testing tools
recognize it too.Signed-off-by: Linus Walleij
Signed-off-by: Jonathan Cameron
20 Mar, 2016
1 commit
-
add recently added channel types and modifiers
Signed-off-by: Peter Meerwald-Stadler
Signed-off-by: Jonathan Cameron
16 Aug, 2015
2 commits
-
Currently if generic_buffer is invoked without first enabling any
channels in scan_elements/*_en, it will fail unable to enable the
buffer because bytes_per_datum inside the kernel will be zero if
no channels are available.It is implied that the user of the program should enable channels
manually or with a script before executing generic_buffer.Be more helpful by stopping execution if no enabled channels can
be found, and print a helptext that will tell you what is wrong
and what needs to be done.Signed-off-by: Linus Walleij
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
This makes the event monitor bail out with a helpful error
message if a device does not support events, as a related
fix to iio core now makes it return -ENODEV properly.Signed-off-by: Linus Walleij
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
13 Aug, 2015
1 commit
-
commit acf50b3586f8d8a7530b905e111dda41876d38f4
"tools:iio:lsiio: add error handling"
introduced error handling of errors returned from
read_sysfs_string(), but with a simple if (retval),
missing the fact that these functions return a positive
value if the read was successful.As a result lsiio regresses and does not show any
devices on my filesystem. Fix this by checking for
only negative error codes.Cc: Hartmut Knaack
Signed-off-by: Linus Walleij
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
09 Aug, 2015
2 commits
-
Remove unnecessary double pointer from channel sorting function.
Signed-off-by: Joo Aun Saw
Signed-off-by: Jonathan Cameron -
On error, caller's ci_array is freed and set to NULL to avoid
potential double free if some other user of this code is not
sufficiently careful. Counter is reset to zero for consistency.Signed-off-by: Joo Aun Saw
Signed-off-by: Jonathan Cameron
03 Aug, 2015
4 commits
-
Signed-off-by: Joo Aun Saw
Acked-by: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Signed-off-by: Joo Aun Saw
Acked-by: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Running generic_buffer without enabling any channel of the
sensor will fail without printing any error message.Add an error message that indicates buffer enable failed.
Signed-off-by: Irina Tirdea
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
When the the sensor data uses 32 bits out of 32, generic_buffer prints
the value 0 for all data read.In this case, the mask is shifted 32 bits, which is beyond the size of
an integer. This will lead to the mask always being 0. Before printing,
the mask is applied to the raw value, thus generating a final value of 0.Fix the mask by shifting a 64 bit value instead of an integer.
Signed-off-by: Irina Tirdea
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
24 Jul, 2015
1 commit
-
Make scale and offset optional by adding -ENOENT check as not all
drivers implement them.Signed-off-by: Joo Aun Saw
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
21 Jul, 2015
4 commits
-
This patch indends to make some cleanup and send printf
error messages to stderr. The changes were performed with coccinelle
for failure messages and manual for other cases, such as wrong usage
messages.Signed-off-by: Cristina Opriceana
Reviewed-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Calculation of the length of an array can be done with the ARRAY_SIZE
macro to make code more abstract and remove the associated
checkpatch.pl warning.Signed-off-by: Cristina Opriceana
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Single statement blocks don’t need braces.
Found with checkpatch.pl.Signed-off-by: Cristina Opriceana
Acked-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Remove explicit NULL comparison and write it in its simpler form as
recommended by checkpatch.pl.Signed-off-by: Cristina Opriceana
Reviewed-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
05 Jul, 2015
1 commit
-
Some sensors export data in an 8-bit format.
Add a single-byte case for the generic_buffer tool so that
these sensors' buffer data can be visualized.Signed-off-by: Tiberiu Breana
Reviewed-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
21 Jun, 2015
2 commits
-
Check that the read event is of the expected size.
Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Signed-off-by: Peter Meerwald
Signed-off-by: Jonathan Cameron
14 Jun, 2015
2 commits
-
Use more appropriate/common variable names:
* namepf instead of nameFile in iio_utils.c
* ret instead of retval in lsiio.cSigned-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Fix various coding style issues, including:
* have spaces around operators
* indentation
* consolidate parameters in same line
* required braces
* adjust/drop comments
* multiline comment style
* delete unnecessary empty lines
* add empty lines to visualize logial code blocks
* typosSigned-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron
01 Jun, 2015
16 commits
-
Mark strings, which are not supposed to be changed (basedir, filename,
value), as const in function parameters.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
In generic_buffer.c: sort program parameters alphabetically and provide
usage information
In lsiio.c: drop unused parametersSigned-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
In build_channel_array(), count can be initialized already during variable
declaration.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
In iioutils_get_type() it is logically better fitting to have sysfsfp
assigned zero right after closing it.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Change the assignment of *is_signed in iioutils_get_type() to a one-liner,
as already done with *be.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Refactor the code in print_event() to reduce code duplication and better
reflect that the type is output unconditionally, as well as cascade the
dependency of the diff-channel. Saves a few lines of code, as well.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Return directly, if no common cleanup is required.
Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Fully document public functions and elements.
Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Add error handling to calls which can indicate a major problem by
returning an error code.
This also involves to change the type of dump_devices() from void to int.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Add error handling to calls which can indicate a major problem by
returning an error code.
This also sets ret to -ENOENT in iioutils_get_type() and
iioutils_get_param_float() to indicate if no matching directory entry was
found.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Add error handling to calls which can indicate a major problem by
returning an error code.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Add error handling to calls which can indicate a major problem by
returning an error code.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Add handler to catch errors on conversion of numerical arguments.
Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
This patch catches errors in string allocation in generic_buffer.c,
iio_event_monitor.c, iio_utils.c and lsiio.c.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Functions _write_sysfs_int() and _write_sysfs_string() are supposed to
be called only by public wrappers, so make them static.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
Previously, the return value of sscanf() was treated as an indication of
the digits it would have read. Yet, sscanf() only returns the amount of
valid matches.
Therefore, introduce a function to calculate the decimal digits of the
read number and use this one to commence a colon search, as originally
intended.Signed-off-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron