<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/include/linux/iio/iio.h, branch linux-3.12.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>iio: Add inverse unit conversion macros</title>
<updated>2015-09-30T08:59:50+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2015-08-05T13:38:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2e42c785118a9ab1e7fccd5b837b2220c7398ea5'/>
<id>2e42c785118a9ab1e7fccd5b837b2220c7398ea5</id>
<content type='text'>
commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream.

Add inverse unit conversion macro to convert from standard IIO units to
units that might be used by some devices.

Those are useful in combination with scale factors that are specified as
IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will
contain the maximum raw value the sensor will generate and the numerator
the value it maps to in a specific unit. Sometimes datasheets specify those
in different units than the standard IIO units (e.g. degree/s instead of
rad/s) and so we need to do a unit conversion.

From a mathematical point of view it does not make a difference whether we
apply the unit conversion to the numerator or the inverse unit conversion
to the denominator since (x / y) / z = x / (y * z). But as the denominator
is typically a larger value and we are rounding both the numerator and
denominator to integer values using the later method gives us a better
precision (E.g. the relative error is smaller if we round 8000.3 to 8000
rather than rounding 8.3 to 8).

This is where in inverse unit conversion macros will be used.

Marked for stable as used by some upcoming fixes.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream.

Add inverse unit conversion macro to convert from standard IIO units to
units that might be used by some devices.

Those are useful in combination with scale factors that are specified as
IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will
contain the maximum raw value the sensor will generate and the numerator
the value it maps to in a specific unit. Sometimes datasheets specify those
in different units than the standard IIO units (e.g. degree/s instead of
rad/s) and so we need to do a unit conversion.

From a mathematical point of view it does not make a difference whether we
apply the unit conversion to the numerator or the inverse unit conversion
to the denominator since (x / y) / z = x / (y * z). But as the denominator
is typically a larger value and we are rounding both the numerator and
denominator to integer values using the later method gives us a better
precision (E.g. the relative error is smaller if we round 8000.3 to 8000
rather than rounding 8.3 to 8).

This is where in inverse unit conversion macros will be used.

Marked for stable as used by some upcoming fixes.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>iio: trigger: implement devm_iio_trigger_alloc/devm_iio_triger_free</title>
<updated>2013-08-17T18:34:52+00:00</updated>
<author>
<name>Jacek Anaszewski</name>
<email>j.anaszewski@samsung.com</email>
</author>
<published>2013-08-16T13:11:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d536321df392ee0db6a5e92d98f0303020315f40'/>
<id>d536321df392ee0db6a5e92d98f0303020315f40</id>
<content type='text'>
Add a resource managed devm_iio_trigger_alloc()/devm_iio_triger_free()
to automatically clean up triggers allocated by IIO drivers, thus
leading to simplified IIO drivers code.

Signed-off-by: Jacek Anaszewski &lt;j.anaszewski@samsung.com&gt;
Signed-off-by: Kyunmin Park &lt;kyungmin.park@samsung.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>
Add a resource managed devm_iio_trigger_alloc()/devm_iio_triger_free()
to automatically clean up triggers allocated by IIO drivers, thus
leading to simplified IIO drivers code.

Signed-off-by: Jacek Anaszewski &lt;j.anaszewski@samsung.com&gt;
Signed-off-by: Kyunmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix documentation of devm_iio_device_free()</title>
<updated>2013-08-03T21:21:53+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2013-07-29T21:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9bc541028b2b93962e0bebce62ce6e295aab2086'/>
<id>9bc541028b2b93962e0bebce62ce6e295aab2086</id>
<content type='text'>
Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Cc: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.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>
Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Cc: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: core: implement devm_iio_device_alloc/devm_iio_device_free</title>
<updated>2013-08-03T17:40:37+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2013-07-18T10:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9dabaf5eddbafa21aded7c063cb38d2e8936c237'/>
<id>9dabaf5eddbafa21aded7c063cb38d2e8936c237</id>
<content type='text'>
Add a resource managed devm_iio_device_alloc()/devm_iio_device_free()
to automatically clean up any allocations made by IIO drivers,
thus leading to simplified IIO drivers code.

In addition, this will allow IIO drivers to use other devm_*() API
(like devm_request_irq) and don't care about the race between
iio_device_free() and the release of resources by Device core
during driver removing.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Tested-by: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a resource managed devm_iio_device_alloc()/devm_iio_device_free()
to automatically clean up any allocations made by IIO drivers,
thus leading to simplified IIO drivers code.

