summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)Author
2015-02-13Merge branch 'rtmerge'Scott Wood
Signed-off-by: Scott Wood <scottwood@freescale.com> Conflicts: arch/arm/kvm/mmu.c arch/arm/mm/proc-v7-3level.S arch/powerpc/kernel/vdso32/getcpu.S drivers/crypto/caam/error.c drivers/crypto/caam/sg_sw_sec4.h drivers/usb/host/ehci-fsl.c
2015-02-13Reset to 3.12.37Scott Wood
2014-04-08Merge branch 'sdk-kernel-3.12' into sdk-v1.6.xScott Wood
2014-04-08kfifo API type safetyStefani Seibold
This patch enhances the type safety for the kfifo API. It is now safe to put const data into a non const FIFO and the API will now generate a compiler warning when reading from the fifo where the destination address is pointing to a const variable. As a side effect the kfifo_put() does now expect the value of an element instead a pointer to the element. This was suggested Russell King. It make the handling of the kfifo_put easier since there is no need to create a helper variable for getting the address of a pointer or to pass integers of different sizes. IMHO the API break is okay, since there are currently only six users of kfifo_put(). The code is also cleaner by kicking out the "if (0)" expressions. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stefani Seibold <stefani@seibold.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit 498d319bb512992ef0784c278fa03679f2f5649d) Signed-off-by: Scott Wood <scottwood@freescale.com> Conflicts: drivers/net/wireless/rt2x00/rt2800mmio.c
2014-04-07Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12Scott Wood
2014-03-05iio:gyro: bug on L3GD20H gyroscope supportDenis CIOCCA
commit a0657716416f834ef7710a9044614d50a36c3bdc upstream. 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 <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2014-02-22iio: ak8975: Fix calculation formula for convert micro tesla to gauss unitBeomho Seo
commit bef44abccb2677e8d16e50b75316d4fd1061be81 upstream. This effects the reported scale of the raw values, and thus userspace applications that use this value. One micro tesla equal 0.01 gauss. So I have fixed calculation formula And add RAW_TO_GAUSS macro. ASA is in the range of 0 to 255. If multiply 0.003, calculation result(in_magn_[*]_scale) is always 0. So multiply 3000 and return and IIO_VAL_INT_PLUS_MICRO. As a result, read_raw call back function return accurate scale value. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22iio: adis16400: Set timestamp as the last element in chan_specMarcus Folkesson
commit c76782d151dab7ecfdcdf9a01561c2d61d9b490f upstream. 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 <marcus.folkesson@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22iio: max1363: Use devm_regulator_get_optional for optional regulatorGuenter Roeck
commit 55b40d37311807a6bb2acdae0df904f54a0da3ae upstream. 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 <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09iio:adc:ad7887 Fix channel reported endianness from cpu to big endianJonathan Cameron
commit e39d99059ad7f75d7ae2d3c59055d3c476cdb0d9 upstream. Note this also sets the endianness to big endian whereas it would previously have defaulted to the cpu endian. Hence technically this is a bug fix on LE platforms. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09iio:imu:adis16400 fix pressure channel scan typeJonathan Cameron
commit 3425c0f7ac61f2fcfb7f2728e9b7ba7e27aec429 upstream. A single channel in this driver was using the IIO_ST macro. This does not provide a parameter for setting the endianness of the channel. Thus this channel will have been reported as whatever is the native endianness of the cpu rather than big endian. This means it would be incorrect on little endian platforms. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04iio:accel:kxsd9 fix missing mutex unlockFrank Zago
commit 0ee005c7dc2803125275e24598f0fb37775a6af3 upstream. This will leave a lock held after reading from the device, preventing any further reads. Signed-off-by: Frank Zago <frank@zago.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02Fix build failure for gp2ap020a00f.cRussell King - ARM Linux
drivers/built-in.o: In function `gp2ap020a00f_thresh_event_handler': powercap_sys.c:(.text+0x15f90c): undefined reference to `irq_work_queue' make[1]: *** [vmlinux] Error 1 make[1]: Target `uImage' not remade because of errors. make: *** [sub-make] Error 2 make: Target `uImage' not remade because of errors. You need the IRQ work support, but GP2AP020A00F is not selecting this symbol. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-02iio: hid-sensors: Fix power and report stateSrinivas Pandruvada
In the original HID sensor hub firmwares all Named array enums were to 0-based. But the most recent hub implemented as 1-based, because of the implementation by one of the major OS vendor. Using logical minimum for the field as the base of enum. So we add logical minimum to the selector values before setting those fields. Some sensor hub FWs already changed logical minimum from 0 to 1 to reflect this and hope every other vendor will follow. There is no easy way to add a common HID quirk for NAry elements, even if the standard specifies these field as NAry, the collection used to describe selectors is still just "logical". Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-25Merge tag 'fixes-for-3.13a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First round of fixes for IIO in the 3.13 cycle. The usual mixed bag of fixes. * 3 cases where kconfig dependencies were missing. We need to keep a closer eye on this in new drivers. * hid_sensors was abusing the iio_dev->trigger pointer. We had a round of clearing this out some time ago but this driver clearly slipped through. * A misuse of the IIO_ST macro, in mcp3422, which we should really make a concertive effort to finish removing. * Avoid a double free introduced by recent buffer reference counting in the one driver that (quite reasonably!) does things differently (am335x) * A missing mutex_unlock in kxsd9 that means that driver has been non functional for some time and no one noticed (including me who for once actually has one of the supported devices). * An incorrect assumption about the parameters of sign_extend32 in mcp3422. So nothing controversial. The only substantial patch is the hid_sensors one and that is actually just adding a new pointer to the devices private state then moving the code over to it.
2013-11-17iio:accel:kxsd9 fix missing mutex unlockFrank Zago
This will leave a lock held after reading from the device, preventing any further reads. Signed-off-by: Frank Zago <frank@zago.net> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-15kfifo API type safetyStefani Seibold
This patch enhances the type safety for the kfifo API. It is now safe to put const data into a non const FIFO and the API will now generate a compiler warning when reading from the fifo where the destination address is pointing to a const variable. As a side effect the kfifo_put() does now expect the value of an element instead a pointer to the element. This was suggested Russell King. It make the handling of the kfifo_put easier since there is no need to create a helper variable for getting the address of a pointer or to pass integers of different sizes. IMHO the API break is okay, since there are currently only six users of kfifo_put(). The code is also cleaner by kicking out the "if (0)" expressions. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stefani Seibold <stefani@seibold.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-15tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-09iio: adc: ti_am335x_adc: avoid double free of buffer.Lars-Peter Clausen
The driver is missing the iio_buffer_attach() call. As such it will attempt to free the buffer twice on removal. Introduced in commit 9e69c9 ("iio: Add reference counting for buffers"). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-09iio: Fix tcs3472 Kconfig dependenciesPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-09iio: Fix mag3110 Kconfig dependenciesPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-09iio: Fix mag3110 scan_typePeter Meerwald
last argument of IIO_ST is shift, not endianness Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-05iio: Fix sign extension table in mcp3422 driverPeter Meerwald
the index argument to sign_extend32() gives the bit position (from 0) to the sign bit so e.g. if the measurement has 16-bit resolution, we need to pass 15; a measurement of 0x8000 should be reported as -32768, not 32768 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-02iio: hid_Sensors: fix crash during trigger unregisterSrinivas Pandruvada
We can't store the trigger instance created by iio_trigger_alloc, in trig field of iio_device structure. This needs to be stored in the driver private data. Othewise it can result in crash during module unload. Hence created a trig_ptr in the common data structure for each HID sensor IIO driver and storing here. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-02iio: at91: fix error return code in at91_adc_probe()Wei Yongjun
Fix to return -ENODEV instead of 0 if non-TSMR adc don't support, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: light: vcnl4000: Remove redundant codeSachin Kamat
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Hence return the function directly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: dac: mcp4725: Remove redundant codeSachin Kamat
Remove an inconsequential print message and return directly thereby cleaning up some code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: dac: max517: Remove redundant variableSachin Kamat
Remove an inconsequential print message and return directly thereby eliminating an intermediate variable. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: dac: ad5755: Remove redundant codeSachin Kamat
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Error messages are already printed by iio_device_register(); hence not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: dac: ad5421: Remove redundant codeSachin Kamat
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Hence return the function directly. Error messages are already printed by iio_device_register(); hence not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: adc: twl6030-gpadc: Remove redundant codeSachin Kamat
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Hence return the function directly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: accel: kxsd9: Remove redundant variableSachin Kamat
Return directly thereby eliminating an intermediate variable. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: core: Add misssing bracesSachin Kamat
Silences the following checkpatch warning: WARNING: sizeof *iio_attr should be sizeof(*iio_attr) Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: core: Use pr_err instead of printkSachin Kamat
Use of pr_err is preferred to printk. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-23iio:pressure: Adds LPS001WP support also on spi interface and Kconfig fixDenis CIOCCA
Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-23iio: adc: ti_am335x_adc: Remove redundant of_match_ptrSachin Kamat
ti_adc_dt_ids is always compiled in. Hence of_match_ptr is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-23iio: adc: nau7802: Remove redundant of_match_ptrSachin Kamat
nau7802_dt_ids is always compiled in. Hence of_match_ptr is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-23iio: adc: twl6030-gpadc: Remove redundant of_match_ptrSachin Kamat
of_twl6030_match_tbl is always compiled in. Hence of_match_ptr is not necessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-23iio: Add Freescale mag3110 magnetometer driverPeter Meerwald
three-axis digital magnetometer with I2C interface datasheet is available from http://cache.freescale.com/files/sensors/doc/data_sheet/MAG3110.pdf Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-20iio:adc:max1363 support SMBus for 8-bit devicesVivien Didelot
The driver currently supports only I2C access. But supported devices with an accuracy of 8-bit are compatible with the SMBus byte access routines. This patch wraps the send and receive routines depending on the chip accuracy and fonctionnalities of its adapter. For instance, this allows us to use a MAX11603 on a ICH7 controller. This patch also simplifies the max1363_write_basic_config() routine to use the struct max1363_state fields directly. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-20iio: Correct description how to convert microtesla to gaussPeter Meerwald
this just fixes the comment; however, I'm not sure if the driver reports measurements correctly; the raw values are 0.3 uT / LSB; IIO is supposed to report magnetic fields in Gauss, so the scale should be around 1/300 (ignoring ASA) -- but value and scale are returned as VAL_INT Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-19Merge 3.12-rc6 into staging-next.Greg Kroah-Hartman
We want these fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-18iio: light: gp2ap020a00f: Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-18iio: adc: ti-adc081c: Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-18iio: adc: nau7802: Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-18iio: adc: mcp3422: Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17iio: at91: introduce touch screen support in iio adc driverJosh Wu
AT91 ADC hardware integrate touch screen support. So this patch add touch screen support for at91 adc iio driver. To enable touch screen support in adc, you need to add the dt parameters: 1. which type of touch are used? (4 or 5 wires), sample period time. 2. correct pressure detect threshold value. In the meantime, since touch screen will use a interal period trigger of adc, so it is conflict to other hardware triggers. Driver will disable the hardware trigger support if touch screen is enabled. This driver has been tested in AT91SAM9X5-EK and SAMA5D3x-EK. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: devicetree@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17iio: cm36651: Add CM36651 proximity/light sensorBeomho Seo
This patch adds a new driver for Capella CM36651 proximity and RGB sensor. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-16iio: Remove unused iio_sw_buffer_preenable()Lars-Peter Clausen
The functionality implemented by iio_sw_buffer_preenable() is now done directly in the IIO core and previous users of iio_sw_buffer_preenable() have all been updated to not use it anymore. It is unused now and can be remove. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-16iio:gp2ap020a00f: Remove redundant call to iio_sw_buffer_preenable()Lars-Peter Clausen
The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>