<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/tools/iio, branch linux-4.9.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>tools: iio: iio_utils: fix digit calculation</title>
<updated>2022-11-03T14:49:16+00:00</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-13T12:04:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=48797c0bb8090ca9715ace072a3702e93ea49044'/>
<id>48797c0bb8090ca9715ace072a3702e93ea49044</id>
<content type='text'>
commit 72b2aa38191bcba28389b0e20bf6b4f15017ff2b upstream.

The iio_utils uses a digit calculation in order to know length of the
file name containing a buffer number. The digit calculation does not
work for number 0.

This leads to allocation of one character too small buffer for the
file-name when file name contains value '0'. (Eg. buffer0).

Fix digit calculation by returning one digit to be present for number
'0'.

Fixes: 096f9b862e60 ("tools:iio:iio_utils: implement digit calculation")
Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Link: https://lore.kernel.org/r/Y0f+tKCz+ZAIoroQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 72b2aa38191bcba28389b0e20bf6b4f15017ff2b upstream.

The iio_utils uses a digit calculation in order to know length of the
file name containing a buffer number. The digit calculation does not
work for number 0.

This leads to allocation of one character too small buffer for the
file-name when file name contains value '0'. (Eg. buffer0).

Fix digit calculation by returning one digit to be present for number
'0'.

Fixes: 096f9b862e60 ("tools:iio:iio_utils: implement digit calculation")
Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Link: https://lore.kernel.org/r/Y0f+tKCz+ZAIoroQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: iio-utils: Fix possible incorrect mask calculation</title>
<updated>2019-08-04T07:33:38+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2019-06-27T07:20:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e2482f76499d2dd0664d7c91bd06d4608c30615b'/>
<id>e2482f76499d2dd0664d7c91bd06d4608c30615b</id>
<content type='text'>
[ Upstream commit 208a68c8393d6041a90862992222f3d7943d44d6 ]

On some machines, iio-sensor-proxy was returning all 0's for IIO sensor
values. It turns out that the bits_used for this sensor is 32, which makes
the mask calculation:

*mask = (1 &lt;&lt; 32) - 1;

If the compiler interprets the 1 literals as 32-bit ints, it generates
undefined behavior depending on compiler version and optimization level.
On my system, it optimizes out the shift, so the mask value becomes

*mask = (1) - 1;

With a mask value of 0, iio-sensor-proxy will always return 0 for every axis.

Avoid incorrect 0 values caused by compiler optimization.

See original fix by Brett Dutro &lt;brett.dutro@gmail.com&gt; in
iio-sensor-proxy:
https://github.com/hadess/iio-sensor-proxy/commit/9615ceac7c134d838660e209726cd86aa2064fd3

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 208a68c8393d6041a90862992222f3d7943d44d6 ]

On some machines, iio-sensor-proxy was returning all 0's for IIO sensor
values. It turns out that the bits_used for this sensor is 32, which makes
the mask calculation:

*mask = (1 &lt;&lt; 32) - 1;

If the compiler interprets the 1 literals as 32-bit ints, it generates
undefined behavior depending on compiler version and optimization level.
On my system, it optimizes out the shift, so the mask value becomes

*mask = (1) - 1;

With a mask value of 0, iio-sensor-proxy will always return 0 for every axis.

Avoid incorrect 0 values caused by compiler optimization.

See original fix by Brett Dutro &lt;brett.dutro@gmail.com&gt; in
iio-sensor-proxy:
https://github.com/hadess/iio-sensor-proxy/commit/9615ceac7c134d838660e209726cd86aa2064fd3

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'iio-for-4.9b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next</title>
<updated>2016-09-14T18:42:03+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-09-14T18:42:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=552edf8d79096c7458cdc2a7b1f9936e7925e2aa'/>
<id>552edf8d79096c7458cdc2a7b1f9936e7925e2aa</id>
<content type='text'>
Jonathan writes:

Second set of iio new device support, features and cleanups for the 4.9 cycle.

New device support
* ad8801 dac
  - new driver supporting ad8801 and ad8803 DACs.
* adc12138
  - new driver supporting TI adc12130/adc12132 and adc12138 ADCs.
* ltc2485 adc
  - new driver
* mxc6255
  - add support for the mxc6225 part name and fixup the ID check so it works.
* vz89x VOC sensor
  - add support for the vz89te part which drops the voc_short channel and adds
    CRCs compared to other supported parts.

New features
* core
  - immutable triggers.  These effectively grant exclusive control over a
    trigger. The typical usecase is a device representing an analog part
    (perhaps a MUX) that needs to control the sampling of a downstream
    ADC.
  - resource managed trigger registration and triggered_buffer_init.
  - iio_push_event now protected against case of the event interface
    registration not having yet occured.  Only matters if an interrupt
    can occur during this window - might happen on shared interrupt lines.
  - helper to let a driver query if the trigger it is using is provided by
    itself (using the convention of both device and trigger having the same
    parent).
* tools
  - iio-utils. Used channel modifier scaling in preference to generic scaling
    when both exist.
* at91-adc
  - Add support for touchscreen switches closure time needed by some newer
    parts.
