<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/iio, branch v3.14.3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>iio: cm36651: Fix i2c client leak and possible NULL pointer dereference</title>
<updated>2014-05-06T14:59:27+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-03-18T08:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a64345f0369251f2841bccec8054f5bdb2b673b'/>
<id>9a64345f0369251f2841bccec8054f5bdb2b673b</id>
<content type='text'>
commit d0a588a57c2b0748df8307a0865a1bbbf1624c53 upstream.

During probe the driver allocates dummy I2C devices (i2c_new_dummy())
but they aren't unregistered during driver remove or probe failure.

Additionally driver does not check the return value of i2c_new_dummy().
In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later
dereferenced by i2c_smbus_{read,write}_data() functions.

Fix issues by properly checking for i2c_new_dummy() return value and
unregistering I2C devices on driver remove or probe failure.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&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 d0a588a57c2b0748df8307a0865a1bbbf1624c53 upstream.

During probe the driver allocates dummy I2C devices (i2c_new_dummy())
but they aren't unregistered during driver remove or probe failure.

Additionally driver does not check the return value of i2c_new_dummy().
In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later
dereferenced by i2c_smbus_{read,write}_data() functions.

Fix issues by properly checking for i2c_new_dummy() return value and
unregistering I2C devices on driver remove or probe failure.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>iio: cm32181: Fix read integration time function</title>
<updated>2014-05-06T14:59:27+00:00</updated>
<author>
<name>Beomho Seo</name>
<email>beomho.seo@samsung.com</email>
</author>
<published>2014-12-03T00:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b2e3d27a269cc43bbf7fa37d28b8e554ed6b66c'/>
<id>7b2e3d27a269cc43bbf7fa37d28b8e554ed6b66c</id>
<content type='text'>
commit 41c897f8789d0d1039ed873ddcd0caabd5756e0f upstream.

In read integration time function, assign 0 to val.
Because, prevent return inaccurate value when call read integration time.

Cc: Kevin Tsai &lt;ktsai@capellamicro.com&gt;
Signed-off-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&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 41c897f8789d0d1039ed873ddcd0caabd5756e0f upstream.

In read integration time function, assign 0 to val.
Because, prevent return inaccurate value when call read integration time.

Cc: Kevin Tsai &lt;ktsai@capellamicro.com&gt;
Signed-off-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>iio: adc: at91_adc: Repair broken platform_data support</title>
<updated>2014-05-06T14:59:27+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2014-05-03T15:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ba546e37f5d0654709aeac991d78e820e0eff501'/>
<id>ba546e37f5d0654709aeac991d78e820e0eff501</id>
<content type='text'>
commit 467a44b0372d8268ce5bd90e58bde7db51c1d476 upstream.

Trying to use the at91_adc driver while not using device tree is ending up in a
kernel crash:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
[...]
[&lt;c01f3510&gt;] (at91_adc_probe) from [&lt;c0183828&gt;] (platform_drv_probe+0x18/0x48)
[&lt;c0183828&gt;] (platform_drv_probe) from [&lt;c01824a4&gt;] (driver_probe_device+0x100/0x218)
[&lt;c01824a4&gt;] (driver_probe_device) from [&lt;c0182648&gt;] (__driver_attach+0x8c/0x90)
[&lt;c0182648&gt;] (__driver_attach) from [&lt;c0180de4&gt;] (bus_for_each_dev+0x58/0x88)
[&lt;c0180de4&gt;] (bus_for_each_dev) from [&lt;c0181c7c&gt;] (bus_add_driver+0xd4/0x1d4)
[&lt;c0181c7c&gt;] (bus_add_driver) from [&lt;c0182c40&gt;] (driver_register+0x78/0xf4)
[&lt;c0182c40&gt;] (driver_register) from [&lt;c0008998&gt;] (do_one_initcall+0xe8/0x14c)
[&lt;c0008998&gt;] (do_one_initcall) from [&lt;c02f0b50&gt;] (kernel_init_freeable+0xec/0x1b4)
[&lt;c02f0b50&gt;] (kernel_init_freeable) from [&lt;c022acdc&gt;] (kernel_init+0x8/0xe4)
[&lt;c022acdc&gt;] (kernel_init) from [&lt;c0009670&gt;] (ret_from_fork+0x14/0x24)

This is because the at91_adc_caps structure is mandatory but is not filled when
using platform_data. Correct that by using an id_table. It ensues that the
driver will not match "at91_adc" anymore but it was crashing anyway.

Fixes: c46016665fff (iio: at91: ADC start-up time calculation changed since at91sam9x5)
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Tested-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Acked-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&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 467a44b0372d8268ce5bd90e58bde7db51c1d476 upstream.