In addition, this will allow IIO drivers to use other devm_*() API
(like devm_request_irq) and don't care about the race between
iio_device_free() and the release of resources by Device core
during driver removing.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Tested-by: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix iio_channel_has_info</title>
<updated>2013-07-02T21:08:20+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2013-07-01T14:20:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1c297a66654a3295ae87e2b7f3724d214eb2b5ec'/>
<id>1c297a66654a3295ae87e2b7f3724d214eb2b5ec</id>
<content type='text'>
Since the info_mask split, iio_channel_has_info() is not working correctly.
info_mask_separate and info_mask_shared_by_type, it is not possible to compare
them directly with the iio_chan_info_enum enum. Correct that bit using the BIT()
macro.

Cc: &lt;stable@vger.kernel.org&gt; # 3.10.x
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.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>
Since the info_mask split, iio_channel_has_info() is not working correctly.
info_mask_separate and info_mask_shared_by_type, it is not possible to compare
them directly with the iio_chan_info_enum enum. Correct that bit using the BIT()
macro.

Cc: &lt;stable@vger.kernel.org&gt; # 3.10.x
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio:core drop info_mask from struct iio_info</title>
<updated>2013-03-17T19:49:44+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2013-02-27T19:43:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b9606e2aa97d3d831d1236c0e789a33a2f867a8a'/>
<id>b9606e2aa97d3d831d1236c0e789a33a2f867a8a</id>
<content type='text'>
This has been replaced by the pair of masks info_mask_separate
and info_mask_shared_by_type.  Other variants may follow.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This has been replaced by the pair of masks info_mask_separate
and info_mask_shared_by_type.  Other variants may follow.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Add broken out info_mask fields for shared_by_type and separate</title>
<updated>2013-03-17T19:49:09+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2013-02-19T21:10:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8655cc490e83f66476de8c1294411860325c3531'/>
<id>8655cc490e83f66476de8c1294411860325c3531</id>
<content type='text'>
This simplifies the code, removes an extensive layer of 'helper' macros
and gives us twice as much room to play with in these masks before we
have any need to be clever.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This simplifies the code, removes an extensive layer of 'helper' macros
and gives us twice as much room to play with in these masks before we
have any need to be clever.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Factor out fixed point number parsing into its own function</title>
<updated>2012-11-20T21:26:39+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2012-11-20T13:36:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6807d7211327dbdd8df3692f3d26ca711514ba71'/>
<id>6807d7211327dbdd8df3692f3d26ca711514ba71</id>
<content type='text'>
Factor out the code for parsing fixed point numbers into its own function and
make this function globally available. This allows us to reuse the code to parse
fixed point numbers in individual IIO drivers.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Factor out the code for parsing fixed point numbers into its own function and
make this function globally available. This allows us to reuse the code to parse
fixed point numbers in individual IIO drivers.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging:iio: Add support for multiple buffers</title>
<updated>2012-11-10T10:17:21+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2012-06-30T19:06:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=84b36ce5f79c01f792c623f14e92ed86cdccb42f'/>
<id>84b36ce5f79c01f792c623f14e92ed86cdccb42f</id>
<content type='text'>
Route all buffer writes through the demux.
Addition or removal of a buffer results in tear down and
setup of all the buffers for a given device.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Tested-by: srinivas pandruvada &lt;srinivas.pandruvada@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Route all buffer writes through the demux.
Addition or removal of a buffer results in tear down and
setup of all the buffers for a given device.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Tested-by: srinivas pandruvada &lt;srinivas.pandruvada@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Add some helper macros for unit conversion</title>
<updated>2012-10-19T15:12:38+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2012-10-15T09:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9dbf8ccde1b810a59b684e1d1aec7f9d2d007162'/>
<id>9dbf8ccde1b810a59b684e1d1aec7f9d2d007162</id>
<content type='text'>
Some datasheets use a different unit to specify the channel scale than what IIO
expects it to be. This patch adds two helper macros which allow to convert units
commonly used in datasheets to IIO units:

 * acceleration: g -&gt; meter / second**2
 * angular velocity: degree (/ second) -&gt; rad (/ second)

This makes it much more convenient to specify and also easier to verify a
channel's scale attribute.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some datasheets use a different unit to specify the channel scale than what IIO
expects it to be. This patch adds two helper macros which allow to convert units
commonly used in datasheets to IIO units:

 * acceleration: g -&gt; meter / second**2
 * angular velocity: degree (/ second) -&gt; rad (/ second)

This makes it much more convenient to specify and also easier to verify a
channel's scale attribute.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