* stx104
  - support the ADC channels on this ADC/DAC board. As these are the primary
    feature of the board also move the driver to the iio/adc directory.
* sx9500
  - device tree bindings.

Cleanups / Fixes
* ad5755
  - fix an off-by-one on devnr limit check (introduced earlier this cycle)
* ad7266
  - drop NULL check on devm_regulator_get_optional as it can't return NULL.
* ak8974
  - avoid an unused functional warning due to rework in PM core code.
  - remove .owner field setting as done by i2c_core.
* ina2xx
  - clear out a left over debug field from chip global data.
* hid-sensors
  - avoid an unused functional warning due to rework in PM core code.
* maxim-thermocouple
  - fix non static symbol warnings.
* ms5611
  - fetch and enable regulators unconditionally when they aren't optional.
* sca3000
  - whitespace cleanup.
* st_sensors
  - fetch and enable regulators unconditionally rather than having them
    supported as optional regulators (missunderstanding on my part amongst
    others a while back)
  - followup to previous patch fixes error checking on the regulators.
  - mark symbols static where possible.
  - use the 'is it my trigger' help function.  This prevents the odd case
    of another device triggering from the st-sensors trigger whilst the
    st-sensors trigger is itself not using it but rather using say an hrtimer.
* ti-ads1015
  - add missing of_node_put.
* vz89x
  - rework to all support of new devices.
  - prevent reading of a corrupted buffer.
  - fixup a return value of 0/1 in a bool returning function.

Address updates
- Vlad Dogaru email address change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jonathan writes:

Second set of iio new device support, features and cleanups for the 4.9 cycle.

New device support
* ad8801 dac
  - new driver supporting ad8801 and ad8803 DACs.
* adc12138
  - new driver supporting TI adc12130/adc12132 and adc12138 ADCs.
* ltc2485 adc
  - new driver
* mxc6255
  - add support for the mxc6225 part name and fixup the ID check so it works.
* vz89x VOC sensor
  - add support for the vz89te part which drops the voc_short channel and adds
    CRCs compared to other supported parts.

New features
* core
  - immutable triggers.  These effectively grant exclusive control over a
    trigger. The typical usecase is a device representing an analog part
    (perhaps a MUX) that needs to control the sampling of a downstream
    ADC.
  - resource managed trigger registration and triggered_buffer_init.
  - iio_push_event now protected against case of the event interface
    registration not having yet occured.  Only matters if an interrupt
    can occur during this window - might happen on shared interrupt lines.
  - helper to let a driver query if the trigger it is using is provided by
    itself (using the convention of both device and trigger having the same
    parent).
* tools
  - iio-utils. Used channel modifier scaling in preference to generic scaling
    when both exist.
* at91-adc
  - Add support for touchscreen switches closure time needed by some newer
    parts.
* stx104
  - support the ADC channels on this ADC/DAC board. As these are the primary
    feature of the board also move the driver to the iio/adc directory.
* sx9500
  - device tree bindings.

Cleanups / Fixes
* ad5755
  - fix an off-by-one on devnr limit check (introduced earlier this cycle)
* ad7266
  - drop NULL check on devm_regulator_get_optional as it can't return NULL.
* ak8974
  - avoid an unused functional warning due to rework in PM core code.
  - remove .owner field setting as done by i2c_core.
* ina2xx
  - clear out a left over debug field from chip global data.
* hid-sensors
  - avoid an unused functional warning due to rework in PM core code.
* maxim-thermocouple
  - fix non static symbol warnings.
* ms5611
  - fetch and enable regulators unconditionally when they aren't optional.
* sca3000
  - whitespace cleanup.
* st_sensors
  - fetch and enable regulators unconditionally rather than having them
    supported as optional regulators (missunderstanding on my part amongst
    others a while back)
  - followup to previous patch fixes error checking on the regulators.
  - mark symbols static where possible.
  - use the 'is it my trigger' help function.  This prevents the odd case
    of another device triggering from the st-sensors trigger whilst the
    st-sensors trigger is itself not using it but rather using say an hrtimer.
* ti-ads1015
  - add missing of_node_put.
* vz89x
  - rework to all support of new devices.
  - prevent reading of a corrupted buffer.
  - fixup a return value of 0/1 in a bool returning function.

Address updates
- Vlad Dogaru email address change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 4.8-rc6 into staging-next</title>
<updated>2016-09-12T07:18:04+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-09-12T07:18:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8473054e4d2581282230d01d1ae5379cdcf7a4df'/>
<id>8473054e4d2581282230d01d1ae5379cdcf7a4df</id>
<content type='text'>
We need the IIO changes in here for future patches to build on.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need the IIO changes in here for future patches to build on.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 4.8-rc5 into staging-next</title>
<updated>2016-09-05T06:13:24+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-09-05T06:13:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9c2edd8b5bcb36ec6c890dd85f8fd13034aaa43e'/>
<id>9c2edd8b5bcb36ec6c890dd85f8fd13034aaa43e</id>
<content type='text'>
We want the staging fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want the staging fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools:iio:iio_generic_buffer: fix trigger-less mode</title>
<updated>2016-08-29T17:06:21+00:00</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-08-24T13:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f8e81d7e496ea89f377c6935b92022032bed62e5'/>
<id>f8e81d7e496ea89f377c6935b92022032bed62e5</id>
<content type='text'>
Passing the trigger-less mode option on the command line causes
iio_generic_buffer to fail searching for an IIO trigger.
Fix this by skipping trigger initialization if trigger-less mode is
requested.