Trying to use the at91_adc driver while not using device tree is ending up in a
kernel crash:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
[...]
[&lt;c01f3510&gt;] (at91_adc_probe) from [&lt;c0183828&gt;] (platform_drv_probe+0x18/0x48)
[&lt;c0183828&gt;] (platform_drv_probe) from [&lt;c01824a4&gt;] (driver_probe_device+0x100/0x218)
[&lt;c01824a4&gt;] (driver_probe_device) from [&lt;c0182648&gt;] (__driver_attach+0x8c/0x90)
[&lt;c0182648&gt;] (__driver_attach) from [&lt;c0180de4&gt;] (bus_for_each_dev+0x58/0x88)
[&lt;c0180de4&gt;] (bus_for_each_dev) from [&lt;c0181c7c&gt;] (bus_add_driver+0xd4/0x1d4)
[&lt;c0181c7c&gt;] (bus_add_driver) from [&lt;c0182c40&gt;] (driver_register+0x78/0xf4)
[&lt;c0182c40&gt;] (driver_register) from [&lt;c0008998&gt;] (do_one_initcall+0xe8/0x14c)
[&lt;c0008998&gt;] (do_one_initcall) from [&lt;c02f0b50&gt;] (kernel_init_freeable+0xec/0x1b4)
[&lt;c02f0b50&gt;] (kernel_init_freeable) from [&lt;c022acdc&gt;] (kernel_init+0x8/0xe4)
[&lt;c022acdc&gt;] (kernel_init) from [&lt;c0009670&gt;] (ret_from_fork+0x14/0x24)

This is because the at91_adc_caps structure is mandatory but is not filled when
using platform_data. Correct that by using an id_table. It ensues that the
driver will not match "at91_adc" anymore but it was crashing anyway.

Fixes: c46016665fff (iio: at91: ADC start-up time calculation changed since at91sam9x5)
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Tested-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Acked-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>iio: querying buffer scan_mask should return 0/1</title>
<updated>2014-05-06T14:59:27+00:00</updated>
<author>
<name>Alec Berg</name>
<email>alecaberg@chromium.org</email>
</author>
<published>2014-03-19T18:50:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=92c5fbd00304d038d57a282552986cd44912decf'/>
<id>92c5fbd00304d038d57a282552986cd44912decf</id>
<content type='text'>
commit 2076a20fc1a06f7b0333c62a2bb4eeeac7ed1bcb upstream.

Ensure that querying the IIO buffer scan_mask returns a value of
0 or 1. Currently querying the scan mask has the value returned
by test_bit(), which returns either true or false. For some
architectures test_bit() may return -1 for true, which will appear
to return an error when returning from iio_scan_mask_query().

Additionally, it's important for the sysfs interface to consistently
return the same thing when querying the scan_mask.

Signed-off-by: Alec Berg &lt;alecaberg@chromium.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&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 2076a20fc1a06f7b0333c62a2bb4eeeac7ed1bcb upstream.

Ensure that querying the IIO buffer scan_mask returns a value of
0 or 1. Currently querying the scan mask has the value returned
by test_bit(), which returns either true or false. For some
architectures test_bit() may return -1 for true, which will appear
to return an error when returning from iio_scan_mask_query().

Additionally, it's important for the sysfs interface to consistently
return the same thing when querying the scan_mask.

Signed-off-by: Alec Berg &lt;alecaberg@chromium.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>iio:gyro: bug on L3GD20H gyroscope support</title>
<updated>2014-02-18T10:24:49+00:00</updated>
<author>
<name>Denis CIOCCA</name>
<email>denis.ciocca@st.com</email>
</author>
<published>2014-02-14T14:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0657716416f834ef7710a9044614d50a36c3bdc'/>
<id>a0657716416f834ef7710a9044614d50a36c3bdc</id>
<content type='text'>
The driver was not able to manage the sensor: during probe function
and wai check, the driver stops and writes: "device name and WhoAmI mismatch."
The correct value of L3GD20H wai is 0xd7 instead of 0xd4.
Dropped support for the sensor.

Signed-off-by: Denis Ciocca &lt;denis.ciocca@st.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The driver was not able to manage the sensor: during probe function
and wai check, the driver stops and writes: "device name and WhoAmI mismatch."
The correct value of L3GD20H wai is 0xd7 instead of 0xd4.
Dropped support for the sensor.

Signed-off-by: Denis Ciocca &lt;denis.ciocca@st.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: cm32181: Change cm32181 ambient light sensor driver</title>
<updated>2014-02-18T10:22:30+00:00</updated>
<author>
<name>Beomho Seo</name>
<email>beomho.seo@samsung.com</email>
</author>
<published>2014-02-14T10:04:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1463a166b4eafc654874528ba5e2f66dbdfb8048'/>
<id>1463a166b4eafc654874528ba5e2f66dbdfb8048</id>
<content type='text'>
Integration time of cm32181 is guessed about milliseconds.
But cm32181_read_als_it function return IIO_VAL_INT.
So fixed to return IIO_VAL_INT_PLUS_MICRO.
Next, add .write_raw_get_fmt callback function for call iio_str_to_fixpoint.

v2: cm32181_write_als_id function fixed as it was.

Cc: Kevin Tsai &lt;ktsai@capellamicro.com&gt;
Signed-off-by: Beomho Seo &lt;beomho.seo@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>
Integration time of cm32181 is guessed about milliseconds.
But cm32181_read_als_it function return IIO_VAL_INT.
So fixed to return IIO_VAL_INT_PLUS_MICRO.
Next, add .write_raw_get_fmt callback function for call iio_str_to_fixpoint.

v2: cm32181_write_als_id function fixed as it was.

Cc: Kevin Tsai &lt;ktsai@capellamicro.com&gt;
Signed-off-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: cm36651: Fix read/write integration time function.</title>
<updated>2014-02-18T10:22:29+00:00</updated>
<author>
<name>Beomho Seo</name>
<email>beomho.seo@samsung.com</email>
</author>
<published>2014-02-14T10:04:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=26c17a1c56f957560cb96d219c13d21dfb605819'/>
<id>26c17a1c56f957560cb96d219c13d21dfb605819</id>
<content type='text'>
This patch is fixed [read/write] integration time function.
cm36651 have integration time from 1 to 640 milliseconds.
But, print more then the thousand second. when call *_integration_time attribute.
Because read_integration_time function return IIO_VAL_INT.
read integration time function is changed return IIO_VAL_INT_PLUS_MICRO;
And then .write_raw_get_fmt callback function for parse a fixed-point number from a string.
Some description is revised milliseconds unit.

v2: cm36651_write_int_time function fixed as it was.

Signed-off-by: Beomho Seo &lt;beomho.seo@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>
This patch is fixed [read/write] integration time function.
cm36651 have integration time from 1 to 640 milliseconds.
But, print more then the thousand second. when call *_integration_time attribute.
Because read_integration_time function return IIO_VAL_INT.
read integration time function is changed return IIO_VAL_INT_PLUS_MICRO;
And then .write_raw_get_fmt callback function for parse a fixed-point number from a string.
Some description is revised milliseconds unit.

v2: cm36651_write_int_time function fixed as it was.

Signed-off-by: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: max1363: Use devm_regulator_get_optional for optional regulator</title>
<updated>2014-02-08T11:46:00+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2014-01-27T18:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=55b40d37311807a6bb2acdae0df904f54a0da3ae'/>
<id>55b40d37311807a6bb2acdae0df904f54a0da3ae</id>
<content type='text'>
In kernel version 3.13, devm_regulator_get() may return no error
if a regulator is undeclared. regulator_get_voltage() will return
-EINVAL if this happens. This causes the driver to fail loading if
the vref regulator is not declared.

Since vref is optional, call devm_regulator_get_optional instead.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In kernel version 3.13, devm_regulator_get() may return no error
if a regulator is undeclared. regulator_get_voltage() will return
-EINVAL if this happens. This causes the driver to fail loading if
the vref regulator is not declared.

Since vref is optional, call devm_regulator_get_optional instead.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio:accel:bma180: Use modifier instead of index in channel specification</title>
<updated>2014-02-08T11:31:50+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2014-10-01T20:37:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5585215b6daabf898b4d40f33d1b8c1d41e85018'/>
<id>5585215b6daabf898b4d40f33d1b8c1d41e85018</id>
<content type='text'>
This driver was not complying with the ABI and the purpose of this patch
is to bring it inline so that userspace will correctly identify the channels.

Should use channel modifiers (X/Y/Z), not channel indices
timestamp channel has scan index 3, not 4

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Kravchenko Oleksandr &lt;x0199363@ti.com&gt;
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This driver was not complying with the ABI and the purpose of this patch
is to bring it inline so that userspace will correctly identify the channels.

Should use channel modifiers (X/Y/Z), not channel indices
timestamp channel has scan index 3, not 4

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Kravchenko Oleksandr &lt;x0199363@ti.com&gt;
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: adis16400: Set timestamp as the last element in chan_spec</title>
<updated>2014-02-08T11:26:06+00:00</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2014-01-24T11:24:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c76782d151dab7ecfdcdf9a01561c2d61d9b490f'/>
<id>c76782d151dab7ecfdcdf9a01561c2d61d9b490f</id>
<content type='text'>
This is necessary since timestamp is calculated as the last element
in iio_compute_scan_bytes().

Without this fix any userspace code reading the layout of the buffer via
sysfs will incorrectly interpret the data leading some nasty corruption.

Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is necessary since timestamp is calculated as the last element
in iio_compute_scan_bytes().

Without this fix any userspace code reading the layout of the buffer via
sysfs will incorrectly interpret the data leading some nasty corruption.

Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