Technically it actually fixes:
7c7e9dad70 where the bug was introduced but as the window to the patch
below that changes the context was very small let's mark it with that.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Fixes: deb4d1fdcb5af ("iio: generic_buffer: Fix --trigger-num option")
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing the trigger-less mode option on the command line causes
iio_generic_buffer to fail searching for an IIO trigger.
Fix this by skipping trigger initialization if trigger-less mode is
requested.

Technically it actually fixes:
7c7e9dad70 where the bug was introduced but as the window to the patch
below that changes the context was very small let's mark it with that.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Fixes: deb4d1fdcb5af ("iio: generic_buffer: Fix --trigger-num option")
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: iio-utils: use channel modifier scaling if it exists</title>
<updated>2016-08-29T15:26:41+00:00</updated>
<author>
<name>Matt Ranostay</name>
<email>mranostay@gmail.com</email>
</author>
<published>2016-08-22T22:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6356f1b9b7e3ccd24bec93c7ed4e226464f44774'/>
<id>6356f1b9b7e3ccd24bec93c7ed4e226464f44774</id>
<content type='text'>
Now there are channel modifiers with their own scaling those should be
used when possible over the generic channel type scaling.

Examples are of IIO_TEMP channel having a generic scaling value, and
another having IIO_MOD_TEMP_AMBIENT modifier with another scaling value.

Previously the first scaling value for a channel type would be applied
to all channels of like type in iio_generic_buffer

Signed-off-by: Matt Ranostay &lt;mranostay@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now there are channel modifiers with their own scaling those should be
used when possible over the generic channel type scaling.

Examples are of IIO_TEMP channel having a generic scaling value, and
another having IIO_MOD_TEMP_AMBIENT modifier with another scaling value.

Previously the first scaling value for a channel type would be applied
to all channels of like type in iio_generic_buffer

Signed-off-by: Matt Ranostay &lt;mranostay@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: iio: lsiio: enumerate processed channels</title>
<updated>2016-08-15T17:33:23+00:00</updated>
<author>
<name>Matt Ranostay</name>
<email>mranostay@gmail.com</email>
</author>
<published>2016-08-02T02:39:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6df1dc05e73e5108d623c6a38dd24b30f0163657'/>
<id>6df1dc05e73e5108d623c6a38dd24b30f0163657</id>
<content type='text'>
Enumerate the processed channels (e.g. *_input) as well the raw channels.

Signed-off-by: Matt Ranostay &lt;mranostay@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enumerate the processed channels (e.g. *_input) as well the raw channels.

Signed-off-by: Matt Ranostay &lt;mranostay@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: initialize channel array pointer</title>
<updated>2016-08-15T16:05:30+00:00</updated>
<author>
<name>Alison Schofield</name>
<email>amsfield22@gmail.com</email>
</author>
<published>2016-07-27T03:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ddbc719f99cf9aed6918cef98cb3475fd4fc4fa6'/>
<id>ddbc719f99cf9aed6918cef98cb3475fd4fc4fa6</id>
<content type='text'>
Uninitialized channel pointer causes segmentation fault when we
call free(channel) during cleanup() with no channels initialized.
This happens when you exit early for usage errors.  Initialize
the pointer to NULL when it is declared.

Signed-off-by: Alison Schofield &lt;amsfield22@gmail.com&gt;
Cc: Daniel Baluta &lt;daniel.baluta@gmail.com&gt;
Tested-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Uninitialized channel pointer causes segmentation fault when we
call free(channel) during cleanup() with no channels initialized.
This happens when you exit early for usage errors.  Initialize
the pointer to NULL when it is declared.

Signed-off-by: Alison Schofield &lt;amsfield22@gmail.com&gt;
Cc: Daniel Baluta &lt;daniel.baluta@gmail.com&gt;
Tested-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: generic_buffer: Fix --trigger-num option</title>
<updated>2016-06-11T16:38:06+00:00</updated>
<author>
<name>Crestez Dan Leonard</name>
<email>leonard.crestez@intel.com</email>
</author>
<published>2016-06-03T18:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=deb4d1fdcb5af079896f7ca5e8067e69485f6bdd'/>
<id>deb4d1fdcb5af079896f7ca5e8067e69485f6bdd</id>
<content type='text'>
Initialize trig_num to -1 and handle trig_num=0 as a valid id.

Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option)
Signed-off-by: Crestez Dan Leonard &lt;leonard.crestez@intel.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Initialize trig_num to -1 and handle trig_num=0 as a valid id.

Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option)
Signed-off-by: Crestez Dan Leonard &lt;leonard.crestez@intel.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
